php-4.4.8/0000755000175000017500000000000010737115154011606 5ustar derickderickphp-4.4.8/ext/0000755000175000017500000000000010737115146012407 5ustar derickderickphp-4.4.8/ext/db/0000755000175000017500000000000010737115146012774 5ustar derickderickphp-4.4.8/ext/db/db.c0000644000175000017500000006347610736114305013540 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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: db.c,v 1.81.2.4.4.3 2007/12/31 07:22:45 sebastian Exp $ */ #define IS_EXT_MODULE #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "php.h" #include "php_globals.h" #include "safe_mode.h" #include "fopen_wrappers.h" #include "ext/standard/flock_compat.h" #include "ext/standard/info.h" #include #include #include #if HAVE_UNISTD_H #include #endif #ifdef HAVE_SYS_FILE_H #include #endif #if HAVE_FCNTL_H #include #endif #if GDBM #include #define DBM_TYPE GDBM_FILE #define DBM_MODE_TYPE int #define DBM_WRITE_MODE GDBM_WRITER #define DBM_CREATE_MODE GDBM_WRCREAT #define DBM_NEW_MODE GDBM_NEWDB #define DBM_DEFAULT_MODE GDBM_READER #define DBM_OPEN(filename, mode) gdbm_open(filename, 512, mode, 0666, 0) #define DBM_CLOSE(dbf) gdbm_close(dbf) #define DBM_STORE(dbf, key, value, mode) gdbm_store(dbf, key, value, mode) #define DBM_FETCH(dbf, key) gdbm_fetch(dbf, key) #define DBM_EXISTS(dbf, key) gdbm_exists(dbf, key) #define DBM_DELETE(dbf, key) gdbm_delete(dbf, key) #define DBM_FIRSTKEY(dbf) gdbm_firstkey(dbf) #define DBM_NEXTKEY(dbf, key) gdbm_nextkey(dbf, key) #define DBM_INSERT GDBM_INSERT #define DBM_REPLACE GDBM_REPLACE #endif #if NDBM && !GDBM #if BSD2 #define DB_DBM_HSEARCH 1 #include #else #ifdef HAVE_DB1_NDBM_H #include #else #include #endif #endif #define DBM_TYPE DBM * #define DBM_MODE_TYPE int #define DBM_WRITE_MODE O_RDWR #define DBM_CREATE_MODE O_RDWR | O_CREAT #define DBM_NEW_MODE O_RDWR | O_CREAT | O_TRUNC #define DBM_DEFAULT_MODE O_RDONLY #define DBM_OPEN(filename, mode) dbm_open(filename, mode, 0666) #define DBM_CLOSE(dbf) dbm_close(dbf) #define DBM_STORE(dbf, key, value, mode) dbm_store(dbf, key, value, mode) #define DBM_FETCH(dbf, key) dbm_fetch(dbf, key) #define DBM_EXISTS(dbf, key) php_dbm_key_exists(dbf, key) #define DBM_DELETE(dbf, key) dbm_delete(dbf, key) #define DBM_FIRSTKEY(dbf) dbm_firstkey(dbf) #define DBM_NEXTKEY(dbf, key) dbm_nextkey(dbf) /* {{{ php_dbm_key_exists */ static int php_dbm_key_exists(DBM *dbf, datum key_datum) { datum value_datum; int ret; value_datum = dbm_fetch(dbf, key_datum); if (value_datum.dptr) ret = 1; else ret = 0; return ret; } /* }}} */ #endif #if !NDBM && !GDBM #define DBM_TYPE FILE * #define DBM_MODE_TYPE char * #define DBM_WRITE_MODE "r+b" #define DBM_CREATE_MODE "a+b" #define DBM_NEW_MODE "w+b" #define DBM_DEFAULT_MODE "r" #define DBM_OPEN(filename, mode) VCWD_FOPEN(filename, mode) #define DBM_CLOSE(dbf) fclose(dbf) #define DBM_STORE(dbf, key, value, mode) flatfile_store(dbf, key, value, mode) #define DBM_FETCH(dbf, key) flatfile_fetch(dbf, key) #define DBM_EXISTS(dbf, key) flatfile_findkey(dbf, key) #define DBM_DELETE(dbf, key) flatfile_delete(dbf, key) #define DBM_FIRSTKEY(dbf) flatfile_firstkey(dbf) #define DBM_NEXTKEY(dbf, key) flatfile_nextkey(dbf) #define DBM_INSERT 0 #define DBM_REPLACE 1 typedef struct { char *dptr; int dsize; } datum; int flatfile_store(FILE *dbf, datum key, datum value, int mode); datum flatfile_fetch(FILE *dbf, datum key); int flatfile_findkey(FILE *dbf, datum key); int flatfile_delete(FILE *dbf, datum key); datum flatfile_firstkey(FILE *dbf); datum flatfile_nextkey(FILE *dbf); #endif #include "php_db.h" #include "ext/standard/php_string.h" static int le_db; /* {{{ php_find_dbm */ dbm_info *php_find_dbm(pval *id TSRMLS_DC) { list_entry *le; dbm_info *info; int numitems, i; int info_type; if (Z_TYPE_P(id) == IS_STRING) { numitems = zend_hash_next_free_element(&EG(regular_list)); for (i=1; iptr); if (!strcmp(info->filename, Z_STRVAL_P(id))) { return (dbm_info *)(le->ptr); } } } } /* didn't find it as a database filename, try as a number */ convert_to_long(id); info = zend_list_find(Z_LVAL_P(id), &info_type); if (info_type != le_db) return NULL; return info; } /* }}} */ /* {{{ proto array dblist(void) Return an associative array id->filename */ #if HELLY_0 /* New function not needed yet */ PHP_FUNCTION(db_id_list) { ulong numitems, i; zend_rsrc_list_entry *le; dbm_info *info; if (ZEND_NUM_ARGS()!=0) { ZEND_WRONG_PARAM_COUNT(); RETURN_FALSE; } if (array_init(return_value) == FAILURE) { php_error_docref(NULL TSRMLS_CC, E_ERROR, "Unable to initialize array"); RETURN_FALSE; } numitems = zend_hash_next_free_element(&EG(regular_list)); for (i=1; iptr); add_next_index_string(return_value, info->filename, 1); } } } /* }}} */ #endif /* {{{ php_get_info_db */ static char *php_get_info_db(void) { static char temp1[128]; static char temp[256]; temp1[0]='\0'; temp[0]='\0'; #ifdef DB_VERSION_STRING /* using sleepycat dbm */ strcat(temp, DB_VERSION_STRING); #endif #if GDBM sprintf(temp1, "%s", gdbm_version); strcat(temp, temp1); #endif #if NDBM && !GDBM strcat(temp, "ndbm support enabled"); #endif #if !GDBM && !NDBM strcat(temp, "flat file support enabled"); #endif #if NFS_HACK strcat(temp, "NFS hack in effect"); #endif if (!*temp) strcat(temp, "No database support"); return temp; } /* }}} */ /* {{{ PHP_MINFO_FUNCTION */ PHP_MINFO_FUNCTION(db) { /* this isn't pretty ... should break out the info a bit more (cmv) */ php_info_print_box_start(0); php_printf("%s", php_get_info_db()); php_info_print_box_end(); } /* }}} */ /* {{{ proto string dblist(void) Describes the dbm-compatible library being used */ PHP_FUNCTION(dblist) { char *str; if (ZEND_NUM_ARGS() != 0) { WRONG_PARAM_COUNT; } str = php_get_info_db(); RETURN_STRING(str, 1); } /* }}} */ /* {{{ proto int dbmopen(string filename, string mode) Opens a dbm database */ PHP_FUNCTION(dbmopen) { pval *filename, *mode; dbm_info *info=NULL; int ret; if (ZEND_NUM_ARGS()!=2 || zend_get_parameters(ht, 2, &filename, &mode)==FAILURE) { WRONG_PARAM_COUNT; } convert_to_string(filename); convert_to_string(mode); info = php_dbm_open(Z_STRVAL_P(filename), Z_STRVAL_P(mode) TSRMLS_CC); if (info) { ret = zend_list_insert(info, le_db); RETURN_LONG(ret); } else { RETURN_FALSE; } } /* }}} */ /* {{{ php_dbm_open */ dbm_info *php_dbm_open(char *filename, char *mode TSRMLS_DC) { dbm_info *info; int ret, lock=0; char *lockfn = NULL; int lockfd = 0; #if NFS_HACK int last_try = 0; struct stat sb; int retries = 0; #endif DBM_TYPE dbf=NULL; DBM_MODE_TYPE imode; if (filename == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "NULL filename passed"); return NULL; } if (PG(safe_mode) && (!php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR))) { return NULL; } if (php_check_open_basedir(filename TSRMLS_CC)) { return NULL; } switch (*mode) { case 'w': imode = DBM_WRITE_MODE; lock = 1; break; case 'c': imode = DBM_CREATE_MODE; lock = 1; break; case 'n': imode = DBM_NEW_MODE; lock = 1; break; default: imode = DBM_DEFAULT_MODE; lock = 0; break; } if (lock) { lockfn = emalloc(strlen(filename) + 5); strcpy(lockfn, filename); strcat(lockfn, ".lck"); #if NFS_HACK while((last_try = VCWD_STAT(lockfn, &sb))==0) { retries++; php_sleep(1); if (retries>30) break; } if (last_try!=0) { lockfd = open(lockfn, O_RDWR|O_CREAT, 0644); close(lockfd); } else { php_error_docref1(NULL TSRMLS_CC, filename, E_WARNING, "File appears to be locked [%s]", lockfn); return -1; } #else /* NFS_HACK */ lockfd = VCWD_OPEN_MODE(lockfn, O_RDWR|O_CREAT, 0644); if (lockfd) { flock(lockfd, LOCK_EX); close(lockfd); } else { php_error_docref1(NULL TSRMLS_CC, filename, E_WARNING, "Unable to establish lock"); } #endif /* else NFS_HACK */ } dbf = DBM_OPEN(filename, imode); #if !NDBM && !GDBM if (dbf) { setvbuf(dbf, NULL, _IONBF, 0); } #endif if (dbf) { info = (dbm_info *)emalloc(sizeof(dbm_info)); if (!info) { php_error_docref1(NULL TSRMLS_CC, filename, E_ERROR, "Problem allocating memory!"); return NULL; } info->filename = estrdup(filename); info->lockfn = lockfn; info->lockfd = lockfd; info->dbf = dbf; return info; } else { #if GDBM php_error_docref1(NULL TSRMLS_CC, filename, E_WARNING, "%d [%s], %d [%s]", gdbm_errno, gdbm_strerror(gdbm_errno), errno, strerror(errno)); if (gdbm_errno) ret = gdbm_errno; else if (errno) ret = errno; else ret = -1; #else #if NDBM #if PHP_DEBUG php_error_docref1(NULL TSRMLS_CC, filename, E_WARNING, "errno = %d [%s]\n", errno, strerror(errno)); #endif if (errno) ret=errno; else ret = -1; #else #if PHP_DEBUG php_error_docref1(NULL TSRMLS_CC, filename, E_WARNING, "errno = %d [%s]\n", errno, strerror(errno)); #endif if (errno) ret=errno; else ret = -1; #endif #endif #if NFS_HACK if (lockfn) { VCWD_UNLINK(lockfn); } #endif if (lockfn) efree(lockfn); } return NULL; } /* }}} */ /* {{{ proto bool dbmclose(int dbm_identifier) Closes a dbm database */ PHP_FUNCTION(dbmclose) { pval *id; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters(ht, 1, &id)==FAILURE) { WRONG_PARAM_COUNT; } convert_to_long(id); if (zend_list_delete(Z_LVAL_P(id)) == SUCCESS) { RETURN_TRUE; } else { RETURN_FALSE; } } /* }}} */ /* {{{ php_dbm_close */ void php_dbm_close(zend_rsrc_list_entry *rsrc TSRMLS_DC) { dbm_info *info = (dbm_info *)rsrc->ptr; DBM_TYPE dbf; int lockfd; dbf = info->dbf; #if NFS_HACK VCWD_UNLINK(info->lockfn); #else if (info->lockfn) { lockfd = VCWD_OPEN_MODE(info->lockfn, O_RDWR, 0644); flock(lockfd, LOCK_UN); close(lockfd); } #endif if (dbf) DBM_CLOSE(dbf); /* free the memory used by the dbm_info struct */ if (info->filename) efree(info->filename); if (info->lockfn) efree(info->lockfn); efree(info); } /* }}} */ /* * ret = -1 means that database was opened for read-only * ret = 0 success * ret = 1 key already exists - nothing done */ /* {{{ proto int dbminsert(int dbm_identifier, string key, string value) Inserts a value for a key in a dbm database */ PHP_FUNCTION(dbminsert) { pval *id, *key, *value; dbm_info *info; int ret; if (ZEND_NUM_ARGS()!=3||zend_get_parameters(ht, 3, &id, &key, &value) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_string(key); convert_to_string(value); info = php_find_dbm(id TSRMLS_CC); if (!info) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid database identifier %ld", Z_LVAL_P(id)); RETURN_FALSE; } ret = php_dbm_insert_replace(info, Z_STRVAL_P(key), Z_STRVAL_P(value), 0 TSRMLS_CC); RETURN_LONG(ret); } /* }}} */ /* {{{ proto int dbmreplace(int dbm_identifier, string key, string value) Replaces the value for a key in a dbm database */ PHP_FUNCTION(dbmreplace) { pval *id, *key, *value; dbm_info *info; int ret; if (ZEND_NUM_ARGS()!=3||zend_get_parameters(ht, 3, &id, &key, &value) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_string(key); convert_to_string(value); info = php_find_dbm(id TSRMLS_CC); if (!info) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid database identifier %ld", Z_LVAL_P(id)); RETURN_FALSE; } ret = php_dbm_insert_replace(info, Z_STRVAL_P(key), Z_STRVAL_P(value), 1 TSRMLS_CC); RETURN_LONG(ret); } /* }}} */ /* {{{ php_dbm_replace */ int php_dbm_insert_replace(dbm_info *info, char *key, char *value, int replace_mode TSRMLS_DC) { DBM_TYPE dbf; int ret; datum key_datum, value_datum; key = estrdup(key); value = estrdup(value); if (PG(magic_quotes_runtime)) { php_stripslashes(key, NULL TSRMLS_CC); php_stripslashes(value, NULL TSRMLS_CC); } value_datum.dptr = value; value_datum.dsize = strlen(value); key_datum.dptr = key; key_datum.dsize = strlen(key); #if GDBM_FIX key_datum.dsize++; #endif dbf = info->dbf; if (!dbf) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to locate dbm file"); ret = 1; } else { if (!replace_mode) { ret = DBM_STORE(dbf, key_datum, value_datum, DBM_INSERT); } else { ret = DBM_STORE(dbf, key_datum, value_datum, DBM_REPLACE); } } /* free the memory */ efree(key_datum.dptr); efree(value_datum.dptr); return(ret); } /* }}} */ /* {{{ proto string dbmfetch(int dbm_identifier, string key) Fetches a value for a key from a dbm database */ PHP_FUNCTION(dbmfetch) { pval *id, *key; dbm_info *info; char *ret; if (ZEND_NUM_ARGS()!=2||zend_get_parameters(ht, 2, &id, &key)==FAILURE) { WRONG_PARAM_COUNT; } convert_to_string(key); info = php_find_dbm(id TSRMLS_CC); if (!info) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid database identifier %ld", Z_LVAL_P(id)); RETURN_FALSE; } ret = php_dbm_fetch(info, Z_STRVAL_P(key) TSRMLS_CC); if (ret) { RETVAL_STRING(ret, 0); } else { RETURN_FALSE; } } /* }}} */ /* {{{ php_dbm_fetch */ char *php_dbm_fetch(dbm_info *info, char *key TSRMLS_DC) { datum key_datum, value_datum; char *ret; DBM_TYPE dbf; key_datum.dptr = key; key_datum.dsize = strlen(key); #if GDBM_FIX key_datum.dsize++; #endif value_datum.dptr = NULL; value_datum.dsize = 0; dbf = info->dbf; if (!dbf) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to locate dbm file"); return(NULL); } value_datum = DBM_FETCH(dbf, key_datum); if (value_datum.dptr) { ret = (char *)emalloc(sizeof(char) * value_datum.dsize + 1); strncpy(ret, value_datum.dptr, value_datum.dsize); ret[value_datum.dsize] = '\0'; #if GDBM /* all but NDBM use malloc to allocate the content blocks, so we need to free it */ free(value_datum.dptr); #else # if !NDBM efree(value_datum.dptr); # endif #endif } else ret = NULL; if (ret && PG(magic_quotes_runtime)) { ret = php_addslashes(ret, value_datum.dsize, NULL, 1 TSRMLS_CC); } return(ret); } /* }}} */ /* {{{ proto int dbmexists(int dbm_identifier, string key) Tells if a value exists for a key in a dbm database */ PHP_FUNCTION(dbmexists) { pval *id, *key; dbm_info *info; int ret; if (ZEND_NUM_ARGS()!=2||zend_get_parameters(ht, 2, &id, &key)==FAILURE) { WRONG_PARAM_COUNT; } convert_to_string(key); info = php_find_dbm(id TSRMLS_CC); if (!info) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid database identifier %ld", Z_LVAL_P(id)); RETURN_FALSE; } ret = php_dbm_exists(info, Z_STRVAL_P(key) TSRMLS_CC); RETURN_LONG(ret); } /* }}} */ /* {{{ php_dbm_exists */ int php_dbm_exists(dbm_info *info, char *key TSRMLS_DC) { datum key_datum; int ret; DBM_TYPE dbf; key_datum.dptr = key; key_datum.dsize = strlen(key); #if GDBM_FIX key_datum.dsize++; #endif dbf = info->dbf; if (!dbf) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to locate dbm file"); return(0); } ret = DBM_EXISTS(dbf, key_datum); return(ret); } /* }}} */ /* {{{ proto int dbmdelete(int dbm_identifier, string key) Deletes the value for a key from a dbm database */ PHP_FUNCTION(dbmdelete) { pval *id, *key; dbm_info *info; int ret; if (ZEND_NUM_ARGS()!=2||zend_get_parameters(ht, 2, &id, &key)==FAILURE) { WRONG_PARAM_COUNT; } convert_to_string(key); info = php_find_dbm(id TSRMLS_CC); if (!info) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid database identifier %ld", Z_LVAL_P(id)); RETURN_FALSE; } ret = php_dbm_delete(info, Z_STRVAL_P(key) TSRMLS_CC); RETURN_LONG(ret); } /* }}} */ /* {{{ php_dbm_delete */ int php_dbm_delete(dbm_info *info, char *key TSRMLS_DC) { datum key_datum; int ret; DBM_TYPE dbf; key_datum.dptr = key; key_datum.dsize = strlen(key); #if GDBM_FIX key_datum.dsize++; #endif dbf = info->dbf; if (!dbf) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to locate dbm file"); return(0); } ret = DBM_DELETE(dbf, key_datum); return(ret); } /* }}} */ /* {{{ proto string dbmfirstkey(int dbm_identifier) Retrieves the first key from a dbm database */ PHP_FUNCTION(dbmfirstkey) { pval *id; dbm_info *info; char *ret; if (ZEND_NUM_ARGS()!=1||zend_get_parameters(ht, 1, &id)==FAILURE) { WRONG_PARAM_COUNT; } info = php_find_dbm(id TSRMLS_CC); if (!info) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid database identifier %ld", Z_LVAL_P(id)); RETURN_FALSE; } ret = php_dbm_first_key(info TSRMLS_CC); if (!ret) { RETURN_FALSE; } else { RETVAL_STRING(ret, 0); } } /* }}} */ /* {{{ php_dbm_first_key */ char *php_dbm_first_key(dbm_info *info TSRMLS_DC) { datum ret_datum; char *ret; DBM_TYPE dbf; dbf = info->dbf; if (!dbf) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to locate dbm file"); return(NULL); } /* explicitly zero-out ret_datum */ ret_datum.dptr = NULL; ret_datum.dsize = 0; ret_datum = DBM_FIRSTKEY(dbf); if (!ret_datum.dptr) return NULL; ret = (char *)emalloc((ret_datum.dsize + 1) * sizeof(char)); strncpy(ret, ret_datum.dptr, ret_datum.dsize); ret[ret_datum.dsize] = '\0'; #if !NDBM & !GDBM efree(ret_datum.dptr); #endif return (ret); } /* }}} */ /* {{{ proto string dbmnextkey(int dbm_identifier, string key) Retrieves the next key from a dbm database */ PHP_FUNCTION(dbmnextkey) { pval *id, *key; dbm_info *info; char *ret; if (ZEND_NUM_ARGS()!=2||zend_get_parameters(ht, 2, &id, &key)==FAILURE) { WRONG_PARAM_COUNT; } convert_to_string(key); info = php_find_dbm(id TSRMLS_CC); if (!info) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid database identifier %ld", Z_LVAL_P(id)); RETURN_FALSE; } ret = php_dbm_nextkey(info, Z_STRVAL_P(key) TSRMLS_CC); if (!ret) { RETURN_FALSE; } else { RETVAL_STRING(ret, 0); } } /* }}} */ /* {{{ php_dbm_nextkey */ char *php_dbm_nextkey(dbm_info *info, char *key TSRMLS_DC) { datum key_datum, ret_datum; char *ret; DBM_TYPE dbf; key_datum.dptr = key; key_datum.dsize = strlen(key); #if GDBM_FIX key_datum.dsize++; #endif dbf = info->dbf; if (!dbf) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to locate dbm file"); return(NULL); } /* explicitly zero-out ret_datum */ ret_datum.dptr = NULL; ret_datum.dsize = 0; ret_datum = DBM_NEXTKEY(dbf, key_datum); if (ret_datum.dptr) { ret = (char *)emalloc(sizeof(char) * ret_datum.dsize + 1); strncpy(ret, ret_datum.dptr, ret_datum.dsize); ret[ret_datum.dsize] = '\0'; #if GDBM /* GDBM uses malloc to allocate the value_datum block, so we need to free it */ free(ret_datum.dptr); #else # if !NDBM efree(ret_datum.dptr); # endif #endif } else ret=NULL; if (ret && PG(magic_quotes_runtime)) { ret = php_addslashes(ret, ret_datum.dsize, NULL, 1 TSRMLS_CC); } return(ret); } /* }}} */ #if !GDBM && !NDBM static long CurrentFlatFilePos = 0L; /* {{{ flatfile_store */ int flatfile_store(FILE *dbf, datum key_datum, datum value_datum, int mode) { int ret; if (mode == DBM_INSERT) { if (flatfile_findkey(dbf, key_datum)) { return 1; } fseek(dbf, 0L, SEEK_END); fprintf(dbf, "%d\n", key_datum.dsize); fflush(dbf); ret = fwrite(key_datum.dptr, sizeof(char), key_datum.dsize, dbf); fprintf(dbf, "%d\n", value_datum.dsize); fflush(dbf); ret = fwrite(value_datum.dptr, sizeof(char), value_datum.dsize, dbf); } else { /* DBM_REPLACE */ flatfile_delete(dbf, key_datum); fprintf(dbf, "%d\n", key_datum.dsize); fflush(dbf); ret = fwrite(key_datum.dptr, sizeof(char), key_datum.dsize, dbf); fprintf(dbf, "%d\n", value_datum.dsize); ret = fwrite(value_datum.dptr, sizeof(char), value_datum.dsize, dbf); } if (ret>0) ret=0; return ret; } /* }}} */ /* {{{ flatfile_fetch */ datum flatfile_fetch(FILE *dbf, datum key_datum) { datum value_datum = {NULL, 0}; int num=0, buf_size=1024; char *buf; if (flatfile_findkey(dbf, key_datum)) { buf = emalloc((buf_size+1) * sizeof(char)); if (fgets(buf, 15, dbf)) { num = atoi(buf); if (num > buf_size) { buf_size+=num; buf = erealloc(buf, (buf_size+1)*sizeof(char)); } fread(buf, sizeof(char), num, dbf); value_datum.dptr = buf; value_datum.dsize = num; } } return value_datum; } /* }}} */ /* {{{ flatfile_delete */ int flatfile_delete(FILE *dbf, datum key_datum) { char *key = key_datum.dptr; int size = key_datum.dsize; char *buf; int num, buf_size = 1024; long pos; rewind(dbf); buf = emalloc((buf_size + 1)*sizeof(char)); while(!feof(dbf)) { /* read in the length of the key name */ if (!fgets(buf, 15, dbf)) break; num = atoi(buf); if (num > buf_size) { buf_size += num; buf = erealloc(buf, (buf_size+1)*sizeof(char)); } pos = ftell(dbf); /* read in the key name */ num = fread(buf, sizeof(char), num, dbf); if (num<0) break; *(buf+num) = '\0'; if (size == num && !memcmp(buf, key, size)) { fseek(dbf, pos, SEEK_SET); fputc(0, dbf); fflush(dbf); fseek(dbf, 0L, SEEK_END); if (buf) efree(buf); return SUCCESS; } /* read in the length of the value */ if (!fgets(buf, 15, dbf)) break; num = atoi(buf); if (num > buf_size) { buf_size+=num; if (buf) efree(buf); buf = emalloc((buf_size+1)*sizeof(char)); } /* read in the value */ num = fread(buf, sizeof(char), num, dbf); if (num<0) break; } if (buf) efree(buf); return FAILURE; } /* }}} */ /* {{{ flatfile_findkey */ int flatfile_findkey(FILE *dbf, datum key_datum) { char *buf = NULL; int num; int buf_size=1024; int ret=0; void *key = key_datum.dptr; int size = key_datum.dsize; rewind(dbf); buf = emalloc((buf_size+1)*sizeof(char)); while (!feof(dbf)) { if (!fgets(buf, 15, dbf)) break; num = atoi(buf); if (num > buf_size) { if (buf) efree(buf); buf_size+=num; buf = emalloc((buf_size+1)*sizeof(char)); } num = fread(buf, sizeof(char), num, dbf); if (num<0) break; *(buf+num) = '\0'; if (size == num) { if (!memcmp(buf, key, size)) { ret = 1; break; } } if (!fgets(buf, 15, dbf)) break; num = atoi(buf); if (num > buf_size) { if (buf) efree(buf); buf_size+=num; buf = emalloc((buf_size+1)*sizeof(char)); } num = fread(buf, sizeof(char), num, dbf); if (num<0) break; *(buf+num) = '\0'; } if (buf) efree(buf); return(ret); } /* }}} */ /* {{{ flatfile_firstkey */ datum flatfile_firstkey(FILE *dbf) { datum buf; int num; int buf_size=1024; rewind(dbf); buf.dptr = emalloc((buf_size+1)*sizeof(char)); while(!feof(dbf)) { if (!fgets(buf.dptr, 15, dbf)) break; num = atoi(buf.dptr); if (num > buf_size) { buf_size+=num; if (buf.dptr) efree(buf.dptr); buf.dptr = emalloc((buf_size+1)*sizeof(char)); } num = fread(buf.dptr, sizeof(char), num, dbf); if (num<0) break; buf.dsize = num; if (*(buf.dptr)!=0) { CurrentFlatFilePos = ftell(dbf); return(buf); } if (!fgets(buf.dptr, 15, dbf)) break; num = atoi(buf.dptr); if (num > buf_size) { buf_size+=num; if (buf.dptr) efree(buf.dptr); buf.dptr = emalloc((buf_size+1)*sizeof(char)); } num = fread(buf.dptr, sizeof(char), num, dbf); if (num<0) break; } if (buf.dptr) efree(buf.dptr); buf.dptr = NULL; return(buf); } /* }}} */ /* {{{ latfile_nextkey */ datum flatfile_nextkey(FILE *dbf) { datum buf; int num; int buf_size=1024; fseek(dbf, CurrentFlatFilePos, SEEK_SET); buf.dptr = emalloc((buf_size+1)*sizeof(char)); while(!feof(dbf)) { if (!fgets(buf.dptr, 15, dbf)) break; num = atoi(buf.dptr); if (num > buf_size) { buf_size+=num; if (buf.dptr) efree(buf.dptr); buf.dptr = emalloc((buf_size+1)*sizeof(char)); } num = fread(buf.dptr, sizeof(char), num, dbf); if (num<0) break; if (!fgets(buf.dptr, 15, dbf)) break; num = atoi(buf.dptr); if (num > buf_size) { buf_size+=num; if (buf.dptr) efree(buf.dptr); buf.dptr = emalloc((buf_size+1)*sizeof(char)); } num = fread(buf.dptr, sizeof(char), num, dbf); if (num<0) break; buf.dsize = num; if (*(buf.dptr)!=0) { CurrentFlatFilePos = ftell(dbf); return(buf); } } if (buf.dptr) efree(buf.dptr); buf.dptr = NULL; return(buf); } /* }}} */ #endif /* {{{ PHP_MINIT_FUNCTION */ PHP_MINIT_FUNCTION(db) { le_db = zend_register_list_destructors_ex(php_dbm_close, NULL, "dbm", module_number); return SUCCESS; } /* }}} */ /* {{{ PHP_RINIT_FUNCTION */ PHP_RINIT_FUNCTION(db) { #if !GDBM && !NDBM CurrentFlatFilePos = 0L; #endif return SUCCESS; } /* }}} */ /* {{{ dbm_functions[] */ function_entry dbm_functions[] = { PHP_FE(dblist, NULL) PHP_FE(dbmopen, NULL) PHP_FE(dbmclose, NULL) PHP_FE(dbminsert, NULL) PHP_FE(dbmfetch, NULL) PHP_FE(dbmreplace, NULL) PHP_FE(dbmexists, NULL) PHP_FE(dbmdelete, NULL) PHP_FE(dbmfirstkey, NULL) PHP_FE(dbmnextkey, NULL) #if HELLY_0 PHP_FE(db_id_list, NULL) #endif {NULL, NULL, NULL} }; /* }}} */ zend_module_entry dbm_module_entry = { STANDARD_MODULE_HEADER, "db", dbm_functions, PHP_MINIT(db), NULL, PHP_RINIT(db), NULL, PHP_MINFO(db), NO_VERSION_YET, STANDARD_MODULE_PROPERTIES }; #ifdef COMPILE_DL_DB ZEND_GET_MODULE(dbm) #endif /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: sw=4 ts=4 fdm=marker * vim<600: sw=4 ts=4 */ php-4.4.8/ext/db/tests/0000755000175000017500000000000010737115146014136 5ustar derickderickphp-4.4.8/ext/db/tests/test.inc0000644000175000017500000000007007555315636015617 0ustar derickderick php-4.4.8/ext/db/tests/001.phpt0000644000175000017500000000052507555315636015347 0ustar derickderick--TEST-- DBM File Creation Test --SKIPIF-- --FILE-- --EXPECT-- database file createdphp-4.4.8/ext/db/tests/002.phpt0000644000175000017500000000055407555315636015352 0ustar derickderick--TEST-- DBM Insert/Fetch Test --SKIPIF-- --FILE-- --EXPECT-- This is a test insert php-4.4.8/ext/db/tests/003.phpt0000644000175000017500000000101407562570536015343 0ustar derickderick--TEST-- DBM Insert/Replace/Fetch Test --SKIPIF-- --FILE-- --EXPECT-- This is the replacement text php-4.4.8/ext/db/tests/004.phpt0000644000175000017500000000122307555315636015346 0ustar derickderick--TEST-- DBM Multiple Insert/Fetch Test --SKIPIF-- --FILE-- --EXPECT-- Another Content String Content String 2 php-4.4.8/ext/db/tests/005.phpt0000644000175000017500000000122207555315636015346 0ustar derickderick--TEST-- DBM FirstKey/NextKey Loop Test With 5 Items --SKIPIF-- --FILE-- --EXPECT-- 5 php-4.4.8/ext/db/tests/006.phpt0000644000175000017500000000131007555315636015345 0ustar derickderick--TEST-- DBM FirstKey/NextKey with 2 deletes --SKIPIF-- --FILE-- --EXPECT-- 3 php-4.4.8/ext/db/config.m40000644000175000017500000000360710164723770014513 0ustar derickderickdnl dnl $Id: config.m4,v 1.14.4.3 2004/12/30 07:02:16 sniper Exp $ dnl # Checks for libraries. # Prefer gdbm, Berkeley DB and ndbm/dbm, in that order AC_DEFUN([AC_PREFERRED_DB_LIB],[ AC_CHECK_LIB(gdbm, gdbm_open,[AC_DEFINE(GDBM,1, [Whether you have GDBM]) DBM_TYPE=gdbm; DBM_LIB=-lgdbm], [AC_CHECK_LIB(c, dbm_open,[AC_DEFINE(NDBM,1,[ ]) DBM_TYPE=ndbm; DBM_LIB=], [AC_CHECK_LIB(dbm, dbm_open,[AC_DEFINE(NDBM,1,[ ]) DBM_TYPE=ndbm; DBM_LIB=-ldbm], [AC_CHECK_LIB(db, dbm_open,[AC_DEFINE(NDBM,1, [Whether you have NDBM]) DBM_TYPE=ndbm; DBM_LIB=-ldb], [DBM_TYPE=""]) ]) ]) ]) AC_MSG_CHECKING([preferred dbm library]) if test "a$DBM_TYPE" = a; then AC_MSG_RESULT(none found) AC_MSG_WARN(No dbm library found - using built-in flatfile support) else AC_MSG_RESULT($DBM_TYPE chosen) fi PHP_SUBST(DBM_LIB) PHP_SUBST(DBM_TYPE) ]) PHP_ARG_WITH(db, for xDBM support, [ --with-db Include old xDBM support (deprecated, use --enable-dba instead)]) if test "$PHP_DB" != "no"; then AC_PREFERRED_DB_LIB if test "$DBM_LIB" = "-lgdbm"; then AC_CHECK_HEADER(gdbm.h, [ GDBM_INCLUDE="" ], [ AC_MSG_RESULT("Try /usr/local/include/gdbm.h"); AC_CHECK_HEADER(/usr/local/include/gdbm.h, [ GDBM_INCLUDE=-I/usr/local/include ],[ AC_MSG_RESULT("Try /opt/local/include/gdbm.h"); AC_CHECK_HEADER(/opt/local/include/gdbm.h, [ GDBM_INCLUDE=-I/opt/local/include ],[ dnl if in /usr/pkg/include, do not add anything. See above. AC_MSG_RESULT("Try /usr/pkg/include/gdbm.h"); AC_CHECK_HEADER(/usr/pkg/include/gdbm.h, [ GDBM_INCLUDE="" ],[ AC_MSG_RESULT("Giving up - You need to install gdbm.h somewhere"); exit ]) ]) ]) ]) fi if test -n "$DBM_LIB"; then INCLUDES="$INCLUDES $GDBM_INCLUDE" EXTRA_LIBS="$EXTRA_LIBS $DBM_LIB" fi PHP_NEW_EXTENSION(db, db.c) fi php-4.4.8/ext/db/php_db.h0000644000175000017500000000527610736114305014406 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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: php_db.h,v 1.18.2.1.8.3 2007/12/31 07:22:45 sebastian Exp $ */ #ifndef PHP_DB_H #define PHP_DB_H #ifndef DLEXPORT #define DLEXPORT #endif extern zend_module_entry dbm_module_entry; #define phpext_db_ptr &dbm_module_entry typedef struct dbm_info { char *filename; char *lockfn; int lockfd; void *dbf; } dbm_info; /* we're not going to bother with flatfile on win32 because the dbm module will be external, and we do not want flatfile compiled staticly */ #if defined(PHP_WIN32) && !defined(COMPILE_DL_DB) #undef phpext_db_ptr #define phpext_db_ptr NULL #endif dbm_info *php_find_dbm(pval *id TSRMLS_DC); void php_dbm_close(zend_rsrc_list_entry *rsrc TSRMLS_DC); dbm_info *php_dbm_open(char *filename, char *mode TSRMLS_DC); char *php_dbm_fetch(dbm_info *info, char *key TSRMLS_DC); int php_dbm_insert_replace(dbm_info *info, char *key, char *value, int replace_mode TSRMLS_DC); int php_dbm_exists(dbm_info *info, char *key TSRMLS_DC); int php_dbm_delete(dbm_info *info, char *key TSRMLS_DC); char *php_dbm_first_key(dbm_info *info TSRMLS_DC); char *php_dbm_nextkey(dbm_info *info, char *key TSRMLS_DC); /* db file functions */ PHP_MINIT_FUNCTION(db); PHP_RINIT_FUNCTION(db); PHP_MINFO_FUNCTION(db); PHP_FUNCTION(dblist); PHP_FUNCTION(dbmopen); PHP_FUNCTION(dbmclose); PHP_FUNCTION(dbminsert); PHP_FUNCTION(dbmfetch); PHP_FUNCTION(dbmreplace); PHP_FUNCTION(dbmexists); PHP_FUNCTION(dbmdelete); PHP_FUNCTION(dbmfirstkey); PHP_FUNCTION(dbmnextkey); #endif /* PHP_DB_H */ php-4.4.8/ext/db/db.dsp0000644000175000017500000001134707564302073014100 0ustar derickderick# Microsoft Developer Studio Project File - Name="db" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 CFG=db - 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 "db.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 "db.mak" CFG="db - Win32 Release_TS" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "db - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "db - 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)" == "db - 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_DB" /D ZTS=1 /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /I "..\..\main" /D "WIN32" /D "DB_EXPORTS" /D "COMPILE_DL_DB" /D ZTS=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /D "HAVE_INET_ATON" /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 php4ts.lib /nologo /dll /machine:I386 # ADD LINK32 php4ts.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_db.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "db - 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 "COMPILE_DL_DB" /D ZTS=1 /YX /FD /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 "DB_EXPORTS" /D "COMPILE_DL_DB" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D "HAVE_INET_ATON" /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 php4ts_debug.lib /nologo /dll /machine:I386 # ADD LINK32 php4ts_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_db.dll" /libpath:"..\..\Debug_TS" !ENDIF # Begin Target # Name "db - Win32 Release_TS" # Name "db - Win32 Debug_TS" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=.\db.c # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=.\php_db.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 php-4.4.8/ext/db/CREDITS0000644000175000017500000000004107206176564014017 0ustar derickderickDBM Rasmus Lerdorf, Jim Winstead php-4.4.8/ext/gd/0000755000175000017500000000000010737115146013001 5ustar derickderickphp-4.4.8/ext/gd/gd.c0000644000175000017500000031476410736114307013553 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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 | | Jim Winstead | +----------------------------------------------------------------------+ */ /* $Id: gd.c,v 1.221.2.56.2.6 2007/12/31 07:22:47 sebastian Exp $ */ /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring Harbor Labs. */ /* Note that there is no code from the gd package in this file */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "php.h" #include "ext/standard/head.h" #include #include "SAPI.h" #include "php_gd.h" #include "ext/standard/info.h" #include "php_open_temporary_file.h" #if HAVE_SYS_WAIT_H # include #endif #if HAVE_UNISTD_H # include #endif #ifdef PHP_WIN32 # include # include #endif #if HAVE_LIBGD static int le_gd, le_gd_font; #if HAVE_LIBT1 #include static int le_ps_font, le_ps_enc; static void php_free_ps_font(zend_rsrc_list_entry *rsrc TSRMLS_DC); static void php_free_ps_enc(zend_rsrc_list_entry *rsrc TSRMLS_DC); #endif #include #include /* 1 Tiny font */ #include /* 2 Small font */ #include /* 3 Medium bold font */ #include /* 4 Large font */ #include /* 5 Giant font */ #ifdef HAVE_GD_WBMP #include "libgd/wbmp.h" #endif #ifdef ENABLE_GD_TTF # include "gdttf.h" #endif #ifndef M_PI #define M_PI 3.14159265358979323846 #endif #ifdef ENABLE_GD_TTF static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int, int); #endif #if HAVE_LIBGD15 /* it's >= 1.5, i.e. has IOCtx */ #define USE_GD_IOCTX 1 #else #undef USE_GD_IOCTX #endif #ifdef USE_GD_IOCTX #include "gd_ctx.c" #else #define gdImageCreateFromGdCtx NULL #define gdImageCreateFromGd2Ctx NULL #define gdImageCreateFromGd2partCtx NULL #define gdImageCreateFromGifCtx NULL #define gdImageCreateFromJpegCtx NULL #define gdImageCreateFromPngCtx NULL #define gdImageCreateFromWBMPCtx NULL typedef FILE gdIOCtx; #define CTX_PUTC(c, fp) fputc(c, fp) #endif #ifndef HAVE_GDIMAGECOLORRESOLVE extern int gdImageColorResolve(gdImagePtr, int, int, int); #endif #if HAVE_COLORCLOSESTHWB int gdImageColorClosestHWB(gdImagePtr im, int r, int g, int b); #endif #ifndef HAVE_GD_DYNAMIC_CTX_EX #define gdNewDynamicCtxEx(len, data, val) gdNewDynamicCtx(len, data) #endif static gdImagePtr _php_image_create_from_string (zval **Data, char *tn, gdImagePtr (*ioctx_func_p)() TSRMLS_DC); static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type, char *tn, gdImagePtr (*func_p)(), gdImagePtr (*ioctx_func_p)()); static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char *tn, void (*func_p)()); static int _php_image_type(char data[8]); static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type); static void _php_image_bw_convert(gdImagePtr im_org, gdIOCtx *out, int threshold); /* {{{ gd_functions[] */ function_entry gd_functions[] = { PHP_FE(gd_info, NULL) PHP_FE(imagearc, NULL) PHP_FE(imageellipse, NULL) PHP_FE(imagechar, NULL) PHP_FE(imagecharup, NULL) PHP_FE(imagecolorat, NULL) PHP_FE(imagecolorallocate, NULL) #if HAVE_LIBGD15 PHP_FE(imagepalettecopy, NULL) PHP_FE(imagecreatefromstring, NULL) #endif PHP_FE(imagecolorclosest, NULL) #if HAVE_COLORCLOSESTHWB PHP_FE(imagecolorclosesthwb, NULL) #endif PHP_FE(imagecolordeallocate, NULL) PHP_FE(imagecolorresolve, NULL) PHP_FE(imagecolorexact, NULL) PHP_FE(imagecolorset, NULL) PHP_FE(imagecolortransparent, NULL) PHP_FE(imagecolorstotal, NULL) PHP_FE(imagecolorsforindex, NULL) PHP_FE(imagecopy, NULL) #if HAVE_LIBGD15 PHP_FE(imagecopymerge, NULL) PHP_FE(imagecopymergegray, NULL) #endif PHP_FE(imagecopyresized, NULL) PHP_FE(imagecreate, NULL) #if HAVE_LIBGD20 PHP_FE(imagecreatetruecolor, NULL) PHP_FE(imageistruecolor, NULL) PHP_FE(imagetruecolortopalette, NULL) PHP_FE(imagesetthickness, NULL) PHP_FE(imagefilledarc, NULL) PHP_FE(imagefilledellipse, NULL) PHP_FE(imagealphablending, NULL) PHP_FE(imagesavealpha, NULL) PHP_FE(imagecolorallocatealpha, NULL) PHP_FE(imagecolorresolvealpha, NULL) PHP_FE(imagecolorclosestalpha, NULL) PHP_FE(imagecolorexactalpha, NULL) PHP_FE(imagecopyresampled, NULL) #endif #ifdef HAVE_GD_BUNDLED PHP_FE(imagerotate, NULL) PHP_FE(imageantialias, NULL) #endif #if HAVE_GD_IMAGESETTILE PHP_FE(imagesettile, NULL) #endif #if HAVE_GD_IMAGESETBRUSH PHP_FE(imagesetbrush, NULL) #endif PHP_FE(imagesetstyle, NULL) #ifdef HAVE_GD_PNG PHP_FE(imagecreatefrompng, NULL) #endif #ifdef HAVE_GD_GIF_READ PHP_FE(imagecreatefromgif, NULL) #endif #ifdef HAVE_GD_JPG PHP_FE(imagecreatefromjpeg, NULL) #endif #ifdef HAVE_GD_WBMP PHP_FE(imagecreatefromwbmp, NULL) #endif #ifdef HAVE_GD_XBM PHP_FE(imagecreatefromxbm, NULL) #endif #if defined(HAVE_GD_XPM) && defined(HAVE_GD_BUNDLED) PHP_FE(imagecreatefromxpm, NULL) #endif PHP_FE(imagecreatefromgd, NULL) #ifdef HAVE_GD_GD2 PHP_FE(imagecreatefromgd2, NULL) PHP_FE(imagecreatefromgd2part, NULL) #endif #ifdef HAVE_GD_PNG PHP_FE(imagepng, NULL) #endif #ifdef HAVE_GD_GIF_CREATE PHP_FE(imagegif, NULL) #endif #ifdef HAVE_GD_JPG PHP_FE(imagejpeg, NULL) #endif #ifdef HAVE_GD_WBMP PHP_FE(imagewbmp, NULL) #endif PHP_FE(imagegd, NULL) #ifdef HAVE_GD_GD2 PHP_FE(imagegd2, NULL) #endif PHP_FE(imagedestroy, NULL) PHP_FE(imagegammacorrect, NULL) PHP_FE(imagefill, NULL) PHP_FE(imagefilledpolygon, NULL) PHP_FE(imagefilledrectangle, NULL) PHP_FE(imagefilltoborder, NULL) PHP_FE(imagefontwidth, NULL) PHP_FE(imagefontheight, NULL) PHP_FE(imageinterlace, NULL) PHP_FE(imageline, NULL) PHP_FE(imageloadfont, NULL) PHP_FE(imagepolygon, NULL) PHP_FE(imagerectangle, NULL) PHP_FE(imagesetpixel, NULL) PHP_FE(imagestring, NULL) PHP_FE(imagestringup, NULL) PHP_FE(imagesx, NULL) PHP_FE(imagesy, NULL) PHP_FE(imagedashedline, NULL) #ifdef ENABLE_GD_TTF PHP_FE(imagettfbbox, NULL) PHP_FE(imagettftext, NULL) #if HAVE_LIBGD20 && HAVE_LIBFREETYPE && HAVE_GD_STRINGFTEX PHP_FE(imageftbbox, NULL) PHP_FE(imagefttext, NULL) #endif #endif #ifdef HAVE_LIBT1 PHP_FE(imagepsloadfont, NULL) /* PHP_FE(imagepscopyfont, NULL) */ PHP_FE(imagepsfreefont, NULL) PHP_FE(imagepsencodefont, NULL) PHP_FE(imagepsextendfont, NULL) PHP_FE(imagepsslantfont, NULL) PHP_FE(imagepstext, NULL) PHP_FE(imagepsbbox, NULL) #endif PHP_FE(imagetypes, NULL) #if defined(HAVE_GD_JPG) && defined(HAVE_GD_WBMP) PHP_FE(jpeg2wbmp, NULL) #endif #if defined(HAVE_GD_PNG) && defined(HAVE_GD_WBMP) PHP_FE(png2wbmp, NULL) #endif #ifdef HAVE_GD_WBMP PHP_FE(image2wbmp, NULL) #endif #if HAVE_GD_BUNDLED PHP_FE(imagelayereffect, NULL) PHP_FE(imagecolormatch, NULL) #endif {NULL, NULL, NULL} }; /* }}} */ zend_module_entry gd_module_entry = { STANDARD_MODULE_HEADER, "gd", gd_functions, PHP_MINIT(gd), PHP_MSHUTDOWN(gd), NULL, #if HAVE_LIBGD20 && HAVE_GD_STRINGFT && (HAVE_GD_FONTCACHESHUTDOWN || HAVE_GD_FREEFONTCACHE) PHP_RSHUTDOWN(gd), #else NULL, #endif PHP_MINFO(gd), NO_VERSION_YET, STANDARD_MODULE_PROPERTIES }; #ifdef COMPILE_DL_GD ZEND_GET_MODULE(gd) #endif /* {{{ php_free_gd_image */ static void php_free_gd_image(zend_rsrc_list_entry *rsrc TSRMLS_DC) { gdImageDestroy((gdImagePtr) rsrc->ptr); } /* }}} */ /* {{{ php_free_gd_font */ static void php_free_gd_font(zend_rsrc_list_entry *rsrc TSRMLS_DC) { gdFontPtr fp = (gdFontPtr) rsrc->ptr; if (fp->data) { efree(fp->data); } efree(fp); } /* }}} */ /* {{{ PHP_MSHUTDOWN_FUNCTION */ PHP_MSHUTDOWN_FUNCTION(gd) { #if HAVE_LIBT1 T1_CloseLib(); #endif return SUCCESS; } /* }}} */ /* {{{ PHP_MINIT_FUNCTION */ PHP_MINIT_FUNCTION(gd) { le_gd = zend_register_list_destructors_ex(php_free_gd_image, NULL, "gd", module_number); le_gd_font = zend_register_list_destructors_ex(php_free_gd_font, NULL, "gd font", module_number); #if HAVE_LIBT1 T1_SetBitmapPad(8); T1_InitLib(NO_LOGFILE | IGNORE_CONFIGFILE | IGNORE_FONTDATABASE); T1_SetLogLevel(T1LOG_DEBUG); le_ps_font = zend_register_list_destructors_ex(php_free_ps_font, NULL, "gd PS font", module_number); le_ps_enc = zend_register_list_destructors_ex(php_free_ps_enc, NULL, "gd PS encoding", module_number); #endif REGISTER_LONG_CONSTANT("IMG_GIF", 1, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("IMG_JPG", 2, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("IMG_JPEG", 2, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("IMG_PNG", 4, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("IMG_WBMP", 8, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("IMG_XPM", 16, CONST_CS | CONST_PERSISTENT); #ifdef gdTiled /* special colours for gd */ REGISTER_LONG_CONSTANT("IMG_COLOR_TILED", gdTiled, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("IMG_COLOR_STYLED", gdStyled, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("IMG_COLOR_BRUSHED", gdBrushed, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("IMG_COLOR_STYLEDBRUSHED", gdStyledBrushed, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("IMG_COLOR_TRANSPARENT", gdTransparent, CONST_CS | CONST_PERSISTENT); #endif #if HAVE_LIBGD20 /* for imagefilledarc */ REGISTER_LONG_CONSTANT("IMG_ARC_ROUNDED", gdArc, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("IMG_ARC_PIE", gdPie, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("IMG_ARC_CHORD", gdChord, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("IMG_ARC_NOFILL", gdNoFill, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("IMG_ARC_EDGED", gdEdged, CONST_CS | CONST_PERSISTENT); #endif /* GD2 image format types */ #ifdef GD2_FMT_RAW REGISTER_LONG_CONSTANT("IMG_GD2_RAW", GD2_FMT_RAW, CONST_CS | CONST_PERSISTENT); #endif #ifdef GD2_FMT_COMPRESSED REGISTER_LONG_CONSTANT("IMG_GD2_COMPRESSED", GD2_FMT_COMPRESSED, CONST_CS | CONST_PERSISTENT); #endif #if HAVE_GD_BUNDLED REGISTER_LONG_CONSTANT("IMG_EFFECT_REPLACE", gdEffectReplace, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("IMG_EFFECT_ALPHABLEND", gdEffectAlphaBlend, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("IMG_EFFECT_NORMAL", gdEffectNormal, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("IMG_EFFECT_OVERLAY", gdEffectOverlay, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("GD_BUNDLED", 1, CONST_CS | CONST_PERSISTENT); #else REGISTER_LONG_CONSTANT("GD_BUNDLED", 0, CONST_CS | CONST_PERSISTENT); #endif return SUCCESS; } /* }}} */ /* {{{ PHP_RSHUTDOWN_FUNCTION */ #if HAVE_LIBGD20 && HAVE_GD_STRINGFT && (HAVE_GD_FONTCACHESHUTDOWN || HAVE_GD_FREEFONTCACHE) PHP_RSHUTDOWN_FUNCTION(gd) { #if HAVE_GD_FONTCACHESHUTDOWN gdFontCacheShutdown(); #else gdFreeFontCache(); #endif return SUCCESS; } #endif /* }}} */ #if HAVE_GD_BUNDLED #define PHP_GD_VERSION_STRING "bundled (2.0.28 compatible)" #elif HAVE_LIBGD20 #define PHP_GD_VERSION_STRING "2.0 or higher" #elif HAVE_GDIMAGECOLORRESOLVE #define PHP_GD_VERSION_STRING "1.6.2 or higher" #elif HAVE_LIBGD13 #define PHP_GD_VERSION_STRING "between 1.3 and 1.6.1" #else #define PHP_GD_VERSION_STRING "1.2" #endif /* {{{ PHP_MINFO_FUNCTION */ PHP_MINFO_FUNCTION(gd) { php_info_print_table_start(); php_info_print_table_row(2, "GD Support", "enabled"); /* need to use a PHPAPI function here because it is external module in windows */ php_info_print_table_row(2, "GD Version", PHP_GD_VERSION_STRING); #ifdef ENABLE_GD_TTF php_info_print_table_row(2, "FreeType Support", "enabled"); #if HAVE_LIBFREETYPE php_info_print_table_row(2, "FreeType Linkage", "with freetype"); #elif HAVE_LIBTTF php_info_print_table_row(2, "FreeType Linkage", "with TTF library"); #else php_info_print_table_row(2, "FreeType Linkage", "with unknown library"); #endif #endif #ifdef HAVE_LIBT1 php_info_print_table_row(2, "T1Lib Support", "enabled"); #endif /* this next part is stupid ... if I knew better, I'd put them all on one row (cmv) */ #ifdef HAVE_GD_GIF_READ php_info_print_table_row(2, "GIF Read Support", "enabled"); #endif #ifdef HAVE_GD_GIF_CREATE php_info_print_table_row(2, "GIF Create Support", "enabled"); #endif #ifdef HAVE_GD_JPG php_info_print_table_row(2, "JPG Support", "enabled"); #endif #ifdef HAVE_GD_PNG php_info_print_table_row(2, "PNG Support", "enabled"); #endif #ifdef HAVE_GD_WBMP php_info_print_table_row(2, "WBMP Support", "enabled"); #endif #ifdef HAVE_GD_XBM php_info_print_table_row(2, "XBM Support", "enabled"); #endif #if defined(USE_GD_JISX0208) && defined(HAVE_GD_BUNDLED) php_info_print_table_row(2, "JIS-mapped Japanese Font Support", "enabled"); #endif php_info_print_table_end(); } /* }}} */ /* {{{ proto array gd_info() */ PHP_FUNCTION(gd_info) { if (ZEND_NUM_ARGS() != 0) { ZEND_WRONG_PARAM_COUNT(); RETURN_FALSE; } array_init(return_value); add_assoc_string(return_value, "GD Version", PHP_GD_VERSION_STRING, 1); #ifdef ENABLE_GD_TTF add_assoc_bool(return_value, "FreeType Support", 1); #if HAVE_LIBFREETYPE add_assoc_string(return_value, "FreeType Linkage", "with freetype", 1); #elif HAVE_LIBTTF add_assoc_string(return_value, "FreeType Linkage", "with TTF library", 1); #else add_assoc_string(return_value, "FreeType Linkage", "with unknown library", 1); #endif #else add_assoc_bool(return_value, "FreeType Support", 0); #endif #ifdef HAVE_LIBT1 add_assoc_bool(return_value, "T1Lib Support", 1); #else add_assoc_bool(return_value, "T1Lib Support", 0); #endif #ifdef HAVE_GD_GIF_READ add_assoc_bool(return_value, "GIF Read Support", 1); #else add_assoc_bool(return_value, "GIF Read Support", 0); #endif #ifdef HAVE_GD_GIF_CREATE add_assoc_bool(return_value, "GIF Create Support", 1); #else add_assoc_bool(return_value, "GIF Create Support", 0); #endif #ifdef HAVE_GD_JPG add_assoc_bool(return_value, "JPG Support", 1); #else add_assoc_bool(return_value, "JPG Support", 0); #endif #ifdef HAVE_GD_PNG add_assoc_bool(return_value, "PNG Support", 1); #else add_assoc_bool(return_value, "PNG Support", 0); #endif #ifdef HAVE_GD_WBMP add_assoc_bool(return_value, "WBMP Support", 1); #else add_assoc_bool(return_value, "WBMP Support", 0); #endif #ifdef HAVE_GD_XBM add_assoc_bool(return_value, "XBM Support", 1); #else add_assoc_bool(return_value, "XBM Support", 0); #endif #if defined(USE_GD_JISX0208) && defined(HAVE_GD_BUNDLED) add_assoc_bool(return_value, "JIS-mapped Japanese Font Support", 1); #else add_assoc_bool(return_value, "JIS-mapped Japanese Font Support", 0); #endif } /* }}} */ /* Need this for cpdf. See also comment in file.c php3i_get_le_fp() */ PHP_GD_API int phpi_get_le_gd(void) { return le_gd; } #ifndef HAVE_GDIMAGECOLORRESOLVE /* {{{ gdImageColorResolve */ /********************************************************************/ /* gdImageColorResolve is a replacement for the old fragment: */ /* */ /* if ((color=gdImageColorExact(im,R,G,B)) < 0) */ /* if ((color=gdImageColorAllocate(im,R,G,B)) < 0) */ /* color=gdImageColorClosest(im,R,G,B); */ /* */ /* in a single function */ int gdImageColorResolve(gdImagePtr im, int r, int g, int b) { int c; int ct = -1; int op = -1; long rd, gd, bd, dist; long mindist = 3*255*255; /* init to max poss dist */ for (c = 0; c < im->colorsTotal; c++) { if (im->open[c]) { op = c; /* Save open slot */ continue; /* Color not in use */ } rd = (long) (im->red [c] - r); gd = (long) (im->green[c] - g); bd = (long) (im->blue [c] - b); dist = rd * rd + gd * gd + bd * bd; if (dist < mindist) { if (dist == 0) { return c; /* Return exact match color */ } mindist = dist; ct = c; } } /* no exact match. We now know closest, but first try to allocate exact */ if (op == -1) { op = im->colorsTotal; if (op == gdMaxColors) { /* No room for more colors */ return ct; /* Return closest available color */ } im->colorsTotal++; } im->red [op] = r; im->green[op] = g; im->blue [op] = b; im->open [op] = 0; return op; /* Return newly allocated color */ } /* }}} */ #endif #define FLIPWORD(a) (((a & 0xff000000) >> 24) | ((a & 0x00ff0000) >> 8) | ((a & 0x0000ff00) << 8) | ((a & 0x000000ff) << 24)) /* {{{ proto int imageloadfont(string filename) Load a new font */ PHP_FUNCTION(imageloadfont) { zval **file; int hdr_size = sizeof(gdFont) - sizeof(char *); int ind, body_size, n = 0, b, i, body_size_check; gdFontPtr font; php_stream *stream; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &file) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } convert_to_string_ex(file); stream = php_stream_open_wrapper(Z_STRVAL_PP(file), "rb", ENFORCE_SAFE_MODE | IGNORE_PATH | IGNORE_URL_WIN | REPORT_ERRORS, NULL); if (stream == NULL) { RETURN_FALSE; } /* Only supports a architecture-dependent binary dump format * at the moment. * The file format is like this on machines with 32-byte integers: * * byte 0-3: (int) number of characters in the font * byte 4-7: (int) value of first character in the font (often 32, space) * byte 8-11: (int) pixel width of each character * byte 12-15: (int) pixel height of each character * bytes 16-: (char) array with character data, one byte per pixel * in each character, for a total of * (nchars*width*height) bytes. */ font = (gdFontPtr) emalloc(sizeof(gdFont)); b = 0; while (b < hdr_size && (n = php_stream_read(stream, (char*)&font[b], hdr_size - b))) { b += n; } if (!n) { efree(font); if (php_stream_eof(stream)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "End of file while reading header"); } else { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error while reading header"); } php_stream_close(stream); RETURN_FALSE; } i = php_stream_tell(stream); php_stream_seek(stream, 0, SEEK_END); body_size_check = php_stream_tell(stream) - hdr_size; php_stream_seek(stream, i, SEEK_SET); body_size = font->w * font->h * font->nchars; if (body_size != body_size_check) { font->w = FLIPWORD(font->w); font->h = FLIPWORD(font->h); font->nchars = FLIPWORD(font->nchars); body_size = font->w * font->h * font->nchars; } if (body_size != body_size_check) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error reading font"); efree(font); php_stream_close(stream); RETURN_FALSE; } font->data = emalloc(body_size); b = 0; while (b < body_size && (n = php_stream_read(stream, &font->data[b], body_size - b))) { b += n; } if (!n) { efree(font->data); efree(font); if (php_stream_eof(stream)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "End of file while reading body"); } else { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error while reading body"); } php_stream_close(stream); RETURN_FALSE; } php_stream_close(stream); /* Adding 5 to the font index so we will never have font indices * that overlap with the old fonts (with indices 1-5). The first * list index given out is always 1. */ ind = 5 + zend_list_insert(font, le_gd_font); RETURN_LONG(ind); } /* }}} */ /* {{{ proto bool imagesetstyle(resource im, array styles) Set the line drawing styles for use with imageline and IMG_COLOR_STYLED. */ PHP_FUNCTION(imagesetstyle) { zval **IM, **styles; gdImagePtr im; int * stylearr; int index; HashPosition pos; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &IM, &styles) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); convert_to_array_ex(styles); /* copy the style values in the stylearr */ stylearr = safe_emalloc(sizeof(int), zend_hash_num_elements(HASH_OF(*styles)), 0); zend_hash_internal_pointer_reset_ex(HASH_OF(*styles), &pos); for (index = 0;; zend_hash_move_forward_ex(HASH_OF(*styles), &pos)) { zval ** item; if (zend_hash_get_current_data_ex(HASH_OF(*styles), (void **) &item, &pos) == FAILURE) { break; } convert_to_long_ex(item); stylearr[index++] = Z_LVAL_PP(item); } gdImageSetStyle(im, stylearr, index); efree(stylearr); RETURN_TRUE; } /* }}} */ #if HAVE_LIBGD20 /* {{{ proto resource imagecreatetruecolor(int x_size, int y_size) Create a new true color image */ PHP_FUNCTION(imagecreatetruecolor) { zval **x_size, **y_size; gdImagePtr im; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &x_size, &y_size) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } convert_to_long_ex(x_size); convert_to_long_ex(y_size); if (Z_LVAL_PP(x_size) <= 0 || Z_LVAL_PP(y_size) <= 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid image dimensions"); RETURN_FALSE; } im = gdImageCreateTrueColor(Z_LVAL_PP(x_size), Z_LVAL_PP(y_size)); ZEND_REGISTER_RESOURCE(return_value, im, le_gd); } /* }}} */ /* {{{ proto bool imageistruecolor(resource im) return true if the image uses truecolor */ PHP_FUNCTION(imageistruecolor) { zval **IM; gdImagePtr im; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &IM) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); RETURN_BOOL(im->trueColor); } /* }}} */ /* {{{ proto void imagetruecolortopalette(resource im, bool ditherFlag, int colorsWanted) Convert a true colour image to a palette based image with a number of colours, optionally using dithering. */ PHP_FUNCTION(imagetruecolortopalette) { zval **IM, **dither, **ncolors; gdImagePtr im; if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &IM, &dither, &ncolors) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); convert_to_boolean_ex(dither); convert_to_long_ex(ncolors); if (Z_LVAL_PP(ncolors) <= 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of colors has to be greater than zero"); RETURN_FALSE; } gdImageTrueColorToPalette(im, Z_LVAL_PP(dither), Z_LVAL_PP(ncolors)); RETURN_TRUE; } /* }}} */ #if HAVE_GD_BUNDLED /* {{{ proto bool imagecolormatch(resource im1, resource im2) Makes the colors of the palette version of an image more closely match the true color version */ PHP_FUNCTION(imagecolormatch) { zval **IM1, **IM2; gdImagePtr im1, im2; int result; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &IM1, &IM2 ) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im1, gdImagePtr, IM1, -1, "Image", le_gd); ZEND_FETCH_RESOURCE(im2, gdImagePtr, IM2, -1, "Image", le_gd); result = gdImageColorMatch(im1, im2); switch (result) { case -1: php_error_docref(NULL TSRMLS_CC, E_ERROR, "Image1 must be TrueColor" ); RETURN_FALSE; break; case -2: php_error_docref(NULL TSRMLS_CC, E_ERROR, "Image2 must be Palette" ); RETURN_FALSE; break; case -3: php_error_docref(NULL TSRMLS_CC, E_ERROR, "Image1 and Image2 must be the same size" ); RETURN_FALSE; break; } RETURN_TRUE; } /* }}} */ #endif /* {{{ proto bool imagesetthickness(resource im, int thickness) Set line thickness for drawing lines, ellipses, rectangles, polygons etc. */ PHP_FUNCTION(imagesetthickness) { zval **IM, **thick; gdImagePtr im; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &IM, &thick) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); convert_to_long_ex(thick); gdImageSetThickness(im, Z_LVAL_PP(thick)); RETURN_TRUE; } /* }}} */ /* {{{ proto bool imagefilledellipse(resource im, int cx, int cy, int w, int h, int color) Draw an ellipse */ PHP_FUNCTION(imagefilledellipse) { zval **IM, **cx, **cy, **w, **h, **color; gdImagePtr im; if (ZEND_NUM_ARGS() != 6 || zend_get_parameters_ex(6, &IM, &cx, &cy, &w, &h, &color) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); convert_to_long_ex(cx); convert_to_long_ex(cy); convert_to_long_ex(w); convert_to_long_ex(h); convert_to_long_ex(color); gdImageFilledEllipse(im, Z_LVAL_PP(cx), Z_LVAL_PP(cy), Z_LVAL_PP(w), Z_LVAL_PP(h), Z_LVAL_PP(color)); RETURN_TRUE; } /* }}} */ /* {{{ proto bool imagefilledarc(resource im, int cx, int cy, int w, int h, int s, int e, int col, int style) Draw a filled partial ellipse */ PHP_FUNCTION(imagefilledarc) { zval **IM, **cx, **cy, **w, **h, **ST, **E, **col, **style; gdImagePtr im; int e, st; if (ZEND_NUM_ARGS() != 9 || zend_get_parameters_ex(9, &IM, &cx, &cy, &w, &h, &ST, &E, &col, &style) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); convert_to_long_ex(cx); convert_to_long_ex(cy); convert_to_long_ex(w); convert_to_long_ex(h); convert_to_long_ex(ST); convert_to_long_ex(E); convert_to_long_ex(col); convert_to_long_ex(style); e = Z_LVAL_PP(E); if (e < 0) { e %= 360; } st = Z_LVAL_PP(ST); if (st < 0) { st %= 360; } gdImageFilledArc(im, Z_LVAL_PP(cx), Z_LVAL_PP(cy), Z_LVAL_PP(w), Z_LVAL_PP(h), st, e, Z_LVAL_PP(col), Z_LVAL_PP(style)); RETURN_TRUE; } /* }}} */ /* {{{ proto bool imagealphablending(resource im, bool on) Turn alpha blending mode on or off for the given image */ PHP_FUNCTION(imagealphablending) { zval **IM, **blend; gdImagePtr im; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &IM, &blend) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); convert_to_boolean_ex(blend); gdImageAlphaBlending(im, Z_LVAL_PP(blend)); RETURN_TRUE; } /* }}} */ #if HAVE_LIBGD20 /* {{{ proto bool imagesavealpha(resource im, bool on) Include alpha channel to a saved image */ PHP_FUNCTION(imagesavealpha) { zval **IM, **save; gdImagePtr im; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &IM, &save) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); convert_to_boolean_ex(save); gdImageSaveAlpha(im, Z_LVAL_PP(save)); RETURN_TRUE; } #endif #if HAVE_GD_BUNDLED /* {{{ proto bool imagelayereffect(resource im, int effect) Set the alpha blending flag to use the bundled libgd layering effects */ PHP_FUNCTION(imagelayereffect) { zval **IM, **effect; gdImagePtr im; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &IM, &effect) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); convert_to_long_ex(effect); gdImageAlphaBlending(im, Z_LVAL_PP(effect) ); RETURN_TRUE; } /* }}} */ #endif /* {{{ proto int imagecolorallocatealpha(resource im, int red, int green, int blue, int alpha) Allocate a color with an alpha level. Works for true color and palette based images */ PHP_FUNCTION(imagecolorallocatealpha) { zval *IM; long red, green, blue, alpha; gdImagePtr im; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zllll", &IM, &red, &green, &blue, &alpha) == FAILURE) { RETURN_FALSE; } ZEND_FETCH_RESOURCE(im, gdImagePtr, &IM, -1, "Image", le_gd); RETURN_LONG(gdImageColorAllocateAlpha(im, red, green, blue, alpha)); } /* }}} */ /* {{{ proto int imagecolorresolvealpha(resource im, int red, int green, int blue, int alpha) Resolve/Allocate a colour with an alpha level. Works for true colour and palette based images */ PHP_FUNCTION(imagecolorresolvealpha) { zval **IM, ** red, **green, **blue, **alpha; gdImagePtr im; if (ZEND_NUM_ARGS() != 5 || zend_get_parameters_ex(5, &IM, &red, &green, &blue, &alpha) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); convert_to_long_ex(red); convert_to_long_ex(green); convert_to_long_ex(blue); convert_to_long_ex(alpha); RETURN_LONG(gdImageColorResolveAlpha(im, Z_LVAL_PP(red), Z_LVAL_PP(green), Z_LVAL_PP(blue), Z_LVAL_PP(alpha))); } /* }}} */ /* {{{ proto int imagecolorclosestalpha(resource im, int red, int green, int blue, int alpha) Find the closest matching colour with alpha transparency */ PHP_FUNCTION(imagecolorclosestalpha) { zval **IM, ** red, **green, **blue, **alpha; gdImagePtr im; if (ZEND_NUM_ARGS() != 5 || zend_get_parameters_ex(5, &IM, &red, &green, &blue, &alpha) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); convert_to_long_ex(red); convert_to_long_ex(green); convert_to_long_ex(blue); convert_to_long_ex(alpha); RETURN_LONG(gdImageColorClosestAlpha(im, Z_LVAL_PP(red), Z_LVAL_PP(green), Z_LVAL_PP(blue), Z_LVAL_PP(alpha))); } /* }}} */ /* {{{ proto int imagecolorexactalpha(resource im, int red, int green, int blue, int alpha) Find exact match for colour with transparency */ PHP_FUNCTION(imagecolorexactalpha) { zval **IM, **red, **green, **blue, **alpha; gdImagePtr im; if (ZEND_NUM_ARGS() != 5 || zend_get_parameters_ex(5, &IM, &red, &green, &blue, &alpha) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); convert_to_long_ex(red); convert_to_long_ex(green); convert_to_long_ex(blue); convert_to_long_ex(alpha); RETURN_LONG(gdImageColorExactAlpha(im, Z_LVAL_PP(red), Z_LVAL_PP(green), Z_LVAL_PP(blue), Z_LVAL_PP(alpha))); } /* }}} */ /* {{{ proto bool imagecopyresampled(resource dst_im, resource src_im, int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h) Copy and resize part of an image using resampling to help ensure clarity */ PHP_FUNCTION(imagecopyresampled) { zval **SIM, **DIM, **SX, **SY, **SW, **SH, **DX, **DY, **DW, **DH; gdImagePtr im_dst, im_src; int srcH, srcW, dstH, dstW, srcY, srcX, dstY, dstX; if (ZEND_NUM_ARGS() != 10 || zend_get_parameters_ex(10, &DIM, &SIM, &DX, &DY, &SX, &SY, &DW, &DH, &SW, &SH) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im_dst, gdImagePtr, DIM, -1, "Image", le_gd); ZEND_FETCH_RESOURCE(im_src, gdImagePtr, SIM, -1, "Image", le_gd); convert_to_long_ex(SX); convert_to_long_ex(SY); convert_to_long_ex(SW); convert_to_long_ex(SH); convert_to_long_ex(DX); convert_to_long_ex(DY); convert_to_long_ex(DW); convert_to_long_ex(DH); srcX = Z_LVAL_PP(SX); srcY = Z_LVAL_PP(SY); srcH = Z_LVAL_PP(SH); srcW = Z_LVAL_PP(SW); dstX = Z_LVAL_PP(DX); dstY = Z_LVAL_PP(DY); dstH = Z_LVAL_PP(DH); dstW = Z_LVAL_PP(DW); gdImageCopyResampled(im_dst, im_src, dstX, dstY, srcX, srcY, dstW, dstH, srcW, srcH); RETURN_TRUE; } /* }}} */ #endif #ifdef HAVE_GD_BUNDLED /* {{{ proto resource imagerotate(resource src_im, float angle, int bgdcolor) Rotate an image using a custom angle */ PHP_FUNCTION(imagerotate) { zval **SIM, **ANGLE, **BGDCOLOR; gdImagePtr im_dst, im_src; double degrees; long color; if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &SIM, &ANGLE, &BGDCOLOR) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im_src, gdImagePtr, SIM, -1, "Image", le_gd); convert_to_long_ex(BGDCOLOR); color = Z_LVAL_PP(BGDCOLOR); convert_to_double_ex(ANGLE); degrees = Z_DVAL_PP(ANGLE); im_dst = gdImageRotate(im_src, degrees, color); if (im_dst != NULL) { ZEND_REGISTER_RESOURCE(return_value, im_dst, le_gd); } else { RETURN_FALSE; } } /* }}} */ #endif #if HAVE_GD_IMAGESETTILE /* {{{ proto bool imagesettile(resource image, resource tile) Set the tile image to $tile when filling $image with the "IMG_COLOR_TILED" color */ PHP_FUNCTION(imagesettile) { zval **IM, **TILE; gdImagePtr im, tile; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &IM, &TILE) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); ZEND_FETCH_RESOURCE(tile, gdImagePtr, TILE, -1, "Image", le_gd); gdImageSetTile(im, tile); RETURN_TRUE; } /* }}} */ #endif #if HAVE_GD_IMAGESETBRUSH /* {{{ proto bool imagesetbrush(resource image, resource brush) Set the brush image to $brush when filling $image with the "IMG_COLOR_BRUSHED" color */ PHP_FUNCTION(imagesetbrush) { zval **IM, **TILE; gdImagePtr im, tile; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &IM, &TILE) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); ZEND_FETCH_RESOURCE(tile, gdImagePtr, TILE, -1, "Image", le_gd); gdImageSetBrush(im, tile); RETURN_TRUE; } /* }}} */ #endif /* {{{ proto resource imagecreate(int x_size, int y_size) Create a new image */ PHP_FUNCTION(imagecreate) { zval **x_size, **y_size; gdImagePtr im; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &x_size, &y_size) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } convert_to_long_ex(x_size); convert_to_long_ex(y_size); if (Z_LVAL_PP(x_size) <= 0 || Z_LVAL_PP(y_size) <= 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid image dimensions"); RETURN_FALSE; } im = gdImageCreate(Z_LVAL_PP(x_size), Z_LVAL_PP(y_size)); ZEND_REGISTER_RESOURCE(return_value, im, le_gd); } /* }}} */ /* {{{ proto int imagetypes(void) Return the types of images supported in a bitfield - 1=GIF, 2=JPEG, 4=PNG, 8=WBMP, 16=XPM */ PHP_FUNCTION(imagetypes) { int ret=0; #ifdef HAVE_GD_GIF_CREATE ret = 1; #endif #ifdef HAVE_GD_JPG ret |= 2; #endif #ifdef HAVE_GD_PNG ret |= 4; #endif #ifdef HAVE_GD_WBMP ret |= 8; #endif #if defined(HAVE_GD_XPM) && defined(HAVE_GD_BUNDLED) ret |= 16; #endif if (ZEND_NUM_ARGS() != 0) { WRONG_PARAM_COUNT; } RETURN_LONG(ret); } /* }}} */ /* {{{ _php_image_type */ static const char php_sig_gd2[3] = {'g', 'd', '2'}; static int _php_image_type (char data[8]) { #ifdef HAVE_LIBGD15 /* Based on ext/standard/image.c */ if (data == NULL) { return -1; } if (!memcmp(data, php_sig_gd2, 3)) { return PHP_GDIMG_TYPE_GD2; } else if (!memcmp(data, php_sig_jpg, 3)) { return PHP_GDIMG_TYPE_JPG; } else if (!memcmp(data, php_sig_png, 3)) { if (!memcmp(data, php_sig_png, 8)) { return PHP_GDIMG_TYPE_PNG; } } else if (!memcmp(data, php_sig_gif, 3)) { return PHP_GDIMG_TYPE_GIF; } #ifdef HAVE_GD_WBMP else { gdIOCtx *io_ctx; io_ctx = gdNewDynamicCtxEx(8, data, 0); if (io_ctx) { if (getmbi((int(*)(void *)) gdGetC, io_ctx) == 0 && skipheader((int(*)(void *)) gdGetC, io_ctx) == 0 ) { #if HAVE_LIBGD204 io_ctx->gd_free(io_ctx); #else io_ctx->free(io_ctx); #endif return PHP_GDIMG_TYPE_WBM; } else { #if HAVE_LIBGD204 io_ctx->gd_free(io_ctx); #else io_ctx->free(io_ctx); #endif } } } #endif return -1; #endif } /* }}} */ #ifdef HAVE_LIBGD15 /* {{{ _php_image_create_from_string */ gdImagePtr _php_image_create_from_string(zval **data, char *tn, gdImagePtr (*ioctx_func_p)() TSRMLS_DC) { gdImagePtr im; gdIOCtx *io_ctx; io_ctx = gdNewDynamicCtxEx(Z_STRLEN_PP(data), Z_STRVAL_PP(data), 0); if (!io_ctx) { return NULL; } im = (*ioctx_func_p)(io_ctx); if (!im) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Passed data is not in '%s' format", tn); return NULL; } #if HAVE_LIBGD204 io_ctx->gd_free(io_ctx); #else io_ctx->free(io_ctx); #endif return im; } /* }}} */ /* {{{ proto resource imagecreatefromstring(string image) Create a new image from the image stream in the string */ PHP_FUNCTION(imagecreatefromstring) { zval **data; gdImagePtr im; int imtype; char sig[8]; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &data) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } convert_to_string_ex(data); memcpy(sig, Z_STRVAL_PP(data), 8); imtype = _php_image_type(sig); switch (imtype) { case PHP_GDIMG_TYPE_JPG: #ifdef HAVE_GD_JPG im = _php_image_create_from_string(data, "JPEG", gdImageCreateFromJpegCtx TSRMLS_CC); #else php_error_docref(NULL TSRMLS_CC, E_WARNING, "No JPEG support in this PHP build"); RETURN_FALSE; #endif break; case PHP_GDIMG_TYPE_PNG: #ifdef HAVE_GD_PNG im = _php_image_create_from_string(data, "PNG", gdImageCreateFromPngCtx TSRMLS_CC); #else php_error_docref(NULL TSRMLS_CC, E_WARNING, "No PNG support in this PHP build"); RETURN_FALSE; #endif break; case PHP_GDIMG_TYPE_GIF: #ifdef HAVE_GD_GIF_READ im = _php_image_create_from_string(data, "GIF", gdImageCreateFromGifCtx TSRMLS_CC); #else php_error_docref(NULL TSRMLS_CC, E_WARNING, "No GIF support in this PHP build"); RETURN_FALSE; #endif break; case PHP_GDIMG_TYPE_WBM: #ifdef HAVE_GD_WBMP im = _php_image_create_from_string(data, "WBMP", gdImageCreateFromWBMPCtx TSRMLS_CC); #else php_error_docref(NULL TSRMLS_CC, E_WARNING, "No WBMP support in this PHP build"); RETURN_FALSE; #endif break; case PHP_GDIMG_TYPE_GD2: #ifdef HAVE_GD_GD2 im = _php_image_create_from_string(data, "GD2", gdImageCreateFromGd2Ctx TSRMLS_CC); #else php_error_docref(NULL TSRMLS_CC, E_WARNING, "No GD2 support in this PHP build"); RETURN_FALSE; #endif break; default: php_error_docref(NULL TSRMLS_CC, E_WARNING, "Data is not in a recognized format."); RETURN_FALSE; } if (!im) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't create GD Image Stream out of Data"); RETURN_FALSE; } ZEND_REGISTER_RESOURCE(return_value, im, le_gd); } /* }}} */ #endif /* {{{ _php_image_create_from */ static void _php_image_create_from(INTERNAL_FUNCTION_PARAMETERS, int image_type, char *tn, gdImagePtr (*func_p)(), gdImagePtr (*ioctx_func_p)()) { zval **file, **srcx, **srcy, **width, **height; gdImagePtr im = NULL; char *fn=NULL; php_stream *stream; FILE * fp = NULL; int argc=ZEND_NUM_ARGS(); if ((image_type == PHP_GDIMG_TYPE_GD2PART && argc != 5) || (image_type != PHP_GDIMG_TYPE_GD2PART && argc != 1) || zend_get_parameters_ex(argc, &file, &srcx, &srcy, &width, &height) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } convert_to_string_ex(file); if (argc == 5 && image_type == PHP_GDIMG_TYPE_GD2PART) { multi_convert_to_long_ex(4, srcx, srcy, width, height); } fn = Z_STRVAL_PP(file); stream = php_stream_open_wrapper(fn, "rb", ENFORCE_SAFE_MODE|REPORT_ERRORS|IGNORE_PATH|IGNORE_URL_WIN, NULL); if (stream == NULL) { RETURN_FALSE; } #ifndef USE_GD_IOCTX ioctx_func_p = NULL; /* don't allow sockets without IOCtx */ #endif /* try and avoid allocating a FILE* if the stream is not naturally a FILE* */ if (php_stream_is(stream, PHP_STREAM_IS_STDIO)) { if (FAILURE == php_stream_cast(stream, PHP_STREAM_AS_STDIO, (void**)&fp, REPORT_ERRORS)) { goto out_err; } } else if (ioctx_func_p) { #ifdef USE_GD_IOCTX /* we can create an io context */ gdIOCtx* io_ctx; size_t buff_size; char *buff; /* needs to be malloc (persistent) - GD will free() it later */ buff_size = php_stream_copy_to_mem(stream, &buff, PHP_STREAM_COPY_ALL, 1); if (!buff_size) { php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot read image data"); goto out_err; } io_ctx = gdNewDynamicCtxEx(buff_size, buff, 0); if (!io_ctx) { php_error_docref(NULL TSRMLS_CC, E_WARNING,"Cannot allocate GD IO context"); goto out_err; } if (image_type == PHP_GDIMG_TYPE_GD2PART) { im = (*ioctx_func_p)(io_ctx, Z_LVAL_PP(srcx), Z_LVAL_PP(srcy), Z_LVAL_PP(width), Z_LVAL_PP(height)); } else { im = (*ioctx_func_p)(io_ctx); } #if HAVE_LIBGD204 io_ctx->gd_free(io_ctx); #else io_ctx->free(io_ctx); #endif #endif } else { /* try and force the stream to be FILE* */ if (FAILURE == php_stream_cast(stream, PHP_STREAM_AS_STDIO | PHP_STREAM_CAST_TRY_HARD, (void **) &fp, REPORT_ERRORS)) { goto out_err; } } if (!im && fp) { switch (image_type) { case PHP_GDIMG_TYPE_GD2PART: im = (*func_p)(fp, Z_LVAL_PP(srcx), Z_LVAL_PP(srcy), Z_LVAL_PP(width), Z_LVAL_PP(height)); break; #if defined(HAVE_GD_XPM) && defined(HAVE_GD_BUNDLED) case PHP_GDIMG_TYPE_XPM: im = gdImageCreateFromXpm(fn); break; #endif default: im = (*func_p)(fp); break; } fflush(fp); } if (im) { ZEND_REGISTER_RESOURCE(return_value, im, le_gd); php_stream_close(stream); return; } php_error_docref(NULL TSRMLS_CC, E_WARNING, "'%s' is not a valid %s file", fn, tn); out_err: php_stream_close(stream); RETURN_FALSE; } /* }}} */ #ifdef HAVE_GD_GIF_READ /* {{{ proto resource imagecreatefromgif(string filename) Create a new image from GIF file or URL */ PHP_FUNCTION(imagecreatefromgif) { _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_GIF, "GIF", gdImageCreateFromGif, gdImageCreateFromGifCtx); } /* }}} */ #endif /* HAVE_GD_GIF_READ */ #ifdef HAVE_GD_JPG /* {{{ proto resource imagecreatefromjpeg(string filename) Create a new image from JPEG file or URL */ PHP_FUNCTION(imagecreatefromjpeg) { _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_JPG, "JPEG", gdImageCreateFromJpeg, gdImageCreateFromJpegCtx); } /* }}} */ #endif /* HAVE_GD_JPG */ #ifdef HAVE_GD_PNG /* {{{ proto resource imagecreatefrompng(string filename) Create a new image from PNG file or URL */ PHP_FUNCTION(imagecreatefrompng) { _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_PNG, "PNG", gdImageCreateFromPng, gdImageCreateFromPngCtx); } /* }}} */ #endif /* HAVE_GD_PNG */ #ifdef HAVE_GD_XBM /* {{{ proto resource imagecreatefromxbm(string filename) Create a new image from XBM file or URL */ PHP_FUNCTION(imagecreatefromxbm) { _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_XBM, "XBM", gdImageCreateFromXbm, NULL); } /* }}} */ #endif /* HAVE_GD_XBM */ #if defined(HAVE_GD_XPM) && defined(HAVE_GD_BUNDLED) /* {{{ proto resource imagecreatefromxpm(string filename) Create a new image from XPM file or URL */ PHP_FUNCTION(imagecreatefromxpm) { _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_XPM, "XPM", gdImageCreateFromXpm, NULL); } /* }}} */ #endif #ifdef HAVE_GD_WBMP /* {{{ proto resource imagecreatefromwbmp(string filename) Create a new image from WBMP file or URL */ PHP_FUNCTION(imagecreatefromwbmp) { _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_WBM, "WBMP", gdImageCreateFromWBMP, gdImageCreateFromWBMPCtx); } /* }}} */ #endif /* HAVE_GD_WBMP */ /* {{{ proto resource imagecreatefromgd(string filename) Create a new image from GD file or URL */ PHP_FUNCTION(imagecreatefromgd) { _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_GD, "GD", gdImageCreateFromGd, gdImageCreateFromGdCtx); } /* }}} */ #ifdef HAVE_GD_GD2 /* {{{ proto resource imagecreatefromgd2(string filename) Create a new image from GD2 file or URL */ PHP_FUNCTION(imagecreatefromgd2) { _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_GD2, "GD2", gdImageCreateFromGd2, gdImageCreateFromGd2Ctx); } /* }}} */ /* {{{ proto resource imagecreatefromgd2part(string filename, int srcX, int srcY, int width, int height) Create a new image from a given part of GD2 file or URL */ PHP_FUNCTION(imagecreatefromgd2part) { _php_image_create_from(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_GD2PART, "GD2", gdImageCreateFromGd2Part, gdImageCreateFromGd2PartCtx); } /* }}} */ #endif /* HAVE_GD_GD2 */ /* {{{ _php_image_output */ static void _php_image_output(INTERNAL_FUNCTION_PARAMETERS, int image_type, char *tn, void (*func_p)()) { zval **imgind, **file, **quality, **type; gdImagePtr im; char *fn = NULL; FILE *fp; int argc = ZEND_NUM_ARGS(); int q = -1, i, t = 1; /* The quality parameter for Wbmp stands for the threshold when called from image2wbmp() */ /* When called from imagewbmp() the quality parameter stands for the foreground color. Default: black. */ /* The quality parameter for gd2 stands for chunk size */ if (argc < 1 || argc > 4 || zend_get_parameters_ex(argc, &imgind, &file, &quality, &type) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im, gdImagePtr, imgind, -1, "Image", le_gd); if (argc > 1) { convert_to_string_ex(file); fn = Z_STRVAL_PP(file); if (argc == 3) { convert_to_long_ex(quality); q = Z_LVAL_PP(quality); } if (argc == 4) { convert_to_long_ex(type); t = Z_LVAL_PP(type); } } if ((argc == 2) || (argc > 2 && Z_STRLEN_PP(file))) { PHP_GD_CHECK_OPEN_BASEDIR(fn, "Invalid filename"); fp = VCWD_FOPEN(fn, "wb"); if (!fp) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open '%s' for writing", fn); RETURN_FALSE; } switch (image_type) { #ifdef HAVE_GD_WBMP case PHP_GDIMG_CONVERT_WBM: if (q == -1) { q = 0; } else if (q < 0 || q > 255) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid threshold value '%d'. It must be between 0 and 255", q); q = 0; } gdImageWBMP(im, q, fp); break; #endif case PHP_GDIMG_TYPE_JPG: (*func_p)(im, fp, q); break; case PHP_GDIMG_TYPE_WBM: for (i = 0; i < gdImageColorsTotal(im); i++) { if (gdImageRed(im, i) == 0) break; } (*func_p)(im, i, fp); break; #if HAVE_LIBGD20 case PHP_GDIMG_TYPE_GD: if (im->trueColor){ gdImageTrueColorToPalette(im,1,256); } (*func_p)(im, fp); break; #endif default: if (q == -1) { q = 128; } (*func_p)(im, fp, q, t); break; } fflush(fp); fclose(fp); } else { int b; FILE *tmp; char buf[4096]; char *path; tmp = php_open_temporary_file(NULL, NULL, &path TSRMLS_CC); if (tmp == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open temporary file"); RETURN_FALSE; } switch (image_type) { #ifdef HAVE_GD_WBMP case PHP_GDIMG_CONVERT_WBM: if (q == -1) { q = 0; } else if (q < 0 || q > 255) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid threshold value '%d'. It must be between 0 and 255", q); q = 0; } gdImageWBMP(im, q, tmp); break; #endif case PHP_GDIMG_TYPE_JPG: (*func_p)(im, tmp, q); break; case PHP_GDIMG_TYPE_WBM: for (i = 0; i < gdImageColorsTotal(im); i++) { if (gdImageRed(im, i) == 0) { break; } } (*func_p)(im, q, tmp); break; #if HAVE_LIBGD20 case PHP_GDIMG_TYPE_GD: if (im->trueColor) { gdImageTrueColorToPalette(im,1,256); } (*func_p)(im, tmp); break; #endif default: (*func_p)(im, tmp); break; } fseek(tmp, 0, SEEK_SET); #if APACHE && defined(CHARSET_EBCDIC) /* XXX this is unlikely to work any more thies@thieso.net */ /* This is a binary file already: avoid EBCDIC->ASCII conversion */ ap_bsetflag(php3_rqst->connection->client, B_EBCDIC2ASCII, 0); #endif while ((b = fread(buf, 1, sizeof(buf), tmp)) > 0) { php_write(buf, b TSRMLS_CC); } fclose(tmp); VCWD_UNLINK((const char *)path); /* make sure that the temporary file is removed */ efree(path); } RETURN_TRUE; } /* }}} */ #ifdef HAVE_GD_GIF_CREATE /* {{{ proto bool imagegif(resource im [, string filename]) Output GIF image to browser or file */ PHP_FUNCTION(imagegif) { #ifdef HAVE_GD_GIF_CTX _php_image_output_ctx(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_GIF, "GIF", gdImageGifCtx); #else _php_image_output(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_GIF, "GIF", gdImageGif); #endif } /* }}} */ #endif /* HAVE_GD_GIF_CREATE */ #ifdef HAVE_GD_PNG /* {{{ proto bool imagepng(resource im [, string filename]) Output PNG image to browser or file */ PHP_FUNCTION(imagepng) { #ifdef USE_GD_IOCTX _php_image_output_ctx(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_PNG, "PNG", gdImagePngCtx); #else _php_image_output(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_PNG, "PNG", gdImagePng); #endif } /* }}} */ #endif /* HAVE_GD_PNG */ #ifdef HAVE_GD_JPG /* {{{ proto bool imagejpeg(resource im [, string filename [, int quality]]) Output JPEG image to browser or file */ PHP_FUNCTION(imagejpeg) { #ifdef USE_GD_IOCTX _php_image_output_ctx(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_JPG, "JPEG", gdImageJpegCtx); #else _php_image_output(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_JPG, "JPEG", gdImageJpeg); #endif } /* }}} */ #endif /* HAVE_GD_JPG */ #ifdef HAVE_GD_WBMP /* {{{ proto bool imagewbmp(resource im [, string filename, [, int foreground]]) Output WBMP image to browser or file */ PHP_FUNCTION(imagewbmp) { #ifdef USE_GD_IOCTX _php_image_output_ctx(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_WBM, "WBMP", gdImageWBMPCtx); #else _php_image_output(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_WBM, "WBMP", gdImageWBMP); #endif } /* }}} */ #endif /* HAVE_GD_WBMP */ /* {{{ proto bool imagegd(resource im [, string filename]) Output GD image to browser or file */ PHP_FUNCTION(imagegd) { _php_image_output(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_GD, "GD", gdImageGd); } /* }}} */ #ifdef HAVE_GD_GD2 /* {{{ proto bool imagegd2(resource im [, string filename, [, int chunk_size, [, int type]]]) Output GD2 image to browser or file */ PHP_FUNCTION(imagegd2) { _php_image_output(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_GD2, "GD2", gdImageGd2); } /* }}} */ #endif /* HAVE_GD_GD2 */ /* {{{ proto bool imagedestroy(resource im) Destroy an image */ PHP_FUNCTION(imagedestroy) { zval **IM; gdImagePtr im; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &IM) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); zend_list_delete(Z_LVAL_PP(IM)); RETURN_TRUE; } /* }}} */ /* {{{ proto int imagecolorallocate(resource im, int red, int green, int blue) Allocate a color for an image */ PHP_FUNCTION(imagecolorallocate) { zval **IM, **red, **green, **blue; gdImagePtr im; if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &IM, &red, &green, &blue) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); convert_to_long_ex(red); convert_to_long_ex(green); convert_to_long_ex(blue); RETURN_LONG(gdImageColorAllocate(im, Z_LVAL_PP(red), Z_LVAL_PP(green), Z_LVAL_PP(blue))); } /* }}} */ #if HAVE_LIBGD15 /* {{{ proto void imagepalettecopy(resource dst, resource src) Copy the palette from the src image onto the dst image */ PHP_FUNCTION(imagepalettecopy) { zval **dstim, **srcim; gdImagePtr dst, src; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &dstim, &srcim) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(dst, gdImagePtr, dstim, -1, "Image", le_gd); ZEND_FETCH_RESOURCE(src, gdImagePtr, srcim, -1, "Image", le_gd); gdImagePaletteCopy(dst, src); } /* }}} */ #endif /* {{{ proto int imagecolorat(resource im, int x, int y) Get the index of the color of a pixel */ PHP_FUNCTION(imagecolorat) { zval **IM, **x, **y; gdImagePtr im; if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &IM, &x, &y) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); convert_to_long_ex(x); convert_to_long_ex(y); #if HAVE_LIBGD20 if (gdImageTrueColor(im)) { if (im->tpixels && gdImageBoundsSafe(im, Z_LVAL_PP(x), Z_LVAL_PP(y))) { RETURN_LONG(gdImageTrueColorPixel(im, Z_LVAL_PP(x), Z_LVAL_PP(y))); } else { php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%ld,%ld is out of bounds", Z_LVAL_PP(x), Z_LVAL_PP(y)); RETURN_FALSE; } } else { #endif if (im->pixels && gdImageBoundsSafe(im, Z_LVAL_PP(x), Z_LVAL_PP(y))) { #if HAVE_LIBGD13 RETURN_LONG(im->pixels[Z_LVAL_PP(y)][Z_LVAL_PP(x)]); #else RETURN_LONG(im->pixels[Z_LVAL_PP(x)][Z_LVAL_PP(y)]); #endif } else { php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%ld,%ld is out of bounds", Z_LVAL_PP(x), Z_LVAL_PP(y)); RETURN_FALSE; } #if HAVE_LIBGD20 } #endif } /* }}} */ /* {{{ proto int imagecolorclosest(resource im, int red, int green, int blue) Get the index of the closest color to the specified color */ PHP_FUNCTION(imagecolorclosest) { zval **IM, **red, **green, **blue; gdImagePtr im; if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &IM, &red, &green, &blue) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); convert_to_long_ex(red); convert_to_long_ex(green); convert_to_long_ex(blue); RETURN_LONG(gdImageColorClosest(im, Z_LVAL_PP(red), Z_LVAL_PP(green), Z_LVAL_PP(blue))); } /* }}} */ #if HAVE_COLORCLOSESTHWB /* {{{ proto int imagecolorclosesthwb(resource im, int red, int green, int blue) Get the index of the color which has the hue, white and blackness nearest to the given color */ PHP_FUNCTION(imagecolorclosesthwb) { zval **IM, **red, **green, **blue; gdImagePtr im; if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &IM, &red, &green, &blue) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); convert_to_long_ex(red); convert_to_long_ex(green); convert_to_long_ex(blue); RETURN_LONG(gdImageColorClosestHWB(im, Z_LVAL_PP(red), Z_LVAL_PP(green), Z_LVAL_PP(blue))); } /* }}} */ #endif /* {{{ proto bool imagecolordeallocate(resource im, int index) De-allocate a color for an image */ PHP_FUNCTION(imagecolordeallocate) { zval **IM, **index; int col; gdImagePtr im; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &IM, &index) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); #if HAVE_LIBGD20 /* We can return right away for a truecolor image as deallocating colours is meaningless here */ if (gdImageTrueColor(im)) { RETURN_TRUE; } #endif convert_to_long_ex(index); col = Z_LVAL_PP(index); if (col >= 0 && col < gdImageColorsTotal(im)) { gdImageColorDeallocate(im, col); RETURN_TRUE; } else { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Color index %d out of range", col); RETURN_FALSE; } } /* }}} */ /* {{{ proto int imagecolorresolve(resource im, int red, int green, int blue) Get the index of the specified color or its closest possible alternative */ PHP_FUNCTION(imagecolorresolve) { zval **IM, **red, **green, **blue; gdImagePtr im; if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &IM, &red, &green, &blue) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); convert_to_long_ex(red); convert_to_long_ex(green); convert_to_long_ex(blue); RETURN_LONG(gdImageColorResolve(im, Z_LVAL_PP(red), Z_LVAL_PP(green), Z_LVAL_PP(blue))); } /* }}} */ /* {{{ proto int imagecolorexact(resource im, int red, int green, int blue) Get the index of the specified color */ PHP_FUNCTION(imagecolorexact) { zval **IM, **red, **green, **blue; gdImagePtr im; if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &IM, &red, &green, &blue) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); convert_to_long_ex(red); convert_to_long_ex(green); convert_to_long_ex(blue); RETURN_LONG(gdImageColorExact(im, Z_LVAL_PP(red), Z_LVAL_PP(green), Z_LVAL_PP(blue))); } /* }}} */ /* {{{ proto void imagecolorset(resource im, int col, int red, int green, int blue) Set the color for the specified palette index */ PHP_FUNCTION(imagecolorset) { zval **IM, **color, **red, **green, **blue; int col; gdImagePtr im; if (ZEND_NUM_ARGS() != 5 || zend_get_parameters_ex(5, &IM, &color, &red, &green, &blue) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); convert_to_long_ex(color); convert_to_long_ex(red); convert_to_long_ex(green); convert_to_long_ex(blue); col = Z_LVAL_PP(color); if (col >= 0 && col < gdImageColorsTotal(im)) { im->red[col] = Z_LVAL_PP(red); im->green[col] = Z_LVAL_PP(green); im->blue[col] = Z_LVAL_PP(blue); } else { RETURN_FALSE; } } /* }}} */ /* {{{ proto array imagecolorsforindex(resource im, int col) Get the colors for an index */ PHP_FUNCTION(imagecolorsforindex) { zval **IM, **index; int col; gdImagePtr im; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &IM, &index) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); convert_to_long_ex(index); col = Z_LVAL_PP(index); #if HAVE_LIBGD20 if ((col >= 0 && gdImageTrueColor(im)) || (!gdImageTrueColor(im) && col >= 0 && col < gdImageColorsTotal(im))) { array_init(return_value); add_assoc_long(return_value,"red", gdImageRed(im,col)); add_assoc_long(return_value,"green", gdImageGreen(im,col)); add_assoc_long(return_value,"blue", gdImageBlue(im,col)); add_assoc_long(return_value,"alpha", gdImageAlpha(im,col)); } #else if (col >= 0 && col < gdImageColorsTotal(im)) { array_init(return_value); add_assoc_long(return_value,"red", im->red[col]); add_assoc_long(return_value,"green", im->green[col]); add_assoc_long(return_value,"blue", im->blue[col]); } #endif else { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Color index %d out of range", col); RETURN_FALSE; } } /* }}} */ /* {{{ proto bool imagegammacorrect(resource im, float inputgamma, float outputgamma) Apply a gamma correction to a GD image */ PHP_FUNCTION(imagegammacorrect) { zval **IM, **inputgamma, **outputgamma; gdImagePtr im; int i; double input, output; if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &IM, &inputgamma, &outputgamma) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } convert_to_double_ex(inputgamma); convert_to_double_ex(outputgamma); input = Z_DVAL_PP(inputgamma); output = Z_DVAL_PP(outputgamma); ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); #if HAVE_LIBGD20 if (gdImageTrueColor(im)) { int x, y, c; for (y = 0; y < gdImageSY(im); y++) { for (x = 0; x < gdImageSX(im); x++) { c = gdImageGetPixel(im, x, y); gdImageSetPixel(im, x, y, gdTrueColor( (int) ((pow((pow((gdTrueColorGetRed(c) / 255.0), input)), 1.0 / output) * 255) + .5), (int) ((pow((pow((gdTrueColorGetGreen(c) / 255.0), input)), 1.0 / output) * 255) + .5), (int) ((pow((pow((gdTrueColorGetBlue(c) / 255.0), input)), 1.0 / output) * 255) + .5) ) ); } } RETURN_TRUE; } #endif for (i = 0; i < gdImageColorsTotal(im); i++) { im->red[i] = (int)((pow((pow((im->red[i] / 255.0), input)), 1.0 / output) * 255) + .5); im->green[i] = (int)((pow((pow((im->green[i] / 255.0), input)), 1.0 / output) * 255) + .5); im->blue[i] = (int)((pow((pow((im->blue[i] / 255.0), input)), 1.0 / output) * 255) + .5); } RETURN_TRUE; } /* }}} */ /* {{{ proto bool imagesetpixel(resource im, int x, int y, int col) Set a single pixel */ PHP_FUNCTION(imagesetpixel) { zval **IM, **x, **y, **col; gdImagePtr im; if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &IM, &x, &y, &col) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); convert_to_long_ex(x); convert_to_long_ex(y); convert_to_long_ex(col); gdImageSetPixel(im, Z_LVAL_PP(x), Z_LVAL_PP(y), Z_LVAL_PP(col)); RETURN_TRUE; } /* }}} */ /* {{{ proto bool imageline(resource im, int x1, int y1, int x2, int y2, int col) Draw a line */ PHP_FUNCTION(imageline) { zval **IM, **x1, **y1, **x2, **y2, **col; gdImagePtr im; if (ZEND_NUM_ARGS() != 6 || zend_get_parameters_ex(6, &IM, &x1, &y1, &x2, &y2, &col) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); convert_to_long_ex(x1); convert_to_long_ex(y1); convert_to_long_ex(x2); convert_to_long_ex(y2); convert_to_long_ex(col); #ifdef HAVE_GD_BUNDLED if (im->antialias) { gdImageAALine(im, Z_LVAL_PP(x1), Z_LVAL_PP(y1), Z_LVAL_PP(x2), Z_LVAL_PP(y2), Z_LVAL_PP(col)); } else #endif { gdImageLine(im, Z_LVAL_PP(x1), Z_LVAL_PP(y1), Z_LVAL_PP(x2), Z_LVAL_PP(y2), Z_LVAL_PP(col)); } RETURN_TRUE; } /* }}} */ /* {{{ proto bool imagedashedline(resource im, int x1, int y1, int x2, int y2, int col) Draw a dashed line */ PHP_FUNCTION(imagedashedline) { zval **IM, **x1, **y1, **x2, **y2, **col; gdImagePtr im; if (ZEND_NUM_ARGS() != 6 || zend_get_parameters_ex(6, &IM, &x1, &y1, &x2, &y2, &col) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); convert_to_long_ex(x1); convert_to_long_ex(y1); convert_to_long_ex(x2); convert_to_long_ex(y2); convert_to_long_ex(col); gdImageDashedLine(im, Z_LVAL_PP(x1), Z_LVAL_PP(y1), Z_LVAL_PP(x2), Z_LVAL_PP(y2), Z_LVAL_PP(col)); RETURN_TRUE; } /* }}} */ /* {{{ proto bool imagerectangle(resource im, int x1, int y1, int x2, int y2, int col) Draw a rectangle */ PHP_FUNCTION(imagerectangle) { zval **IM, **x1, **y1, **x2, **y2, **col; gdImagePtr im; if (ZEND_NUM_ARGS() != 6 || zend_get_parameters_ex(6, &IM, &x1, &y1, &x2, &y2, &col) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); convert_to_long_ex(x1); convert_to_long_ex(y1); convert_to_long_ex(x2); convert_to_long_ex(y2); convert_to_long_ex(col); gdImageRectangle(im, Z_LVAL_PP(x1), Z_LVAL_PP(y1), Z_LVAL_PP(x2), Z_LVAL_PP(y2), Z_LVAL_PP(col)); RETURN_TRUE; } /* }}} */ /* {{{ proto bool imagefilledrectangle(resource im, int x1, int y1, int x2, int y2, int col) Draw a filled rectangle */ PHP_FUNCTION(imagefilledrectangle) { zval **IM, **x1, **y1, **x2, **y2, **col; gdImagePtr im; if (ZEND_NUM_ARGS() != 6 || zend_get_parameters_ex(6, &IM, &x1, &y1, &x2, &y2, &col) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); convert_to_long_ex(x1); convert_to_long_ex(y1); convert_to_long_ex(x2); convert_to_long_ex(y2); convert_to_long_ex(col); gdImageFilledRectangle(im, Z_LVAL_PP(x1), Z_LVAL_PP(y1), Z_LVAL_PP(x2), Z_LVAL_PP(y2), Z_LVAL_PP(col)); RETURN_TRUE; } /* }}} */ /* {{{ proto bool imagearc(resource im, int cx, int cy, int w, int h, int s, int e, int col) Draw a partial ellipse */ PHP_FUNCTION(imagearc) { zval **IM, **cx, **cy, **w, **h, **ST, **E, **col; gdImagePtr im; int e, st; if (ZEND_NUM_ARGS() != 8 || zend_get_parameters_ex(8, &IM, &cx, &cy, &w, &h, &ST, &E, &col) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); convert_to_long_ex(cx); convert_to_long_ex(cy); convert_to_long_ex(w); convert_to_long_ex(h); convert_to_long_ex(ST); convert_to_long_ex(E); convert_to_long_ex(col); e = Z_LVAL_PP(E); if (e < 0) { e %= 360; } st = Z_LVAL_PP(ST); if (st < 0) { st %= 360; } gdImageArc(im, Z_LVAL_PP(cx), Z_LVAL_PP(cy), Z_LVAL_PP(w), Z_LVAL_PP(h), st, e, Z_LVAL_PP(col)); RETURN_TRUE; } /* }}} */ /* {{{ proto bool imageellipse(resource im, int cx, int cy, int w, int h, int color) Draw an ellipse */ PHP_FUNCTION(imageellipse) { zval **IM, **cx, **cy, **w, **h, **color; gdImagePtr im; if (ZEND_NUM_ARGS() != 6 || zend_get_parameters_ex(6, &IM, &cx, &cy, &w, &h, &color) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); convert_to_long_ex(cx); convert_to_long_ex(cy); convert_to_long_ex(w); convert_to_long_ex(h); convert_to_long_ex(color); #ifdef HAVE_GD_IMAGEELLIPSE /* this function is missing from GD 2.0.1 */ gdImageEllipse(im, Z_LVAL_PP(cx), Z_LVAL_PP(cy), Z_LVAL_PP(w), Z_LVAL_PP(h), Z_LVAL_PP(color)); #else gdImageArc(im, Z_LVAL_PP(cx), Z_LVAL_PP(cy), Z_LVAL_PP(w), Z_LVAL_PP(h), 0, 360, Z_LVAL_PP(color)); #endif RETURN_TRUE; } /* }}} */ /* {{{ proto bool imagefilltoborder(resource im, int x, int y, int border, int col) Flood fill to specific color */ PHP_FUNCTION(imagefilltoborder) { zval **IM, **x, **y, **border, **col; gdImagePtr im; if (ZEND_NUM_ARGS() != 5 || zend_get_parameters_ex(5, &IM, &x, &y, &border, &col) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); convert_to_long_ex(x); convert_to_long_ex(y); convert_to_long_ex(border); convert_to_long_ex(col); gdImageFillToBorder(im, Z_LVAL_PP(x), Z_LVAL_PP(y), Z_LVAL_PP(border), Z_LVAL_PP(col)); RETURN_TRUE; } /* }}} */ /* {{{ proto bool imagefill(resource im, int x, int y, int col) Flood fill */ PHP_FUNCTION(imagefill) { zval **IM, **x, **y, **col; gdImagePtr im; if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &IM, &x, &y, &col) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); convert_to_long_ex(x); convert_to_long_ex(y); convert_to_long_ex(col); gdImageFill(im, Z_LVAL_PP(x), Z_LVAL_PP(y), Z_LVAL_PP(col)); RETURN_TRUE; } /* }}} */ /* {{{ proto int imagecolorstotal(resource im) Find out the number of colors in an image's palette */ PHP_FUNCTION(imagecolorstotal) { zval **IM; gdImagePtr im; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &IM) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); RETURN_LONG(gdImageColorsTotal(im)); } /* }}} */ /* {{{ proto int imagecolortransparent(resource im [, int col]) Define a color as transparent */ PHP_FUNCTION(imagecolortransparent) { zval **IM, **COL; gdImagePtr im; switch (ZEND_NUM_ARGS()) { case 1: if (zend_get_parameters_ex(1, &IM) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } break; case 2: if (zend_get_parameters_ex(2, &IM, &COL) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } convert_to_long_ex(COL); break; default: ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); if (ZEND_NUM_ARGS() > 1) { gdImageColorTransparent(im, Z_LVAL_PP(COL)); } RETURN_LONG(gdImageGetTransparent(im)); } /* }}} */ /* {{{ proto int imageinterlace(resource im [, int interlace]) Enable or disable interlace */ PHP_FUNCTION(imageinterlace) { zval **IM, **INT; gdImagePtr im; switch (ZEND_NUM_ARGS()) { case 1: if (zend_get_parameters_ex(1, &IM) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } break; case 2: if (zend_get_parameters_ex(2, &IM, &INT) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } convert_to_long_ex(INT); break; default: ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); if (ZEND_NUM_ARGS() > 1) { gdImageInterlace(im, Z_LVAL_PP(INT)); } RETURN_LONG(gdImageGetInterlaced(im)); } /* }}} */ /* {{{ php_imagepolygon arg = 0 normal polygon arg = 1 filled polygon */ /* im, points, num_points, col */ static void php_imagepolygon(INTERNAL_FUNCTION_PARAMETERS, int filled) { zval **IM, **POINTS, **NPOINTS, **COL; pval **var = NULL; gdImagePtr im; gdPointPtr points; int npoints, col, nelem, i; if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &IM, &POINTS, &NPOINTS, &COL) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); convert_to_long_ex(NPOINTS); convert_to_long_ex(COL); npoints = Z_LVAL_PP(NPOINTS); col = Z_LVAL_PP(COL); if (Z_TYPE_PP(POINTS) != IS_ARRAY) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "2nd argument to imagepolygon not an array"); RETURN_FALSE; } nelem = zend_hash_num_elements(Z_ARRVAL_PP(POINTS)); if (nelem < 6) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "You must have at least 3 points in your array"); RETURN_FALSE; } if (nelem < npoints * 2) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Trying to use %d points in array with only %d points", npoints, nelem/2); RETURN_FALSE; } points = (gdPointPtr) safe_emalloc(npoints, sizeof(gdPoint), 0); for (i = 0; i < npoints; i++) { if (zend_hash_index_find(Z_ARRVAL_PP(POINTS), (i * 2), (void **) &var) == SUCCESS) { SEPARATE_ZVAL((var)); convert_to_long(*var); points[i].x = Z_LVAL_PP(var); } if (zend_hash_index_find(Z_ARRVAL_PP(POINTS), (i * 2) + 1, (void **) &var) == SUCCESS) { SEPARATE_ZVAL(var); convert_to_long(*var); points[i].y = Z_LVAL_PP(var); } } if (filled) { gdImageFilledPolygon(im, points, npoints, col); } else { gdImagePolygon(im, points, npoints, col); } efree(points); RETURN_TRUE; } /* }}} */ /* {{{ proto bool imagepolygon(resource im, array point, int num_points, int col) Draw a polygon */ PHP_FUNCTION(imagepolygon) { php_imagepolygon(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); } /* }}} */ /* {{{ proto bool imagefilledpolygon(resource im, array point, int num_points, int col) Draw a filled polygon */ PHP_FUNCTION(imagefilledpolygon) { php_imagepolygon(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); } /* }}} */ /* {{{ php_find_gd_font */ static gdFontPtr php_find_gd_font(int size TSRMLS_DC) { gdFontPtr font; int ind_type; switch (size) { case 1: font = gdFontTiny; break; case 2: font = gdFontSmall; break; case 3: font = gdFontMediumBold; break; case 4: font = gdFontLarge; break; case 5: font = gdFontGiant; break; default: font = zend_list_find(size - 5, &ind_type); if (!font || ind_type != le_gd_font) { if (size < 1) { font = gdFontTiny; } else { font = gdFontGiant; } } break; } return font; } /* }}} */ /* {{{ php_imagefontsize * arg = 0 ImageFontWidth * arg = 1 ImageFontHeight */ static void php_imagefontsize(INTERNAL_FUNCTION_PARAMETERS, int arg) { zval **SIZE; gdFontPtr font; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &SIZE) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } convert_to_long_ex(SIZE); font = php_find_gd_font(Z_LVAL_PP(SIZE) TSRMLS_CC); RETURN_LONG(arg ? font->h : font->w); } /* }}} */ /* {{{ proto int imagefontwidth(int font) Get font width */ PHP_FUNCTION(imagefontwidth) { php_imagefontsize(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); } /* }}} */ /* {{{ proto int imagefontheight(int font) Get font height */ PHP_FUNCTION(imagefontheight) { php_imagefontsize(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); } /* }}} */ /* {{{ php_gdimagecharup * workaround for a bug in gd 1.2 */ static void php_gdimagecharup(gdImagePtr im, gdFontPtr f, int x, int y, int c, int color) { int cx, cy, px, py, fline; cx = 0; cy = 0; if ((c < f->offset) || (c >= (f->offset + f->nchars))) { return; } fline = (c - f->offset) * f->h * f->w; for (py = y; (py > (y - f->w)); py--) { for (px = x; (px < (x + f->h)); px++) { if (f->data[fline + cy * f->w + cx]) { gdImageSetPixel(im, px, py, color); } cy++; } cy = 0; cx++; } } /* }}} */ /* {{{ php_imagechar * arg = 0 ImageChar * arg = 1 ImageCharUp * arg = 2 ImageString * arg = 3 ImageStringUp */ static void php_imagechar(INTERNAL_FUNCTION_PARAMETERS, int mode) { zval **IM, **SIZE, **X, **Y, **C, **COL; gdImagePtr im; int ch = 0, col, x, y, size, i, l = 0; unsigned char *str = NULL; gdFontPtr font; if (ZEND_NUM_ARGS() != 6 || zend_get_parameters_ex(6, &IM, &SIZE, &X, &Y, &C, &COL) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); convert_to_long_ex(SIZE); convert_to_long_ex(X); convert_to_long_ex(Y); convert_to_string_ex(C); convert_to_long_ex(COL); col = Z_LVAL_PP(COL); if (mode < 2) { ch = (int)((unsigned char)*(Z_STRVAL_PP(C))); } else { str = (unsigned char *) estrndup(Z_STRVAL_PP(C), Z_STRLEN_PP(C)); l = strlen(str); } y = Z_LVAL_PP(Y); x = Z_LVAL_PP(X); size = Z_LVAL_PP(SIZE); font = php_find_gd_font(size TSRMLS_CC); switch (mode) { case 0: gdImageChar(im, font, x, y, ch, col); break; case 1: php_gdimagecharup(im, font, x, y, ch, col); break; case 2: for (i = 0; (i < l); i++) { gdImageChar(im, font, x, y, (int) ((unsigned char) str[i]), col); x += font->w; } break; case 3: { for (i = 0; (i < l); i++) { /* php_gdimagecharup(im, font, x, y, (int) str[i], col); */ gdImageCharUp(im, font, x, y, (int) str[i], col); y -= font->w; } break; } } if (str) { efree(str); } RETURN_TRUE; } /* }}} */ /* {{{ proto bool imagechar(resource im, int font, int x, int y, string c, int col) Draw a character */ PHP_FUNCTION(imagechar) { php_imagechar(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); } /* }}} */ /* {{{ proto bool imagecharup(resource im, int font, int x, int y, string c, int col) Draw a character rotated 90 degrees counter-clockwise */ PHP_FUNCTION(imagecharup) { php_imagechar(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); } /* }}} */ /* {{{ proto bool imagestring(resource im, int font, int x, int y, string str, int col) Draw a string horizontally */ PHP_FUNCTION(imagestring) { php_imagechar(INTERNAL_FUNCTION_PARAM_PASSTHRU, 2); } /* }}} */ /* {{{ proto bool imagestringup(resource im, int font, int x, int y, string str, int col) Draw a string vertically - rotated 90 degrees counter-clockwise */ PHP_FUNCTION(imagestringup) { php_imagechar(INTERNAL_FUNCTION_PARAM_PASSTHRU, 3); } /* }}} */ /* {{{ proto bool imagecopy(resource dst_im, resource src_im, int dst_x, int dst_y, int src_x, int src_y, int src_w, int src_h) Copy part of an image */ PHP_FUNCTION(imagecopy) { zval **SIM, **DIM, **SX, **SY, **SW, **SH, **DX, **DY; gdImagePtr im_dst, im_src; int srcH, srcW, srcY, srcX, dstY, dstX; if (ZEND_NUM_ARGS() != 8 || zend_get_parameters_ex(8, &DIM, &SIM, &DX, &DY, &SX, &SY, &SW, &SH) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im_src, gdImagePtr, SIM, -1, "Image", le_gd); ZEND_FETCH_RESOURCE(im_dst, gdImagePtr, DIM, -1, "Image", le_gd); convert_to_long_ex(SX); convert_to_long_ex(SY); convert_to_long_ex(SW); convert_to_long_ex(SH); convert_to_long_ex(DX); convert_to_long_ex(DY); srcX = Z_LVAL_PP(SX); srcY = Z_LVAL_PP(SY); srcH = Z_LVAL_PP(SH); srcW = Z_LVAL_PP(SW); dstX = Z_LVAL_PP(DX); dstY = Z_LVAL_PP(DY); gdImageCopy(im_dst, im_src, dstX, dstY, srcX, srcY, srcW, srcH); RETURN_TRUE; } /* }}} */ #if HAVE_LIBGD15 /* {{{ proto bool imagecopymerge(resource src_im, resource dst_im, int dst_x, int dst_y, int src_x, int src_y, int src_w, int src_h, int pct) Merge one part of an image with another */ PHP_FUNCTION(imagecopymerge) { zval **SIM, **DIM, **SX, **SY, **SW, **SH, **DX, **DY, **PCT; gdImagePtr im_dst, im_src; int srcH, srcW, srcY, srcX, dstY, dstX, pct; if (ZEND_NUM_ARGS() != 9 || zend_get_parameters_ex(9, &DIM, &SIM, &DX, &DY, &SX, &SY, &SW, &SH, &PCT) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im_src, gdImagePtr, SIM, -1, "Image", le_gd); ZEND_FETCH_RESOURCE(im_dst, gdImagePtr, DIM, -1, "Image", le_gd); convert_to_long_ex(SX); convert_to_long_ex(SY); convert_to_long_ex(SW); convert_to_long_ex(SH); convert_to_long_ex(DX); convert_to_long_ex(DY); convert_to_long_ex(PCT); srcX = Z_LVAL_PP(SX); srcY = Z_LVAL_PP(SY); srcH = Z_LVAL_PP(SH); srcW = Z_LVAL_PP(SW); dstX = Z_LVAL_PP(DX); dstY = Z_LVAL_PP(DY); pct = Z_LVAL_PP(PCT); gdImageCopyMerge(im_dst, im_src, dstX, dstY, srcX, srcY, srcW, srcH, pct); RETURN_TRUE; } /* }}} */ /* {{{ proto bool imagecopymergegray(resource src_im, resource dst_im, int dst_x, int dst_y, int src_x, int src_y, int src_w, int src_h, int pct) Merge one part of an image with another */ PHP_FUNCTION(imagecopymergegray) { zval **SIM, **DIM, **SX, **SY, **SW, **SH, **DX, **DY, **PCT; gdImagePtr im_dst, im_src; int srcH, srcW, srcY, srcX, dstY, dstX, pct; if (ZEND_NUM_ARGS() != 9 || zend_get_parameters_ex(9, &DIM, &SIM, &DX, &DY, &SX, &SY, &SW, &SH, &PCT) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im_src, gdImagePtr, SIM, -1, "Image", le_gd); ZEND_FETCH_RESOURCE(im_dst, gdImagePtr, DIM, -1, "Image", le_gd); convert_to_long_ex(SX); convert_to_long_ex(SY); convert_to_long_ex(SW); convert_to_long_ex(SH); convert_to_long_ex(DX); convert_to_long_ex(DY); convert_to_long_ex(PCT); srcX = Z_LVAL_PP(SX); srcY = Z_LVAL_PP(SY); srcH = Z_LVAL_PP(SH); srcW = Z_LVAL_PP(SW); dstX = Z_LVAL_PP(DX); dstY = Z_LVAL_PP(DY); pct = Z_LVAL_PP(PCT); gdImageCopyMergeGray(im_dst, im_src, dstX, dstY, srcX, srcY, srcW, srcH, pct); RETURN_TRUE; } /* }}} */ #endif /* {{{ proto bool imagecopyresized(resource dst_im, resource src_im, int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h) Copy and resize part of an image */ PHP_FUNCTION(imagecopyresized) { zval **SIM, **DIM, **SX, **SY, **SW, **SH, **DX, **DY, **DW, **DH; gdImagePtr im_dst, im_src; int srcH, srcW, dstH, dstW, srcY, srcX, dstY, dstX; if (ZEND_NUM_ARGS() != 10 || zend_get_parameters_ex(10, &DIM, &SIM, &DX, &DY, &SX, &SY, &DW, &DH, &SW, &SH) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im_dst, gdImagePtr, DIM, -1, "Image", le_gd); ZEND_FETCH_RESOURCE(im_src, gdImagePtr, SIM, -1, "Image", le_gd); convert_to_long_ex(SX); convert_to_long_ex(SY); convert_to_long_ex(SW); convert_to_long_ex(SH); convert_to_long_ex(DX); convert_to_long_ex(DY); convert_to_long_ex(DW); convert_to_long_ex(DH); srcX = Z_LVAL_PP(SX); srcY = Z_LVAL_PP(SY); srcH = Z_LVAL_PP(SH); srcW = Z_LVAL_PP(SW); dstX = Z_LVAL_PP(DX); dstY = Z_LVAL_PP(DY); dstH = Z_LVAL_PP(DH); dstW = Z_LVAL_PP(DW); if (dstW <= 0 || dstH <= 0 || srcW <= 0 || srcH <= 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid image dimensions"); RETURN_FALSE; } gdImageCopyResized(im_dst, im_src, dstX, dstY, srcX, srcY, dstW, dstH, srcW, srcH); RETURN_TRUE; } /* }}} */ /* {{{ proto int imagesx(resource im) Get image width */ PHP_FUNCTION(imagesx) { zval **IM; gdImagePtr im; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &IM) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); RETURN_LONG(gdImageSX(im)); } /* }}} */ /* {{{ proto int imagesy(resource im) Get image height */ PHP_FUNCTION(imagesy) { zval **IM; gdImagePtr im; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &IM) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); RETURN_LONG(gdImageSY(im)); } /* }}} */ #ifdef ENABLE_GD_TTF #define TTFTEXT_DRAW 0 #define TTFTEXT_BBOX 1 #endif #ifdef ENABLE_GD_TTF #if HAVE_LIBGD20 && HAVE_LIBFREETYPE && HAVE_GD_STRINGFTEX /* {{{ proto array imageftbbox(float size, float angle, string font_file, string text [, array extrainfo]) Give the bounding box of a text using fonts via freetype2 */ PHP_FUNCTION(imageftbbox) { php_imagettftext_common(INTERNAL_FUNCTION_PARAM_PASSTHRU, TTFTEXT_BBOX, 1); } /* }}} */ /* {{{ proto array imagefttext(resource im, float size, float angle, int x, int y, int col, string font_file, string text [, array extrainfo]) Write text to the image using fonts via freetype2 */ PHP_FUNCTION(imagefttext) { php_imagettftext_common(INTERNAL_FUNCTION_PARAM_PASSTHRU, TTFTEXT_DRAW, 1); } /* }}} */ #endif /* {{{ proto array imagettfbbox(float size, float angle, string font_file, string text) Give the bounding box of a text using TrueType fonts */ PHP_FUNCTION(imagettfbbox) { php_imagettftext_common(INTERNAL_FUNCTION_PARAM_PASSTHRU, TTFTEXT_BBOX, 0); } /* }}} */ /* {{{ proto array imagettftext(resource im, float size, float angle, int x, int y, int col, string font_file, string text) Write text to the image using a TrueType font */ PHP_FUNCTION(imagettftext) { php_imagettftext_common(INTERNAL_FUNCTION_PARAM_PASSTHRU, TTFTEXT_DRAW, 0); } /* }}} */ /* {{{ php_imagettftext_common */ static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int mode, int extended) { zval *IM, *EXT = NULL; gdImagePtr im=NULL; long col = -1, x = -1, y = -1; int str_len, fontname_len, i, brect[8]; double ptsize, angle; unsigned char *str = NULL, *fontname = NULL; char *error = NULL; int argc = ZEND_NUM_ARGS(); #if HAVE_GD_STRINGFTEX gdFTStringExtra strex = {0}; #endif #if !HAVE_GD_STRINGFTEX assert(!extended); #endif if (mode == TTFTEXT_BBOX) { if (argc < 4 || argc > ((extended) ? 5 : 4)) { ZEND_WRONG_PARAM_COUNT(); } else if (zend_parse_parameters(argc TSRMLS_CC, "ddss|a", &ptsize, &angle, &fontname, &fontname_len, &str, &str_len, &EXT) == FAILURE) { RETURN_FALSE; } } else { if (argc < 8 || argc > ((extended) ? 9 : 8)) { ZEND_WRONG_PARAM_COUNT(); } else if (zend_parse_parameters(argc TSRMLS_CC, "rddlllss|a", &IM, &ptsize, &angle, &x, &y, &col, &fontname, &fontname_len, &str, &str_len, &EXT) == FAILURE) { RETURN_FALSE; } ZEND_FETCH_RESOURCE(im, gdImagePtr, &IM, -1, "Image", le_gd); } /* convert angle to radians */ angle = angle * (M_PI/180); #if HAVE_GD_STRINGFTEX if (extended && EXT) { /* parse extended info */ HashPosition pos; /* walk the assoc array */ zend_hash_internal_pointer_reset_ex(HASH_OF(EXT), &pos); do { zval ** item; char * key; ulong num_key; if (zend_hash_get_current_key_ex(HASH_OF(EXT), &key, NULL, &num_key, 0, &pos) != HASH_KEY_IS_STRING) { continue; } if (zend_hash_get_current_data_ex(HASH_OF(EXT), (void **) &item, &pos) == FAILURE) { continue; } if (strcmp("linespacing", key) == 0) { convert_to_double_ex(item); strex.flags |= gdFTEX_LINESPACE; strex.linespacing = Z_DVAL_PP(item); } } while (zend_hash_move_forward_ex(HASH_OF(EXT), &pos) == SUCCESS); } #endif #ifdef VIRTUAL_DIR { char tmp_font_path[MAXPATHLEN]; if (VCWD_REALPATH(fontname, tmp_font_path)) { fontname = (unsigned char *) fontname; } else { fontname = NULL; } } #else fontname = (unsigned char *) fontname; #endif #ifdef USE_GD_IMGSTRTTF # if HAVE_GD_STRINGFTEX if (extended) { error = gdImageStringFTEx(im, brect, col, fontname, ptsize, angle, x, y, str, &strex); } else # endif # if HAVE_GD_STRINGFT error = gdImageStringFT(im, brect, col, fontname, ptsize, angle, x, y, str); # elif HAVE_GD_STRINGTTF error = gdImageStringTTF(im, brect, col, fontname, ptsize, angle, x, y, str); # endif #else /* !USE_GD_IMGSTRTTF */ error = gdttf(im, brect, col, fontname, ptsize, angle, x, y, str); #endif if (error) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", error); RETURN_FALSE; } array_init(return_value); /* return array with the text's bounding box */ for (i = 0; i < 8; i++) { add_next_index_long(return_value, brect[i]); } } /* }}} */ #endif /* ENABLE_GD_TTF */ #if HAVE_LIBT1 /* {{{ php_free_ps_font */ static void php_free_ps_font(zend_rsrc_list_entry *rsrc TSRMLS_DC) { int *font = (int *) rsrc->ptr; T1_DeleteFont(*font); efree(font); } /* }}} */ /* {{{ php_free_ps_enc */ static void php_free_ps_enc(zend_rsrc_list_entry *rsrc TSRMLS_DC) { char **enc = (char **) rsrc->ptr; T1_DeleteEncoding(enc); } /* }}} */ /* {{{ proto resource imagepsloadfont(string pathname) Load a new font from specified file */ PHP_FUNCTION(imagepsloadfont) { zval **file; int f_ind, *font; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &file) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } convert_to_string_ex(file); f_ind = T1_AddFont(Z_STRVAL_PP(file)); if (f_ind < 0) { switch (f_ind) { case -1: php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't find the font file"); RETURN_FALSE; break; case -2: case -3: php_error_docref(NULL TSRMLS_CC, E_WARNING, "Memory allocation fault in t1lib"); RETURN_FALSE; break; default: php_error_docref(NULL TSRMLS_CC, E_WARNING, "An unknown error occurred in t1lib"); RETURN_FALSE; break; } } if (T1_LoadFont(f_ind)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't load the font"); RETURN_FALSE; } font = (int *) emalloc(sizeof(int)); *font = f_ind; ZEND_REGISTER_RESOURCE(return_value, font, le_ps_font); } /* }}} */ /* {{{ proto int imagepscopyfont(int font_index) Make a copy of a font for purposes like extending or reenconding */ /* The function in t1lib which this function uses seem to be buggy... PHP_FUNCTION(imagepscopyfont) { zval **fnt; int l_ind, type; gd_ps_font *nf_ind, *of_ind; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &fnt) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } convert_to_long_ex(fnt); of_ind = zend_list_find(Z_LVAL_PP(fnt), &type); if (type != le_ps_font) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "%ld is not a Type 1 font index", Z_LVAL_PP(fnt)); RETURN_FALSE; } nf_ind = emalloc(sizeof(gd_ps_font)); nf_ind->font_id = T1_CopyFont(of_ind->font_id); if (nf_ind->font_id < 0) { l_ind = nf_ind->font_id; efree(nf_ind); switch (l_ind) { case -1: php_error_docref(NULL TSRMLS_CC, E_WARNING, "FontID %d is not loaded in memory", l_ind); RETURN_FALSE; break; case -2: php_error_docref(NULL TSRMLS_CC, E_WARNING, "Tried to copy a logical font"); RETURN_FALSE; break; case -3: php_error_docref(NULL TSRMLS_CC, E_WARNING, "Memory allocation fault in t1lib"); RETURN_FALSE; break; default: php_error_docref(NULL TSRMLS_CC, E_WARNING, "An unknown error occurred in t1lib"); RETURN_FALSE; break; } } nf_ind->extend = 1; l_ind = zend_list_insert(nf_ind, le_ps_font); RETURN_LONG(l_ind); } */ /* }}} */ /* {{{ proto bool imagepsfreefont(resource font_index) Free memory used by a font */ PHP_FUNCTION(imagepsfreefont) { zval **fnt; int *f_ind; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &fnt) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(f_ind, int *, fnt, -1, "Type 1 font", le_ps_font); zend_list_delete(Z_LVAL_PP(fnt)); RETURN_TRUE; } /* }}} */ /* {{{ proto bool imagepsencodefont(resource font_index, string filename) To change a fonts character encoding vector */ PHP_FUNCTION(imagepsencodefont) { zval **fnt, **enc; char **enc_vector; int *f_ind; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &fnt, &enc) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } convert_to_string_ex(enc); ZEND_FETCH_RESOURCE(f_ind, int *, fnt, -1, "Type 1 font", le_ps_font); if ((enc_vector = T1_LoadEncoding(Z_STRVAL_PP(enc))) == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't load encoding vector from %s", Z_STRVAL_PP(enc)); RETURN_FALSE; } T1_DeleteAllSizes(*f_ind); if (T1_ReencodeFont(*f_ind, enc_vector)) { T1_DeleteEncoding(enc_vector); php_error_docref(NULL TSRMLS_CC, E_WARNING, "Couldn't reencode font"); RETURN_FALSE; } zend_list_insert(enc_vector, le_ps_enc); RETURN_TRUE; } /* }}} */ /* {{{ proto bool imagepsextendfont(resource font_index, float extend) Extend or or condense (if extend < 1) a font */ PHP_FUNCTION(imagepsextendfont) { zval **fnt, **ext; int *f_ind; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &fnt, &ext) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } convert_to_double_ex(ext); ZEND_FETCH_RESOURCE(f_ind, int *, fnt, -1, "Type 1 font", le_ps_font); T1_DeleteAllSizes(*f_ind); if (T1_ExtendFont(*f_ind, Z_DVAL_PP(ext)) != 0) { RETURN_FALSE; } RETURN_TRUE; } /* }}} */ /* {{{ proto bool imagepsslantfont(resource font_index, float slant) Slant a font */ PHP_FUNCTION(imagepsslantfont) { zval **fnt, **slt; int *f_ind; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &fnt, &slt) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } convert_to_double_ex(slt); ZEND_FETCH_RESOURCE(f_ind, int *, fnt, -1, "Type 1 font", le_ps_font); if (T1_SlantFont(*f_ind, Z_DVAL_PP(slt)) != 0) { RETURN_FALSE; } RETURN_TRUE; } /* }}} */ /* {{{ proto array imagepstext(resource image, string text, resource font, int size, int xcoord, int ycoord [, int space, int tightness, float angle, int antialias]) Rasterize a string over an image */ PHP_FUNCTION(imagepstext) { zval *img, *fnt; int i, j; long _fg, _bg, x, y, size, space = 0, aa_steps = 4, width = 0; int *f_ind; int h_lines, v_lines, c_ind; int rd, gr, bl, fg_rd, fg_gr, fg_bl, bg_rd, bg_gr, bg_bl; #if HAVE_LIBGD20 int fg_al, bg_al, al; #endif int aa[16]; int amount_kern, add_width; double angle = 0.0, extend; unsigned long aa_greys[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; gdImagePtr bg_img; GLYPH *str_img; T1_OUTLINE *char_path, *str_path; T1_TMATRIX *transform = NULL; char *str; int str_len; int argc = ZEND_NUM_ARGS(); if (argc != 8 && argc != 12) { ZEND_WRONG_PARAM_COUNT(); } if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsrlllll|lldl", &img, &str, &str_len, &fnt, &size, &_fg, &_bg, &x, &y, &space, &width, &angle, &aa_steps) == FAILURE) { return; } ZEND_FETCH_RESOURCE(bg_img, gdImagePtr, &img, -1, "Image", le_gd); ZEND_FETCH_RESOURCE(f_ind, int *, &fnt, -1, "Type 1 font", le_ps_font); /* Ensure that the provided colors are valid */ #if HAVE_LIBGD20 if (_fg < 0 || (!gdImageTrueColor(bg_img) && _fg > gdImageColorsTotal(bg_img))) { #else if (_fg < 0 || _fg > gdImageColorsTotal(bg_img)) { #endif php_error_docref(NULL TSRMLS_CC, E_WARNING, "Foreground color index %ld out of range", _fg); RETURN_FALSE; } #if HAVE_LIBGD20 if (_bg < 0 || (!gdImageTrueColor(bg_img) && _fg > gdImageColorsTotal(bg_img))) { #else if (_bg < 0 || _bg > gdImageColorsTotal(bg_img)) { #endif php_error_docref(NULL TSRMLS_CC, E_WARNING, "Background color index %ld out of range", _bg); RETURN_FALSE; } fg_rd = gdImageRed (bg_img, _fg); fg_gr = gdImageGreen(bg_img, _fg); fg_bl = gdImageBlue (bg_img, _fg); #if HAVE_LIBGD20 fg_al = gdImageAlpha(bg_img, _fg); #endif bg_rd = gdImageRed (bg_img, _bg); bg_gr = gdImageGreen(bg_img, _bg); bg_bl = gdImageBlue (bg_img, _bg); #if HAVE_LIBGD20 bg_al = gdImageAlpha(bg_img, _bg); #endif for (i = 0; i < aa_steps; i++) { rd = bg_rd + (double) (fg_rd - bg_rd) / aa_steps * (i + 1); gr = bg_gr + (double) (fg_gr - bg_gr) / aa_steps * (i + 1); bl = bg_bl + (double) (fg_bl - bg_bl) / aa_steps * (i + 1); #if HAVE_LIBGD20 al = bg_al + (double) (fg_al - bg_al) / aa_steps * (i + 1); aa[i] = gdImageColorResolveAlpha(bg_img, rd, gr, bl, al); #else aa[i] = gdImageColorResolve(bg_img, rd, gr, bl); #endif } T1_AASetBitsPerPixel(8); switch (aa_steps) { case 4: T1_AASetGrayValues(0, 1, 2, 3, 4); T1_AASetLevel(T1_AA_LOW); break; case 16: T1_AAHSetGrayValues(aa_greys); T1_AASetLevel(T1_AA_HIGH); break; default: php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid value %ld as number of steps for antialiasing", aa_steps); RETURN_FALSE; } if (angle) { transform = T1_RotateMatrix(NULL, angle); } if (width) { extend = T1_GetExtend(*f_ind); str_path = T1_GetCharOutline(*f_ind, str[0], size, transform); if (!str_path) { if (T1_errno) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "libt1 returned error %d", T1_errno); } RETURN_FALSE; } for (i = 1; i < str_len; i++) { amount_kern = (int) T1_GetKerning(*f_ind, str[i - 1], str[i]); amount_kern += str[i - 1] == ' ' ? space : 0; add_width = (int) (amount_kern + width) / extend; char_path = T1_GetMoveOutline(*f_ind, add_width, 0, 0, size, transform); str_path = T1_ConcatOutlines(str_path, char_path); char_path = T1_GetCharOutline(*f_ind, str[i], size, transform); str_path = T1_ConcatOutlines(str_path, char_path); } str_img = T1_AAFillOutline(str_path, 0); } else { str_img = T1_AASetString(*f_ind, str, str_len, space, T1_KERNING, size, transform); } if (T1_errno) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "libt1 returned error %d", T1_errno); RETURN_FALSE; } h_lines = str_img->metrics.ascent - str_img->metrics.descent; v_lines = str_img->metrics.rightSideBearing - str_img->metrics.leftSideBearing; for (i = 0; i < v_lines; i++) { for (j = 0; j < h_lines; j++) { switch (str_img->bits[j * v_lines + i]) { case 0: break; default: c_ind = aa[str_img->bits[j * v_lines + i] - 1]; gdImageSetPixel(bg_img, x + str_img->metrics.leftSideBearing + i, y - str_img->metrics.ascent + j, c_ind); break; } } } array_init(return_value); add_next_index_long(return_value, str_img->metrics.leftSideBearing); add_next_index_long(return_value, str_img->metrics.descent); add_next_index_long(return_value, str_img->metrics.rightSideBearing); add_next_index_long(return_value, str_img->metrics.ascent); } /* }}} */ /* {{{ proto array imagepsbbox(string text, resource font, int size [, int space, int tightness, int angle]) Return the bounding box needed by a string if rasterized */ PHP_FUNCTION(imagepsbbox) { zval **str, **fnt, **sz, **sp, **wd, **ang; int i, space, add_width = 0, char_width, amount_kern; int cur_x, cur_y, dx, dy; int x1, y1, x2, y2, x3, y3, x4, y4; int *f_ind; int per_char = 0; double angle, sin_a = 0, cos_a = 0; BBox char_bbox, str_bbox = {0, 0, 0, 0}; switch (ZEND_NUM_ARGS()) { case 3: if (zend_get_parameters_ex(3, &str, &fnt, &sz) == FAILURE) { RETURN_FALSE; } space = 0; break; case 6: if (zend_get_parameters_ex(6, &str, &fnt, &sz, &sp, &wd, &ang) == FAILURE) { RETURN_FALSE; } convert_to_long_ex(sp); convert_to_long_ex(wd); convert_to_double_ex(ang); space = Z_LVAL_PP(sp); add_width = Z_LVAL_PP(wd); angle = Z_DVAL_PP(ang) * M_PI / 180; sin_a = sin(angle); cos_a = cos(angle); per_char = add_width || angle ? 1 : 0; break; default: ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(f_ind, int *, fnt, -1, "Type 1 font", le_ps_font); convert_to_string_ex(str); convert_to_long_ex(sz); #define max(a, b) (a > b ? a : b) #define min(a, b) (a < b ? a : b) #define new_x(a, b) (int) ((a) * cos_a - (b) * sin_a) #define new_y(a, b) (int) ((a) * sin_a + (b) * cos_a) if (per_char) { space += T1_GetCharWidth(*f_ind, ' '); cur_x = cur_y = 0; for (i = 0; i < Z_STRLEN_PP(str); i++) { if (Z_STRVAL_PP(str)[i] == ' ') { char_bbox.llx = char_bbox.lly = char_bbox.ury = 0; char_bbox.urx = char_width = space; } else { char_bbox = T1_GetCharBBox(*f_ind, Z_STRVAL_PP(str)[i]); char_width = T1_GetCharWidth(*f_ind, Z_STRVAL_PP(str)[i]); } amount_kern = i ? T1_GetKerning(*f_ind, Z_STRVAL_PP(str)[i - 1], Z_STRVAL_PP(str)[i]) : 0; /* Transfer character bounding box to right place */ x1 = new_x(char_bbox.llx, char_bbox.lly) + cur_x; y1 = new_y(char_bbox.llx, char_bbox.lly) + cur_y; x2 = new_x(char_bbox.llx, char_bbox.ury) + cur_x; y2 = new_y(char_bbox.llx, char_bbox.ury) + cur_y; x3 = new_x(char_bbox.urx, char_bbox.ury) + cur_x; y3 = new_y(char_bbox.urx, char_bbox.ury) + cur_y; x4 = new_x(char_bbox.urx, char_bbox.lly) + cur_x; y4 = new_y(char_bbox.urx, char_bbox.lly) + cur_y; /* Find min & max values and compare them with current bounding box */ str_bbox.llx = min(str_bbox.llx, min(x1, min(x2, min(x3, x4)))); str_bbox.lly = min(str_bbox.lly, min(y1, min(y2, min(y3, y4)))); str_bbox.urx = max(str_bbox.urx, max(x1, max(x2, max(x3, x4)))); str_bbox.ury = max(str_bbox.ury, max(y1, max(y2, max(y3, y4)))); /* Move to the next base point */ dx = new_x(char_width + add_width + amount_kern, 0); dy = new_y(char_width + add_width + amount_kern, 0); cur_x += dx; cur_y += dy; /* printf("%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\n", x1, y1, x2, y2, x3, y3, x4, y4, char_bbox.llx, char_bbox.lly, char_bbox.urx, char_bbox.ury, char_width, amount_kern, cur_x, cur_y, dx, dy); */ } } else { str_bbox = T1_GetStringBBox(*f_ind, Z_STRVAL_PP(str), Z_STRLEN_PP(str), space, T1_KERNING); } if (T1_errno) { RETURN_FALSE; } array_init(return_value); /* printf("%d %d %d %d\n", str_bbox.llx, str_bbox.lly, str_bbox.urx, str_bbox.ury); */ add_next_index_long(return_value, (int) ceil(((double) str_bbox.llx)*Z_LVAL_PP(sz)/1000)); add_next_index_long(return_value, (int) ceil(((double) str_bbox.lly)*Z_LVAL_PP(sz)/1000)); add_next_index_long(return_value, (int) ceil(((double) str_bbox.urx)*Z_LVAL_PP(sz)/1000)); add_next_index_long(return_value, (int) ceil(((double) str_bbox.ury)*Z_LVAL_PP(sz)/1000)); } /* }}} */ #endif #ifdef HAVE_GD_WBMP /* {{{ proto bool image2wbmp(resource im [, string filename [, int threshold]]) Output WBMP image to browser or file */ PHP_FUNCTION(image2wbmp) { _php_image_output(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_CONVERT_WBM, "WBMP", _php_image_bw_convert); } /* }}} */ #endif /* HAVE_GD_WBMP */ #if defined(HAVE_GD_JPG) && defined(HAVE_GD_WBMP) /* {{{ proto bool jpeg2wbmp (string f_org, string f_dest, int d_height, int d_width, int threshold) Convert JPEG image to WBMP image */ PHP_FUNCTION(jpeg2wbmp) { _php_image_convert(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_JPG); } /* }}} */ #endif #if defined(HAVE_GD_PNG) && defined(HAVE_GD_WBMP) /* {{{ proto bool png2wbmp (string f_org, string f_dest, int d_height, int d_width, int threshold) Convert PNG image to WBMP image */ PHP_FUNCTION(png2wbmp) { _php_image_convert(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_GDIMG_TYPE_PNG); } /* }}} */ #endif #ifdef HAVE_GD_WBMP /* {{{ _php_image_bw_convert * It converts a gd Image to bw using a threshold value */ static void _php_image_bw_convert(gdImagePtr im_org, gdIOCtx *out, int threshold) { gdImagePtr im_dest; int white, black; int color, color_org, median; int dest_height = gdImageSY(im_org); int dest_width = gdImageSX(im_org); int x, y; TSRMLS_FETCH(); im_dest = gdImageCreate(dest_width, dest_height); if (im_dest == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate temporary buffer"); return; } white = gdImageColorAllocate(im_dest, 255, 255, 255); if (white == -1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate the colors for the destination buffer"); return; } black = gdImageColorAllocate(im_dest, 0, 0, 0); if (black == -1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate the colors for the destination buffer"); return; } #if HAVE_LIBGD20 if (im_org->trueColor) { gdImageTrueColorToPalette(im_org, 1, 256); } #endif for (y = 0; y < dest_height; y++) { for (x = 0; x < dest_width; x++) { color_org = gdImageGetPixel(im_org, x, y); median = (im_org->red[color_org] + im_org->green[color_org] + im_org->blue[color_org]) / 3; if (median < threshold) { color = black; } else { color = white; } gdImageSetPixel (im_dest, x, y, color); } } #ifdef USE_GD_IOCTX gdImageWBMPCtx (im_dest, black, out); #else gdImageWBMP (im_dest, black, out); #endif } /* }}} */ /* {{{ _php_image_convert * _php_image_convert converts jpeg/png images to wbmp and resizes them as needed */ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type ) { zval **f_org, **f_dest, **height, **width, **threshold; gdImagePtr im_org, im_dest, im_tmp; char *fn_org = NULL; char *fn_dest = NULL; FILE *org, *dest; int argc = ZEND_NUM_ARGS(); int dest_height = -1; int dest_width = -1; int org_height, org_width; int white, black; int color, color_org, median; int int_threshold; int x, y; float x_ratio, y_ratio; if (argc != 5 || zend_get_parameters_ex(argc, &f_org, &f_dest, &height, &width, &threshold) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } convert_to_string_ex(f_org); convert_to_string_ex(f_dest); convert_to_long_ex(height); convert_to_long_ex(width); convert_to_long_ex(threshold); fn_org = Z_STRVAL_PP(f_org); fn_dest = Z_STRVAL_PP(f_dest); dest_height = Z_LVAL_PP(height); dest_width = Z_LVAL_PP(width); int_threshold = Z_LVAL_PP(threshold); /* Check threshold value */ if (int_threshold < 0 || int_threshold > 8) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid threshold value '%d'", int_threshold); RETURN_FALSE; } /* Check origin file */ PHP_GD_CHECK_OPEN_BASEDIR(fn_org, "Invalid origin filename"); /* Check destination file */ PHP_GD_CHECK_OPEN_BASEDIR(fn_dest, "Invalid destination filename"); /* Open origin file */ org = VCWD_FOPEN(fn_org, "rb"); if (!org) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open '%s' for reading", fn_org); RETURN_FALSE; } /* Open destination file */ dest = VCWD_FOPEN(fn_dest, "wb"); if (!dest) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open '%s' for writing", fn_dest); RETURN_FALSE; } switch (image_type) { #ifdef HAVE_GD_GIF_READ case PHP_GDIMG_TYPE_GIF: im_org = gdImageCreateFromGif(org); if (im_org == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open '%s' Not a valid GIF file", fn_dest); RETURN_FALSE; } break; #endif /* HAVE_GD_GIF_READ */ #ifdef HAVE_GD_JPG case PHP_GDIMG_TYPE_JPG: im_org = gdImageCreateFromJpeg(org); if (im_org == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open '%s' Not a valid JPEG file", fn_dest); RETURN_FALSE; } break; #endif /* HAVE_GD_JPG */ #ifdef HAVE_GD_PNG case PHP_GDIMG_TYPE_PNG: im_org = gdImageCreateFromPng(org); if (im_org == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open '%s' Not a valid PNG file", fn_dest); RETURN_FALSE; } break; #endif /* HAVE_GD_PNG */ default: php_error_docref(NULL TSRMLS_CC, E_WARNING, "Format not supported"); RETURN_FALSE; break; } org_width = gdImageSX (im_org); org_height = gdImageSY (im_org); x_ratio = (float) org_width / (float) dest_width; y_ratio = (float) org_height / (float) dest_height; if (x_ratio > 1 && y_ratio > 1) { if (y_ratio > x_ratio) { x_ratio = y_ratio; } else { y_ratio = x_ratio; } dest_width = (int) (org_width / x_ratio); dest_height = (int) (org_height / y_ratio); } else { x_ratio = (float) dest_width / (float) org_width; y_ratio = (float) dest_height / (float) org_height; if (y_ratio < x_ratio) { x_ratio = y_ratio; } else { y_ratio = x_ratio; } dest_width = (int) (org_width * x_ratio); dest_height = (int) (org_height * y_ratio); } im_tmp = gdImageCreate (dest_width, dest_height); if (im_tmp == NULL ) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate temporary buffer"); RETURN_FALSE; } gdImageCopyResized (im_tmp, im_org, 0, 0, 0, 0, dest_width, dest_height, org_width, org_height); gdImageDestroy(im_org); fclose(org); im_dest = gdImageCreate(dest_width, dest_height); if (im_dest == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate destination buffer"); RETURN_FALSE; } white = gdImageColorAllocate(im_dest, 255, 255, 255); if (white == -1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate the colors for the destination buffer"); RETURN_FALSE; } black = gdImageColorAllocate(im_dest, 0, 0, 0); if (black == -1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate the colors for the destination buffer"); RETURN_FALSE; } int_threshold = int_threshold * 32; for (y = 0; y < dest_height; y++) { for (x = 0; x < dest_width; x++) { color_org = gdImageGetPixel (im_tmp, x, y); median = (im_tmp->red[color_org] + im_tmp->green[color_org] + im_tmp->blue[color_org]) / 3; if (median < int_threshold) { color = black; } else { color = white; } gdImageSetPixel (im_dest, x, y, color); } } gdImageDestroy (im_tmp ); gdImageWBMP(im_dest, black , dest); fflush(dest); fclose(dest); gdImageDestroy(im_dest); RETURN_TRUE; } /* }}} */ #endif /* HAVE_GD_WBMP */ #ifdef HAVE_GD_BUNDLED /* {{{ proto bool imageantialias(resource im, bool on) Should antialiased functions used or not*/ PHP_FUNCTION(imageantialias) { zval **IM, **alias; gdImagePtr im; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &IM, &alias) == FAILURE) { ZEND_WRONG_PARAM_COUNT(); } ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); convert_to_boolean_ex(alias); gdImageAntialias(im, Z_LVAL_PP(alias)); RETURN_TRUE; } /* }}} */ #endif #endif /* HAVE_LIBGD */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: sw=4 ts=4 fdm=marker * vim<600: sw=4 ts=4 */ php-4.4.8/ext/gd/gd_ctx.c0000644000175000017500000000736010736114307014420 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with 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. | +----------------------------------------------------------------------+ | Authors: Stanislav Malyshev | +----------------------------------------------------------------------+ */ #include "php_gd.h" #define CTX_PUTC(c,ctx) ctx->putC(ctx, c) static void _php_image_output_putc(struct gdIOCtx *ctx, int c) { /* without the following downcast, the write will fail * (i.e., will write a zero byte) for all * big endian architectures: */ unsigned char ch = (unsigned char) c; TSRMLS_FETCH(); php_write(&ch, 1 TSRMLS_CC); } static int _php_image_output_putbuf(struct gdIOCtx *ctx, const void* buf, int l) { TSRMLS_FETCH(); return php_write((void *)buf, l TSRMLS_CC); } static void _php_image_output_ctxfree(struct gdIOCtx *ctx) { if(ctx) { efree(ctx); } } static void _php_image_output_ctx(INTERNAL_FUNCTION_PARAMETERS, int image_type, char *tn, void (*func_p)()) { zval **imgind, **file, **quality; gdImagePtr im; char *fn = NULL; FILE *fp = NULL; int argc = ZEND_NUM_ARGS(); int q = -1, i; gdIOCtx *ctx; /* The quality parameter for Wbmp stands for the threshold when called from image2wbmp() */ if (argc < 1 || argc > 3 || zend_get_parameters_ex(argc, &imgind, &file, &quality) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(im, gdImagePtr, imgind, -1, "Image", phpi_get_le_gd()); if (argc > 1) { convert_to_string_ex(file); fn = Z_STRVAL_PP(file); if (argc == 3) { convert_to_long_ex(quality); q = Z_LVAL_PP(quality); } } if ((argc == 2) || (argc > 2 && Z_STRLEN_PP(file))) { PHP_GD_CHECK_OPEN_BASEDIR(fn, "Invalid filename"); fp = VCWD_FOPEN(fn, "wb"); if (!fp) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open '%s' for writing", fn); RETURN_FALSE; } ctx = gdNewFileCtx(fp); } else { ctx = emalloc(sizeof(gdIOCtx)); ctx->putC = _php_image_output_putc; ctx->putBuf = _php_image_output_putbuf; #if HAVE_LIBGD204 ctx->gd_free = _php_image_output_ctxfree; #else ctx->free = _php_image_output_ctxfree; #endif #if APACHE && defined(CHARSET_EBCDIC) /* XXX this is unlikely to work any more thies@thieso.net */ /* This is a binary file already: avoid EBCDIC->ASCII conversion */ ap_bsetflag(php3_rqst->connection->client, B_EBCDIC2ASCII, 0); #endif } switch(image_type) { case PHP_GDIMG_CONVERT_WBM: if(q<0||q>255) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid threshold value '%d'. It must be between 0 and 255", q); } case PHP_GDIMG_TYPE_JPG: (*func_p)(im, ctx, q); break; case PHP_GDIMG_TYPE_WBM: for(i=0; i < gdImageColorsTotal(im); i++) { if(gdImageRed(im, i) == 0) break; } (*func_p)(im, i, ctx); break; default: (*func_p)(im, ctx); break; } #if HAVE_LIBGD204 ctx->gd_free(ctx); #else ctx->free(ctx); #endif if(fp) { fflush(fp); fclose(fp); } RETURN_TRUE; } php-4.4.8/ext/gd/libgd/0000755000175000017500000000000010737115146014062 5ustar derickderickphp-4.4.8/ext/gd/libgd/gd.c0000644000175000017500000024221510706417300014617 0ustar derickderick#include #include #include #include #include "gd.h" #include "gdhelpers.h" #include "php.h" #ifdef _MSC_VER # if _MSC_VER >= 1300 /* in MSVC.NET these are available but only for __cplusplus and not _MSC_EXTENSIONS */ # if !defined(_MSC_EXTENSIONS) && defined(__cplusplus) # define HAVE_FABSF 1 extern float fabsf(float x); # define HAVE_FLOORF 1 extern float floorf(float x); # endif /*MSVC.NET */ # endif /* MSC */ #endif #ifndef HAVE_FABSF # define HAVE_FABSF 0 #endif #ifndef HAVE_FLOORF # define HAVE_FLOORF 0 #endif #if HAVE_FABSF == 0 /* float fabsf(float x); */ # define fabsf(x) ((float)(fabs(x))) #endif #if HAVE_FLOORF == 0 /* float floorf(float x);*/ #define floorf(x) ((float)(floor(x))) #endif #ifdef _OSD_POSIX /* BS2000 uses the EBCDIC char set instead of ASCII */ #define CHARSET_EBCDIC #define __attribute__(any) /*nothing */ #endif /*_OSD_POSIX*/ #ifndef CHARSET_EBCDIC #define ASC(ch) ch #else /*CHARSET_EBCDIC */ #define ASC(ch) gd_toascii[(unsigned char)ch] static const unsigned char gd_toascii[256] = { /*00 */ 0x00, 0x01, 0x02, 0x03, 0x85, 0x09, 0x86, 0x7f, 0x87, 0x8d, 0x8e, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /*................ */ /*10 */ 0x10, 0x11, 0x12, 0x13, 0x8f, 0x0a, 0x08, 0x97, 0x18, 0x19, 0x9c, 0x9d, 0x1c, 0x1d, 0x1e, 0x1f, /*................ */ /*20 */ 0x80, 0x81, 0x82, 0x83, 0x84, 0x92, 0x17, 0x1b, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x05, 0x06, 0x07, /*................ */ /*30 */ 0x90, 0x91, 0x16, 0x93, 0x94, 0x95, 0x96, 0x04, 0x98, 0x99, 0x9a, 0x9b, 0x14, 0x15, 0x9e, 0x1a, /*................ */ /*40 */ 0x20, 0xa0, 0xe2, 0xe4, 0xe0, 0xe1, 0xe3, 0xe5, 0xe7, 0xf1, 0x60, 0x2e, 0x3c, 0x28, 0x2b, 0x7c, /* .........`.<(+| */ /*50 */ 0x26, 0xe9, 0xea, 0xeb, 0xe8, 0xed, 0xee, 0xef, 0xec, 0xdf, 0x21, 0x24, 0x2a, 0x29, 0x3b, 0x9f, /*&.........!$*);. */ /*60 */ 0x2d, 0x2f, 0xc2, 0xc4, 0xc0, 0xc1, 0xc3, 0xc5, 0xc7, 0xd1, 0x5e, 0x2c, 0x25, 0x5f, 0x3e, 0x3f, /*-/........^,%_>?*/ /*70 */ 0xf8, 0xc9, 0xca, 0xcb, 0xc8, 0xcd, 0xce, 0xcf, 0xcc, 0xa8, 0x3a, 0x23, 0x40, 0x27, 0x3d, 0x22, /*..........:#@'=" */ /*80 */ 0xd8, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0xab, 0xbb, 0xf0, 0xfd, 0xfe, 0xb1, /*.abcdefghi...... */ /*90 */ 0xb0, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0xaa, 0xba, 0xe6, 0xb8, 0xc6, 0xa4, /*.jklmnopqr...... */ /*a0 */ 0xb5, 0xaf, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0xa1, 0xbf, 0xd0, 0xdd, 0xde, 0xae, /*..stuvwxyz...... */ /*b0 */ 0xa2, 0xa3, 0xa5, 0xb7, 0xa9, 0xa7, 0xb6, 0xbc, 0xbd, 0xbe, 0xac, 0x5b, 0x5c, 0x5d, 0xb4, 0xd7, /*...........[\].. */ /*c0 */ 0xf9, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0xad, 0xf4, 0xf6, 0xf2, 0xf3, 0xf5, /*.ABCDEFGHI...... */ /*d0 */ 0xa6, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0xb9, 0xfb, 0xfc, 0xdb, 0xfa, 0xff, /*.JKLMNOPQR...... */ /*e0 */ 0xd9, 0xf7, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0xb2, 0xd4, 0xd6, 0xd2, 0xd3, 0xd5, /*..STUVWXYZ...... */ /*f0 */ 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0xb3, 0x7b, 0xdc, 0x7d, 0xda, 0x7e /*0123456789.{.}.~ */ }; #endif /*CHARSET_EBCDIC */ /* 2.0.10: cast instead of floor() yields 35% performance improvement. Thanks to John Buckman. */ #define floor_cast(exp) ((long) exp) extern int gdCosT[]; extern int gdSinT[]; static void gdImageBrushApply(gdImagePtr im, int x, int y); static void gdImageTileApply(gdImagePtr im, int x, int y); static void gdImageAntiAliasedApply(gdImagePtr im, int x, int y); static int gdFullAlphaBlend(int dst, int src); static int gdLayerOverlay(int dst, int src); static int gdAlphaBlendColor(int b1, int b2, int a1, int a2); static int gdAlphaOverlayColor(int src, int dst, int max); int gdImageGetTrueColorPixel(gdImagePtr im, int x, int y); void php_gd_error_ex(int type, const char *format, ...) { va_list args; TSRMLS_FETCH(); va_start(args, format); php_verror(NULL, "", type, format, args TSRMLS_CC); va_end(args); } void php_gd_error(const char *format, ...) { va_list args; TSRMLS_FETCH(); va_start(args, format); php_verror(NULL, "", E_WARNING, format, args TSRMLS_CC); va_end(args); } gdImagePtr gdImageCreate (int sx, int sy) { int i; gdImagePtr im; im = (gdImage *) gdMalloc(sizeof(gdImage)); memset(im, 0, sizeof(gdImage)); /* Row-major ever since gd 1.3 */ im->pixels = (unsigned char **) safe_emalloc(sizeof(unsigned char *), sy, 0); im->AA_opacity = (unsigned char **) safe_emalloc(sizeof(unsigned char *), sy, 0); im->polyInts = 0; im->polyAllocated = 0; im->brush = 0; im->tile = 0; im->style = 0; for (i = 0; i < sy; i++) { /* Row-major ever since gd 1.3 */ im->pixels[i] = (unsigned char *) gdCalloc(sx, sizeof(unsigned char)); im->AA_opacity[i] = (unsigned char *) gdCalloc(sx, sizeof(unsigned char)); } im->sx = sx; im->sy = sy; im->colorsTotal = 0; im->transparent = (-1); im->interlace = 0; im->thick = 1; im->AA = 0; im->AA_polygon = 0; for (i = 0; i < gdMaxColors; i++) { im->open[i] = 1; im->red[i] = 0; im->green[i] = 0; im->blue[i] = 0; } im->trueColor = 0; im->tpixels = 0; im->cx1 = 0; im->cy1 = 0; im->cx2 = im->sx - 1; im->cy2 = im->sy - 1; return im; } gdImagePtr gdImageCreateTrueColor (int sx, int sy) { int i; gdImagePtr im; im = (gdImage *) gdMalloc(sizeof(gdImage)); memset(im, 0, sizeof(gdImage)); im->tpixels = (int **) safe_emalloc(sizeof(int *), sy, 0); im->AA_opacity = (unsigned char **) safe_emalloc(sizeof(unsigned char *), sy, 0); im->polyInts = 0; im->polyAllocated = 0; im->brush = 0; im->tile = 0; im->style = 0; for (i = 0; i < sy; i++) { im->tpixels[i] = (int *) gdCalloc(sx, sizeof(int)); im->AA_opacity[i] = (unsigned char *) gdCalloc(sx, sizeof(unsigned char)); } im->sx = sx; im->sy = sy; im->transparent = (-1); im->interlace = 0; im->trueColor = 1; /* 2.0.2: alpha blending is now on by default, and saving of alpha is * off by default. This allows font antialiasing to work as expected * on the first try in JPEGs -- quite important -- and also allows * for smaller PNGs when saving of alpha channel is not really * desired, which it usually isn't! */ im->saveAlphaFlag = 0; im->alphaBlendingFlag = 1; im->thick = 1; im->AA = 0; im->AA_polygon = 0; im->cx1 = 0; im->cy1 = 0; im->cx2 = im->sx - 1; im->cy2 = im->sy - 1; return im; } void gdImageDestroy (gdImagePtr im) { int i; if (im->pixels) { for (i = 0; i < im->sy; i++) { gdFree(im->pixels[i]); } gdFree(im->pixels); } if (im->tpixels) { for (i = 0; i < im->sy; i++) { gdFree(im->tpixels[i]); } gdFree(im->tpixels); } if (im->AA_opacity) { for (i = 0; i < im->sy; i++) { gdFree(im->AA_opacity[i]); } gdFree(im->AA_opacity); } if (im->polyInts) { gdFree(im->polyInts); } if (im->style) { gdFree(im->style); } gdFree(im); } int gdImageColorClosest (gdImagePtr im, int r, int g, int b) { return gdImageColorClosestAlpha (im, r, g, b, gdAlphaOpaque); } int gdImageColorClosestAlpha (gdImagePtr im, int r, int g, int b, int a) { int i; long rd, gd, bd, ad; int ct = (-1); int first = 1; long mindist = 0; if (im->trueColor) { return gdTrueColorAlpha(r, g, b, a); } for (i = 0; i < im->colorsTotal; i++) { long dist; if (im->open[i]) { continue; } rd = im->red[i] - r; gd = im->green[i] - g; bd = im->blue[i] - b; /* gd 2.02: whoops, was - b (thanks to David Marwood) */ ad = im->alpha[i] - a; dist = rd * rd + gd * gd + bd * bd + ad * ad; if (first || (dist < mindist)) { mindist = dist; ct = i; first = 0; } } return ct; } /* This code is taken from http://www.acm.org/jgt/papers/SmithLyons96/hwb_rgb.html, an article * on colour conversion to/from RBG and HWB colour systems. * It has been modified to return the converted value as a * parameter. */ #define RETURN_HWB(h, w, b) {HWB->H = h; HWB->W = w; HWB->B = b; return HWB;} #define RETURN_RGB(r, g, b) {RGB->R = r; RGB->G = g; RGB->B = b; return RGB;} #define HWB_UNDEFINED -1 #define SETUP_RGB(s, r, g, b) {s.R = r/255.0f; s.G = g/255.0f; s.B = b/255.0f;} #ifndef MIN #define MIN(a,b) ((a)<(b)?(a):(b)) #endif #define MIN3(a,b,c) ((a)<(b)?(MIN(a,c)):(MIN(b,c))) #ifndef MAX #define MAX(a,b) ((a)<(b)?(b):(a)) #endif #define MAX3(a,b,c) ((a)<(b)?(MAX(b,c)):(MAX(a,c))) /* * Theoretically, hue 0 (pure red) is identical to hue 6 in these transforms. Pure * red always maps to 6 in this implementation. Therefore UNDEFINED can be * defined as 0 in situations where only unsigned numbers are desired. */ typedef struct { float R, G, B; } RGBType; typedef struct { float H, W, B; } HWBType; static HWBType * RGB_to_HWB (RGBType RGB, HWBType * HWB) { /* * RGB are each on [0, 1]. W and B are returned on [0, 1] and H is * returned on [0, 6]. Exception: H is returned UNDEFINED if W == 1 - B. */ float R = RGB.R, G = RGB.G, B = RGB.B, w, v, b, f; int i; w = MIN3 (R, G, B); v = MAX3 (R, G, B); b = 1 - v; if (v == w) { RETURN_HWB(HWB_UNDEFINED, w, b); } f = (R == w) ? G - B : ((G == w) ? B - R : R - G); i = (R == w) ? 3 : ((G == w) ? 5 : 1); RETURN_HWB(i - f / (v - w), w, b); } static float HWB_Diff (int r1, int g1, int b1, int r2, int g2, int b2) { RGBType RGB1, RGB2; HWBType HWB1, HWB2; float diff; SETUP_RGB(RGB1, r1, g1, b1); SETUP_RGB(RGB2, r2, g2, b2); RGB_to_HWB(RGB1, &HWB1); RGB_to_HWB(RGB2, &HWB2); /* * I made this bit up; it seems to produce OK results, and it is certainly * more visually correct than the current RGB metric. (PJW) */ if ((HWB1.H == HWB_UNDEFINED) || (HWB2.H == HWB_UNDEFINED)) { diff = 0.0f; /* Undefined hues always match... */ } else { diff = fabsf(HWB1.H - HWB2.H); if (diff > 3.0f) { diff = 6.0f - diff; /* Remember, it's a colour circle */ } } diff = diff * diff + (HWB1.W - HWB2.W) * (HWB1.W - HWB2.W) + (HWB1.B - HWB2.B) * (HWB1.B - HWB2.B); return diff; } #if 0 /* * This is not actually used, but is here for completeness, in case someone wants to * use the HWB stuff for anything else... */ static RGBType * HWB_to_RGB (HWBType HWB, RGBType * RGB) { /* * H is given on [0, 6] or UNDEFINED. W and B are given on [0, 1]. * RGB are each returned on [0, 1]. */ float h = HWB.H, w = HWB.W, b = HWB.B, v, n, f; int i; v = 1 - b; if (h == HWB_UNDEFINED) { RETURN_RGB(v, v, v); } i = floor(h); f = h - i; if (i & 1) { f = 1 - f; /* if i is odd */ } n = w + f * (v - w); /* linear interpolation between w and v */ switch (i) { case 6: case 0: RETURN_RGB(v, n, w); case 1: RETURN_RGB(n, v, w); case 2: RETURN_RGB(w, v, n); case 3: RETURN_RGB(w, n, v); case 4: RETURN_RGB(n, w, v); case 5: RETURN_RGB(v, w, n); } return RGB; } #endif int gdImageColorClosestHWB (gdImagePtr im, int r, int g, int b) { int i; /* long rd, gd, bd; */ int ct = (-1); int first = 1; float mindist = 0; if (im->trueColor) { return gdTrueColor(r, g, b); } for (i = 0; i < im->colorsTotal; i++) { float dist; if (im->open[i]) { continue; } dist = HWB_Diff(im->red[i], im->green[i], im->blue[i], r, g, b); if (first || (dist < mindist)) { mindist = dist; ct = i; first = 0; } } return ct; } int gdImageColorExact (gdImagePtr im, int r, int g, int b) { return gdImageColorExactAlpha (im, r, g, b, gdAlphaOpaque); } int gdImageColorExactAlpha (gdImagePtr im, int r, int g, int b, int a) { int i; if (im->trueColor) { return gdTrueColorAlpha(r, g, b, a); } for (i = 0; i < im->colorsTotal; i++) { if (im->open[i]) { continue; } if ((im->red[i] == r) && (im->green[i] == g) && (im->blue[i] == b) && (im->alpha[i] == a)) { return i; } } return -1; } int gdImageColorAllocate (gdImagePtr im, int r, int g, int b) { return gdImageColorAllocateAlpha (im, r, g, b, gdAlphaOpaque); } int gdImageColorAllocateAlpha (gdImagePtr im, int r, int g, int b, int a) { int i; int ct = (-1); if (im->trueColor) { return gdTrueColorAlpha(r, g, b, a); } for (i = 0; i < im->colorsTotal; i++) { if (im->open[i]) { ct = i; break; } } if (ct == (-1)) { ct = im->colorsTotal; if (ct == gdMaxColors) { return -1; } im->colorsTotal++; } im->red[ct] = r; im->green[ct] = g; im->blue[ct] = b; im->alpha[ct] = a; im->open[ct] = 0; return ct; } /* * gdImageColorResolve is an alternative for the code fragment: * * if ((color=gdImageColorExact(im,R,G,B)) < 0) * if ((color=gdImageColorAllocate(im,R,G,B)) < 0) * color=gdImageColorClosest(im,R,G,B); * * in a single function. Its advantage is that it is guaranteed to * return a color index in one search over the color table. */ int gdImageColorResolve (gdImagePtr im, int r, int g, int b) { return gdImageColorResolveAlpha(im, r, g, b, gdAlphaOpaque); } int gdImageColorResolveAlpha (gdImagePtr im, int r, int g, int b, int a) { int c; int ct = -1; int op = -1; long rd, gd, bd, ad, dist; long mindist = 4 * 255 * 255; /* init to max poss dist */ if (im->trueColor) { return gdTrueColorAlpha (r, g, b, a); } for (c = 0; c < im->colorsTotal; c++) { if (im->open[c]) { op = c; /* Save open slot */ continue; /* Color not in use */ } if (c == im->transparent) { /* don't ever resolve to the color that has * been designated as the transparent color */ continue; } rd = (long) (im->red[c] - r); gd = (long) (im->green[c] - g); bd = (long) (im->blue[c] - b); ad = (long) (im->alpha[c] - a); dist = rd * rd + gd * gd + bd * bd + ad * ad; if (dist < mindist) { if (dist == 0) { return c; /* Return exact match color */ } mindist = dist; ct = c; } } /* no exact match. We now know closest, but first try to allocate exact */ if (op == -1) { op = im->colorsTotal; if (op == gdMaxColors) { /* No room for more colors */ return ct; /* Return closest available color */ } im->colorsTotal++; } im->red[op] = r; im->green[op] = g; im->blue[op] = b; im->alpha[op] = a; im->open[op] = 0; return op; /* Return newly allocated color */ } void gdImageColorDeallocate (gdImagePtr im, int color) { if (im->trueColor) { return; } /* Mark it open. */ im->open[color] = 1; } void gdImageColorTransparent (gdImagePtr im, int color) { if (!im->trueColor) { if (im->transparent != -1) { im->alpha[im->transparent] = gdAlphaOpaque; } if (color > -1 && colorcolorsTotal && color<=gdMaxColors) { im->alpha[color] = gdAlphaTransparent; } else { return; } } im->transparent = color; } void gdImagePaletteCopy (gdImagePtr to, gdImagePtr from) { int i; int x, y, p; int xlate[256]; if (to->trueColor || from->trueColor) { return; } for (i = 0; i < 256; i++) { xlate[i] = -1; } for (x = 0; x < to->sx; x++) { for (y = 0; y < to->sy; y++) { p = gdImageGetPixel(to, x, y); if (xlate[p] == -1) { /* This ought to use HWB, but we don't have an alpha-aware version of that yet. */ xlate[p] = gdImageColorClosestAlpha (from, to->red[p], to->green[p], to->blue[p], to->alpha[p]); } gdImageSetPixel(to, x, y, xlate[p]); } } for (i = 0; i < from->colorsTotal; i++) { to->red[i] = from->red[i]; to->blue[i] = from->blue[i]; to->green[i] = from->green[i]; to->alpha[i] = from->alpha[i]; to->open[i] = 0; } for (i = from->colorsTotal; i < to->colorsTotal; i++) { to->open[i] = 1; } to->colorsTotal = from->colorsTotal; } /* 2.0.10: before the drawing routines, some code to clip points that are * outside the drawing window. Nick Atty (nick@canalplan.org.uk) * * This is the Sutherland Hodgman Algorithm, as implemented by * Duvanenko, Robbins and Gyurcsik - SH(DRG) for short. See Dr Dobb's * Journal, January 1996, pp107-110 and 116-117 * * Given the end points of a line, and a bounding rectangle (which we * know to be from (0,0) to (SX,SY)), adjust the endpoints to be on * the edges of the rectangle if the line should be drawn at all, * otherwise return a failure code */ /* this does "one-dimensional" clipping: note that the second time it * is called, all the x parameters refer to height and the y to width * - the comments ignore this (if you can understand it when it's * looking at the X parameters, it should become clear what happens on * the second call!) The code is simplified from that in the article, * as we know that gd images always start at (0,0) */ static int clip_1d(int *x0, int *y0, int *x1, int *y1, int maxdim) { double m; /* gradient of line */ if (*x0 < 0) { /* start of line is left of window */ if(*x1 < 0) { /* as is the end, so the line never cuts the window */ return 0; } m = (*y1 - *y0)/(double)(*x1 - *x0); /* calculate the slope of the line */ /* adjust x0 to be on the left boundary (ie to be zero), and y0 to match */ *y0 -= (int)(m * *x0); *x0 = 0; /* now, perhaps, adjust the far end of the line as well */ if (*x1 > maxdim) { *y1 += (int)(m * (maxdim - *x1)); *x1 = maxdim; } return 1; } if (*x0 > maxdim) { /* start of line is right of window - complement of above */ if (*x1 > maxdim) { /* as is the end, so the line misses the window */ return 0; } m = (*y1 - *y0)/(double)(*x1 - *x0); /* calculate the slope of the line */ *y0 += (int)(m * (maxdim - *x0)); /* adjust so point is on the right boundary */ *x0 = maxdim; /* now, perhaps, adjust the end of the line */ if (*x1 < 0) { *y1 -= (int)(m * *x1); *x1 = 0; } return 1; } /* the final case - the start of the line is inside the window */ if (*x1 > maxdim) { /* other end is outside to the right */ m = (*y1 - *y0)/(double)(*x1 - *x0); /* calculate the slope of the line */ *y1 += (int)(m * (maxdim - *x1)); *x1 = maxdim; return 1; } if (*x1 < 0) { /* other end is outside to the left */ m = (*y1 - *y0)/(double)(*x1 - *x0); /* calculate the slope of the line */ *y1 -= (int)(m * *x1); *x1 = 0; return 1; } /* only get here if both points are inside the window */ return 1; } void gdImageSetPixel (gdImagePtr im, int x, int y, int color) { int p; switch (color) { case gdStyled: if (!im->style) { /* Refuse to draw if no style is set. */ return; } else { p = im->style[im->stylePos++]; } if (p != gdTransparent) { gdImageSetPixel(im, x, y, p); } im->stylePos = im->stylePos % im->styleLength; break; case gdStyledBrushed: if (!im->style) { /* Refuse to draw if no style is set. */ return; } p = im->style[im->stylePos++]; if (p != gdTransparent && p != 0) { gdImageSetPixel(im, x, y, gdBrushed); } im->stylePos = im->stylePos % im->styleLength; break; case gdBrushed: gdImageBrushApply(im, x, y); break; case gdTiled: gdImageTileApply(im, x, y); break; case gdAntiAliased: gdImageAntiAliasedApply(im, x, y); break; default: if (gdImageBoundsSafe(im, x, y)) { if (im->trueColor) { switch (im->alphaBlendingFlag) { default: case gdEffectReplace: im->tpixels[y][x] = color; break; case gdEffectAlphaBlend: im->tpixels[y][x] = gdAlphaBlend(im->tpixels[y][x], color); break; case gdEffectNormal: im->tpixels[y][x] = gdFullAlphaBlend(im->tpixels[y][x], color); break; case gdEffectOverlay : im->tpixels[y][x] = gdLayerOverlay(im->tpixels[y][x], color); break; } } else { im->pixels[y][x] = color; } } break; } } int gdImageGetTrueColorPixel (gdImagePtr im, int x, int y) { int p = gdImageGetPixel(im, x, y); if (!im->trueColor) { return gdTrueColorAlpha(im->red[p], im->green[p], im->blue[p], (im->transparent == p) ? gdAlphaTransparent : gdAlphaOpaque); } else { return p; } } static void gdImageBrushApply (gdImagePtr im, int x, int y) { int lx, ly; int hy, hx; int x1, y1, x2, y2; int srcx, srcy; if (!im->brush) { return; } hy = gdImageSY(im->brush) / 2; y1 = y - hy; y2 = y1 + gdImageSY(im->brush); hx = gdImageSX(im->brush) / 2; x1 = x - hx; x2 = x1 + gdImageSX(im->brush); srcy = 0; if (im->trueColor) { if (im->brush->trueColor) { for (ly = y1; ly < y2; ly++) { srcx = 0; for (lx = x1; (lx < x2); lx++) { int p; p = gdImageGetTrueColorPixel(im->brush, srcx, srcy); /* 2.0.9, Thomas Winzig: apply simple full transparency */ if (p != gdImageGetTransparent(im->brush)) { gdImageSetPixel(im, lx, ly, p); } srcx++; } srcy++; } } else { /* 2.0.12: Brush palette, image truecolor (thanks to Thorben Kundinger for pointing out the issue) */ for (ly = y1; ly < y2; ly++) { srcx = 0; for (lx = x1; lx < x2; lx++) { int p, tc; p = gdImageGetPixel(im->brush, srcx, srcy); tc = gdImageGetTrueColorPixel(im->brush, srcx, srcy); /* 2.0.9, Thomas Winzig: apply simple full transparency */ if (p != gdImageGetTransparent(im->brush)) { gdImageSetPixel(im, lx, ly, tc); } srcx++; } srcy++; } } } else { for (ly = y1; ly < y2; ly++) { srcx = 0; for (lx = x1; lx < x2; lx++) { int p; p = gdImageGetPixel(im->brush, srcx, srcy); /* Allow for non-square brushes! */ if (p != gdImageGetTransparent(im->brush)) { /* Truecolor brush. Very slow on a palette destination. */ if (im->brush->trueColor) { gdImageSetPixel(im, lx, ly, gdImageColorResolveAlpha(im, gdTrueColorGetRed(p), gdTrueColorGetGreen(p), gdTrueColorGetBlue(p), gdTrueColorGetAlpha(p))); } else { gdImageSetPixel(im, lx, ly, im->brushColorMap[p]); } } srcx++; } srcy++; } } } static void gdImageTileApply (gdImagePtr im, int x, int y) { int srcx, srcy; int p; if (!im->tile) { return; } srcx = x % gdImageSX(im->tile); srcy = y % gdImageSY(im->tile); if (im->trueColor) { p = gdImageGetTrueColorPixel(im->tile, srcx, srcy); gdImageSetPixel(im, x, y, p); } else { p = gdImageGetPixel(im->tile, srcx, srcy); /* Allow for transparency */ if (p != gdImageGetTransparent(im->tile)) { if (im->tile->trueColor) { /* Truecolor tile. Very slow on a palette destination. */ gdImageSetPixel(im, x, y, gdImageColorResolveAlpha(im, gdTrueColorGetRed(p), gdTrueColorGetGreen(p), gdTrueColorGetBlue(p), gdTrueColorGetAlpha(p))); } else { gdImageSetPixel(im, x, y, im->tileColorMap[p]); } } } } static int gdImageTileGet (gdImagePtr im, int x, int y) { int srcx, srcy; int tileColor,p; if (!im->tile) { return -1; } srcx = x % gdImageSX(im->tile); srcy = y % gdImageSY(im->tile); p = gdImageGetPixel(im->tile, srcx, srcy); if (im->trueColor) { if (im->tile->trueColor) { tileColor = p; } else { tileColor = gdTrueColorAlpha( gdImageRed(im->tile,p), gdImageGreen(im->tile,p), gdImageBlue (im->tile,p), gdImageAlpha (im->tile,p)); } } else { if (im->tile->trueColor) { tileColor = gdImageColorResolveAlpha(im, gdTrueColorGetRed (p), gdTrueColorGetGreen (p), gdTrueColorGetBlue (p), gdTrueColorGetAlpha (p)); } else { tileColor = p; tileColor = gdImageColorResolveAlpha(im, gdImageRed (im->tile,p), gdImageGreen (im->tile,p), gdImageBlue (im->tile,p), gdImageAlpha (im->tile,p)); } } return tileColor; } static void gdImageAntiAliasedApply (gdImagePtr im, int px, int py) { float p_dist, p_alpha; unsigned char opacity; /* * Find the perpendicular distance from point C (px, py) to the line * segment AB that is being drawn. (Adapted from an algorithm from the * comp.graphics.algorithms FAQ.) */ int LAC_2, LBC_2; int Ax_Cx = im->AAL_x1 - px; int Ay_Cy = im->AAL_y1 - py; int Bx_Cx = im->AAL_x2 - px; int By_Cy = im->AAL_y2 - py; /* 2.0.13: bounds check! AA_opacity is just as capable of * overflowing as the main pixel array. Arne Jorgensen. * 2.0.14: typo fixed. 2.0.15: moved down below declarations * to satisfy non-C++ compilers. */ if (!gdImageBoundsSafe(im, px, py)) { return; } /* Get the squares of the lengths of the segemnts AC and BC. */ LAC_2 = (Ax_Cx * Ax_Cx) + (Ay_Cy * Ay_Cy); LBC_2 = (Bx_Cx * Bx_Cx) + (By_Cy * By_Cy); if (((im->AAL_LAB_2 + LAC_2) >= LBC_2) && ((im->AAL_LAB_2 + LBC_2) >= LAC_2)) { /* The two angles are acute. The point lies inside the portion of the * plane spanned by the line segment. */ p_dist = fabs ((float) ((Ay_Cy * im->AAL_Bx_Ax) - (Ax_Cx * im->AAL_By_Ay)) / im->AAL_LAB); } else { /* The point is past an end of the line segment. It's length from the * segment is the shorter of the lengths from the endpoints, but call * the distance -1, so as not to compute the alpha nor draw the pixel. */ p_dist = -1; } if ((p_dist >= 0) && (p_dist <= (float) (im->thick))) { p_alpha = pow (1.0 - (p_dist / 1.5), 2); if (p_alpha > 0) { if (p_alpha >= 1) { opacity = 255; } else { opacity = (unsigned char) (p_alpha * 255.0); } if (!im->AA_polygon || (im->AA_opacity[py][px] < opacity)) { im->AA_opacity[py][px] = opacity; } } } } int gdImageGetPixel (gdImagePtr im, int x, int y) { if (gdImageBoundsSafe(im, x, y)) { if (im->trueColor) { return im->tpixels[y][x]; } else { return im->pixels[y][x]; } } else { return 0; } } void gdImageAABlend (gdImagePtr im) { float p_alpha, old_alpha; int color = im->AA_color, color_red, color_green, color_blue; int old_color, old_red, old_green, old_blue; int p_color, p_red, p_green, p_blue; int px, py; color_red = gdImageRed(im, color); color_green = gdImageGreen(im, color); color_blue = gdImageBlue(im, color); /* Impose the anti-aliased drawing on the image. */ for (py = 0; py < im->sy; py++) { for (px = 0; px < im->sx; px++) { if (im->AA_opacity[py][px] != 0) { old_color = gdImageGetPixel(im, px, py); if ((old_color != color) && ((old_color != im->AA_dont_blend) || (im->AA_opacity[py][px] == 255))) { /* Only blend with different colors that aren't the dont_blend color. */ p_alpha = (float) (im->AA_opacity[py][px]) / 255.0; old_alpha = 1.0 - p_alpha; if (p_alpha >= 1.0) { p_color = color; } else { old_red = gdImageRed(im, old_color); old_green = gdImageGreen(im, old_color); old_blue = gdImageBlue(im, old_color); p_red = (int) (((float) color_red * p_alpha) + ((float) old_red * old_alpha)); p_green = (int) (((float) color_green * p_alpha) + ((float) old_green * old_alpha)); p_blue = (int) (((float) color_blue * p_alpha) + ((float) old_blue * old_alpha)); p_color = gdImageColorResolve(im, p_red, p_green, p_blue); } gdImageSetPixel(im, px, py, p_color); } } } /* Clear the AA_opacity array behind us. */ memset(im->AA_opacity[py], 0, im->sx); } } /* Bresenham as presented in Foley & Van Dam */ void gdImageLine (gdImagePtr im, int x1, int y1, int x2, int y2, int color) { int dx, dy, incr1, incr2, d, x, y, xend, yend, xdirflag, ydirflag; int wid; int w, wstart; int thick = im->thick; /* 2.0.10: Nick Atty: clip to edges of drawing rectangle, return if no points need to be drawn */ if (!clip_1d(&x1,&y1,&x2,&y2,gdImageSX(im)) || !clip_1d(&y1,&x1,&y2,&x2,gdImageSY(im))) { return; } /* gdAntiAliased passed as color: set anti-aliased line (AAL) global vars. */ if (color == gdAntiAliased) { im->AAL_x1 = x1; im->AAL_y1 = y1; im->AAL_x2 = x2; im->AAL_y2 = y2; /* Compute what we can for point-to-line distance calculation later. */ im->AAL_Bx_Ax = x2 - x1; im->AAL_By_Ay = y2 - y1; im->AAL_LAB_2 = (im->AAL_Bx_Ax * im->AAL_Bx_Ax) + (im->AAL_By_Ay * im->AAL_By_Ay); im->AAL_LAB = sqrt (im->AAL_LAB_2); /* For AA, we must draw pixels outside the width of the line. Keep in * mind that this will be curtailed by cos/sin of theta later. */ thick += 4; } dx = abs(x2 - x1); dy = abs(y2 - y1); if (dy <= dx) { /* More-or-less horizontal. use wid for vertical stroke */ /* Doug Claar: watch out for NaN in atan2 (2.0.5) */ if ((dx == 0) && (dy == 0)) { wid = 1; } else { wid = (int)(thick * cos (atan2 (dy, dx))); if (wid == 0) { wid = 1; } } d = 2 * dy - dx; incr1 = 2 * dy; incr2 = 2 * (dy - dx); if (x1 > x2) { x = x2; y = y2; ydirflag = (-1); xend = x1; } else { x = x1; y = y1; ydirflag = 1; xend = x2; } /* Set up line thickness */ wstart = y - wid / 2; for (w = wstart; w < wstart + wid; w++) { gdImageSetPixel(im, x, w, color); } if (((y2 - y1) * ydirflag) > 0) { while (x < xend) { x++; if (d < 0) { d += incr1; } else { y++; d += incr2; } wstart = y - wid / 2; for (w = wstart; w < wstart + wid; w++) { gdImageSetPixel (im, x, w, color); } } } else { while (x < xend) { x++; if (d < 0) { d += incr1; } else { y--; d += incr2; } wstart = y - wid / 2; for (w = wstart; w < wstart + wid; w++) { gdImageSetPixel (im, x, w, color); } } } } else { /* More-or-less vertical. use wid for horizontal stroke */ /* 2.0.12: Michael Schwartz: divide rather than multiply; TBB: but watch out for /0! */ double as = sin(atan2(dy, dx)); if (as != 0) { if (!(wid = thick / as)) { wid = 1; } } else { wid = 1; } d = 2 * dx - dy; incr1 = 2 * dx; incr2 = 2 * (dx - dy); if (y1 > y2) { y = y2; x = x2; yend = y1; xdirflag = (-1); } else { y = y1; x = x1; yend = y2; xdirflag = 1; } /* Set up line thickness */ wstart = x - wid / 2; for (w = wstart; w < wstart + wid; w++) { gdImageSetPixel (im, w, y, color); } if (((x2 - x1) * xdirflag) > 0) { while (y < yend) { y++; if (d < 0) { d += incr1; } else { x++; d += incr2; } wstart = x - wid / 2; for (w = wstart; w < wstart + wid; w++) { gdImageSetPixel (im, w, y, color); } } } else { while (y < yend) { y++; if (d < 0) { d += incr1; } else { x--; d += incr2; } wstart = x - wid / 2; for (w = wstart; w < wstart + wid; w++) { gdImageSetPixel (im, w, y, color); } } } } /* If this is the only line we are drawing, go ahead and blend. */ if (color == gdAntiAliased && !im->AA_polygon) { gdImageAABlend(im); } } /* * Added on 2003/12 by Pierre-Alain Joye (pajoye@pearfr.org) * */ #define BLEND_COLOR(a, nc, c, cc) \ nc = (cc) + (((((c) - (cc)) * (a)) + ((((c) - (cc)) * (a)) >> 8) + 0x80) >> 8); inline static void gdImageSetAAPixelColor(gdImagePtr im, int x, int y, int color, int t) { int dr,dg,db,p,r,g,b; dr = gdTrueColorGetRed(color); dg = gdTrueColorGetGreen(color); db = gdTrueColorGetBlue(color); p = gdImageGetPixel(im,x,y); r = gdTrueColorGetRed(p); g = gdTrueColorGetGreen(p); b = gdTrueColorGetBlue(p); BLEND_COLOR(t, dr, r, dr); BLEND_COLOR(t, dg, g, dg); BLEND_COLOR(t, db, b, db); im->tpixels[y][x]=gdTrueColorAlpha(dr, dg, db, gdAlphaOpaque); } /* * Added on 2003/12 by Pierre-Alain Joye (pajoye@pearfr.org) **/ void gdImageAALine (gdImagePtr im, int x1, int y1, int x2, int y2, int col) { /* keep them as 32bits */ long x, y, inc; long dx, dy,tmp; if (y1 < 0 && y2 < 0) { return; } if (y1 < 0) { x1 += (y1 * (x1 - x2)) / (y2 - y1); y1 = 0; } if (y2 < 0) { x2 += (y2 * (x1 - x2)) / (y2 - y1); y2 = 0; } /* bottom edge */ if (y1 >= im->sy && y2 >= im->sy) { return; } if (y1 >= im->sy) { x1 -= ((im->sy - y1) * (x1 - x2)) / (y2 - y1); y1 = im->sy - 1; } if (y2 >= im->sy) { x2 -= ((im->sy - y2) * (x1 - x2)) / (y2 - y1); y2 = im->sy - 1; } /* left edge */ if (x1 < 0 && x2 < 0) { return; } if (x1 < 0) { y1 += (x1 * (y1 - y2)) / (x2 - x1); x1 = 0; } if (x2 < 0) { y2 += (x2 * (y1 - y2)) / (x2 - x1); x2 = 0; } /* right edge */ if (x1 >= im->sx && x2 >= im->sx) { return; } if (x1 >= im->sx) { y1 -= ((im->sx - x1) * (y1 - y2)) / (x2 - x1); x1 = im->sx - 1; } if (x2 >= im->sx) { y2 -= ((im->sx - x2) * (y1 - y2)) / (x2 - x1); x2 = im->sx - 1; } dx = x2 - x1; dy = y2 - y1; if (dx == 0 && dy == 0) { return; } if (abs(dx) > abs(dy)) { if (dx < 0) { tmp = x1; x1 = x2; x2 = tmp; tmp = y1; y1 = y2; y2 = tmp; dx = x2 - x1; dy = y2 - y1; } x = x1 << 16; y = y1 << 16; inc = (dy * 65536) / dx; while ((x >> 16) < x2) { gdImageSetAAPixelColor(im, x >> 16, y >> 16, col, (y >> 8) & 0xFF); if ((y >> 16) + 1 < im->sy) { gdImageSetAAPixelColor(im, x >> 16, (y >> 16) + 1,col, (~y >> 8) & 0xFF); } x += (1 << 16); y += inc; } } else { if (dy < 0) { tmp = x1; x1 = x2; x2 = tmp; tmp = y1; y1 = y2; y2 = tmp; dx = x2 - x1; dy = y2 - y1; } x = x1 << 16; y = y1 << 16; inc = (dx * 65536) / dy; while ((y>>16) < y2) { gdImageSetAAPixelColor(im, x >> 16, y >> 16, col, (x >> 8) & 0xFF); if ((x >> 16) + 1 < im->sx) { gdImageSetAAPixelColor(im, (x >> 16) + 1, (y >> 16),col, (~x >> 8) & 0xFF); } x += inc; y += (1<<16); } } } static void dashedSet (gdImagePtr im, int x, int y, int color, int *onP, int *dashStepP, int wid, int vert); void gdImageDashedLine (gdImagePtr im, int x1, int y1, int x2, int y2, int color) { int dx, dy, incr1, incr2, d, x, y, xend, yend, xdirflag, ydirflag; int dashStep = 0; int on = 1; int wid; int vert; int thick = im->thick; dx = abs(x2 - x1); dy = abs(y2 - y1); if (dy <= dx) { /* More-or-less horizontal. use wid for vertical stroke */ /* 2.0.12: Michael Schwartz: divide rather than multiply; TBB: but watch out for /0! */ double as = sin(atan2(dy, dx)); if (as != 0) { wid = thick / as; } else { wid = 1; } wid = (int)(thick * sin(atan2(dy, dx))); vert = 1; d = 2 * dy - dx; incr1 = 2 * dy; incr2 = 2 * (dy - dx); if (x1 > x2) { x = x2; y = y2; ydirflag = (-1); xend = x1; } else { x = x1; y = y1; ydirflag = 1; xend = x2; } dashedSet(im, x, y, color, &on, &dashStep, wid, vert); if (((y2 - y1) * ydirflag) > 0) { while (x < xend) { x++; if (d < 0) { d += incr1; } else { y++; d += incr2; } dashedSet(im, x, y, color, &on, &dashStep, wid, vert); } } else { while (x < xend) { x++; if (d < 0) { d += incr1; } else { y--; d += incr2; } dashedSet(im, x, y, color, &on, &dashStep, wid, vert); } } } else { /* 2.0.12: Michael Schwartz: divide rather than multiply; TBB: but watch out for /0! */ double as = sin (atan2 (dy, dx)); if (as != 0) { wid = thick / as; } else { wid = 1; } vert = 0; d = 2 * dx - dy; incr1 = 2 * dx; incr2 = 2 * (dx - dy); if (y1 > y2) { y = y2; x = x2; yend = y1; xdirflag = (-1); } else { y = y1; x = x1; yend = y2; xdirflag = 1; } dashedSet(im, x, y, color, &on, &dashStep, wid, vert); if (((x2 - x1) * xdirflag) > 0) { while (y < yend) { y++; if (d < 0) { d += incr1; } else { x++; d += incr2; } dashedSet(im, x, y, color, &on, &dashStep, wid, vert); } } else { while (y < yend) { y++; if (d < 0) { d += incr1; } else { x--; d += incr2; } dashedSet(im, x, y, color, &on, &dashStep, wid, vert); } } } } static void dashedSet (gdImagePtr im, int x, int y, int color, int *onP, int *dashStepP, int wid, int vert) { int dashStep = *dashStepP; int on = *onP; int w, wstart; dashStep++; if (dashStep == gdDashSize) { dashStep = 0; on = !on; } if (on) { if (vert) { wstart = y - wid / 2; for (w = wstart; w < wstart + wid; w++) { gdImageSetPixel(im, x, w, color); } } else { wstart = x - wid / 2; for (w = wstart; w < wstart + wid; w++) { gdImageSetPixel(im, w, y, color); } } } *dashStepP = dashStep; *onP = on; } void gdImageChar (gdImagePtr im, gdFontPtr f, int x, int y, int c, int color) { int cx, cy; int px, py; int fline; cx = 0; cy = 0; #ifdef CHARSET_EBCDIC c = ASC (c); #endif /*CHARSET_EBCDIC */ if ((c < f->offset) || (c >= (f->offset + f->nchars))) { return; } fline = (c - f->offset) * f->h * f->w; for (py = y; (py < (y + f->h)); py++) { for (px = x; (px < (x + f->w)); px++) { if (f->data[fline + cy * f->w + cx]) { gdImageSetPixel(im, px, py, color); } cx++; } cx = 0; cy++; } } void gdImageCharUp (gdImagePtr im, gdFontPtr f, int x, int y, int c, int color) { int cx, cy; int px, py; int fline; cx = 0; cy = 0; #ifdef CHARSET_EBCDIC c = ASC (c); #endif /*CHARSET_EBCDIC */ if ((c < f->offset) || (c >= (f->offset + f->nchars))) { return; } fline = (c - f->offset) * f->h * f->w; for (py = y; py > (y - f->w); py--) { for (px = x; px < (x + f->h); px++) { if (f->data[fline + cy * f->w + cx]) { gdImageSetPixel(im, px, py, color); } cy++; } cy = 0; cx++; } } void gdImageString (gdImagePtr im, gdFontPtr f, int x, int y, unsigned char *s, int color) { int i; int l; l = strlen ((char *) s); for (i = 0; (i < l); i++) { gdImageChar(im, f, x, y, s[i], color); x += f->w; } } void gdImageStringUp (gdImagePtr im, gdFontPtr f, int x, int y, unsigned char *s, int color) { int i; int l; l = strlen ((char *) s); for (i = 0; (i < l); i++) { gdImageCharUp(im, f, x, y, s[i], color); y -= f->w; } } static int strlen16 (unsigned short *s); void gdImageString16 (gdImagePtr im, gdFontPtr f, int x, int y, unsigned short *s, int color) { int i; int l; l = strlen16(s); for (i = 0; (i < l); i++) { gdImageChar(im, f, x, y, s[i], color); x += f->w; } } void gdImageStringUp16 (gdImagePtr im, gdFontPtr f, int x, int y, unsigned short *s, int color) { int i; int l; l = strlen16(s); for (i = 0; i < l; i++) { gdImageCharUp(im, f, x, y, s[i], color); y -= f->w; } } static int strlen16 (unsigned short *s) { int len = 0; while (*s) { s++; len++; } return len; } #ifndef HAVE_LSQRT /* If you don't have a nice square root function for longs, you can use ** this hack */ long lsqrt (long n) { long result = (long) sqrt ((double) n); return result; } #endif /* s and e are integers modulo 360 (degrees), with 0 degrees being the rightmost extreme and degrees changing clockwise. cx and cy are the center in pixels; w and h are the horizontal and vertical diameter in pixels. Nice interface, but slow. See gd_arc_f_buggy.c for a better version that doesn't seem to be bug-free yet. */ void gdImageArc (gdImagePtr im, int cx, int cy, int w, int h, int s, int e, int color) { if ((s % 360) == (e % 360)) { gdImageEllipse(im, cx, cy, w, h, color); } else { gdImageFilledArc(im, cx, cy, w, h, s, e, color, gdNoFill); } } void gdImageFilledArc (gdImagePtr im, int cx, int cy, int w, int h, int s, int e, int color, int style) { gdPoint pts[3]; int i; int lx = 0, ly = 0; int fx = 0, fy = 0; if ((s % 360) == (e % 360)) { s = 0; e = 360; } else { if (s > 360) { s = s % 360; } if (e > 360) { e = e % 360; } while (s < 0) { s += 360; } while (e < s) { e += 360; } if (s == e) { s = 0; e = 360; } } for (i = s; i <= e; i++) { int x, y; x = ((long) gdCosT[i % 360] * (long) w / (2 * 1024)) + cx; y = ((long) gdSinT[i % 360] * (long) h / (2 * 1024)) + cy; if (i != s) { if (!(style & gdChord)) { if (style & gdNoFill) { gdImageLine(im, lx, ly, x, y, color); } else { /* This is expensive! */ pts[0].x = lx; pts[0].y = ly; pts[1].x = x; pts[1].y = y; pts[2].x = cx; pts[2].y = cy; gdImageFilledPolygon(im, pts, 3, color); } } } else { fx = x; fy = y; } lx = x; ly = y; } if (style & gdChord) { if (style & gdNoFill) { if (style & gdEdged) { gdImageLine(im, cx, cy, lx, ly, color); gdImageLine(im, cx, cy, fx, fy, color); } gdImageLine(im, fx, fy, lx, ly, color); } else { pts[0].x = fx; pts[0].y = fy; pts[1].x = lx; pts[1].y = ly; pts[2].x = cx; pts[2].y = cy; gdImageFilledPolygon(im, pts, 3, color); } } else { if (style & gdNoFill) { if (style & gdEdged) { gdImageLine(im, cx, cy, lx, ly, color); gdImageLine(im, cx, cy, fx, fy, color); } } } } /** * Integer Ellipse functions (gdImageEllipse and gdImageFilledEllipse) * Function added by Pierre-Alain Joye 02/08/2003 (paj@pearfr.org) * See the ellipse function simplification for the equation * as well as the midpoint algorithm. */ void gdImageEllipse(gdImagePtr im, int mx, int my, int w, int h, int c) { int x=0,mx1=0,mx2=0,my1=0,my2=0; long aq,bq,dx,dy,r,rx,ry,a,b; a=w>>1; b=h>>1; gdImageSetPixel(im,mx+a, my, c); gdImageSetPixel(im,mx-a, my, c); mx1 = mx-a;my1 = my; mx2 = mx+a;my2 = my; aq = a * a; bq = b * b; dx = aq << 1; dy = bq << 1; r = a * bq; rx = r << 1; ry = 0; x = a; while (x > 0){ if (r > 0) { my1++;my2--; ry +=dx; r -=ry; } if (r <= 0){ x--; mx1++;mx2--; rx -=dy; r +=rx; } gdImageSetPixel(im,mx1, my1, c); gdImageSetPixel(im,mx1, my2, c); gdImageSetPixel(im,mx2, my1, c); gdImageSetPixel(im,mx2, my2, c); } } void gdImageFilledEllipse (gdImagePtr im, int mx, int my, int w, int h, int c) { int x=0,mx1=0,mx2=0,my1=0,my2=0; long aq,bq,dx,dy,r,rx,ry,a,b; int i; int old_y1,old_y2; a=w>>1; b=h>>1; gdImageLine(im, mx-a, my, mx+a, my, c); mx1 = mx-a;my1 = my; mx2 = mx+a;my2 = my; aq = a * a; bq = b * b; dx = aq << 1; dy = bq << 1; r = a * bq; rx = r << 1; ry = 0; x = a; old_y2=-2; old_y1=-2; while (x > 0){ if (r > 0) { my1++;my2--; ry +=dx; r -=ry; } if (r <= 0){ x--; mx1++;mx2--; rx -=dy; r +=rx; } if(old_y2!=my2){ for(i=mx1;i<=mx2;i++){ gdImageSetPixel(im,i,my1,c); } } if(old_y2!=my2){ for(i=mx1;i<=mx2;i++){ gdImageSetPixel(im,i,my2,c); } } old_y2 = my2; old_y1 = my1; } } void gdImageFillToBorder (gdImagePtr im, int x, int y, int border, int color) { int lastBorder; /* Seek left */ int leftLimit = -1, rightLimit; int i, restoreAlphaBleding=0; if (border < 0) { /* Refuse to fill to a non-solid border */ return; } if (im->alphaBlendingFlag) { restoreAlphaBleding = 1; im->alphaBlendingFlag = 0; } if (x >= im->sx) { x = im->sx - 1; } if (y >= im->sy) { y = im->sy - 1; } for (i = x; i >= 0; i--) { if (gdImageGetPixel(im, i, y) == border) { break; } gdImageSetPixel(im, i, y, color); leftLimit = i; } if (leftLimit == -1) { if (restoreAlphaBleding) { im->alphaBlendingFlag = 1; } return; } /* Seek right */ rightLimit = x; for (i = (x + 1); i < im->sx; i++) { if (gdImageGetPixel(im, i, y) == border) { break; } gdImageSetPixel(im, i, y, color); rightLimit = i; } /* Look at lines above and below and start paints */ /* Above */ if (y > 0) { lastBorder = 1; for (i = leftLimit; i <= rightLimit; i++) { int c = gdImageGetPixel(im, i, y - 1); if (lastBorder) { if ((c != border) && (c != color)) { gdImageFillToBorder(im, i, y - 1, border, color); lastBorder = 0; } } else if ((c == border) || (c == color)) { lastBorder = 1; } } } /* Below */ if (y < ((im->sy) - 1)) { lastBorder = 1; for (i = leftLimit; i <= rightLimit; i++) { int c = gdImageGetPixel(im, i, y + 1); if (lastBorder) { if ((c != border) && (c != color)) { gdImageFillToBorder(im, i, y + 1, border, color); lastBorder = 0; } } else if ((c == border) || (c == color)) { lastBorder = 1; } } } if (restoreAlphaBleding) { im->alphaBlendingFlag = 1; } } /* * set the pixel at (x,y) and its 4-connected neighbors * with the same pixel value to the new pixel value nc (new color). * A 4-connected neighbor: pixel above, below, left, or right of a pixel. * ideas from comp.graphics discussions. * For tiled fill, the use of a flag buffer is mandatory. As the tile image can * contain the same color as the color to fill. To do not bloat normal filling * code I added a 2nd private function. */ /* horizontal segment of scan line y */ struct seg {int y, xl, xr, dy;}; /* max depth of stack */ #define FILL_MAX 1200000 #define FILL_PUSH(Y, XL, XR, DY) \ if (sp=0 && Y+(DY)y = Y; sp->xl = XL; sp->xr = XR; sp->dy = DY; sp++;} #define FILL_POP(Y, XL, XR, DY) \ {sp--; Y = sp->y+(DY = sp->dy); XL = sp->xl; XR = sp->xr;} void _gdImageFillTiled(gdImagePtr im, int x, int y, int nc); void gdImageFill(gdImagePtr im, int x, int y, int nc) { int l, x1, x2, dy; int oc; /* old pixel value */ int wx2,wy2; int alphablending_bak; /* stack of filled segments */ /* struct seg stack[FILL_MAX],*sp = stack;; */ struct seg *stack; struct seg *sp; alphablending_bak = im->alphaBlendingFlag; im->alphaBlendingFlag = 0; if (nc==gdTiled){ _gdImageFillTiled(im,x,y,nc); im->alphaBlendingFlag = alphablending_bak; return; } wx2=im->sx;wy2=im->sy; oc = gdImageGetPixel(im, x, y); if (oc==nc || x<0 || x>wx2 || y<0 || y>wy2) { im->alphaBlendingFlag = alphablending_bak; return; } stack = (struct seg *)emalloc(sizeof(struct seg) * ((int)(im->sy*im->sx)/4)+1); sp = stack; /* required! */ FILL_PUSH(y,x,x,1); /* seed segment (popped 1st) */ FILL_PUSH(y+1, x, x, -1); while (sp>stack) { FILL_POP(y, x1, x2, dy); for (x=x1; x>=0 && gdImageGetPixel(im,x, y)==oc; x--) { gdImageSetPixel(im,x, y, nc); } if (x>=x1) { goto skip; } l = x+1; /* leak on left? */ if (lx2+1) { FILL_PUSH(y, x2+1, x-1, -dy); } skip: for (x++; x<=x2 && (gdImageGetPixel(im, x, y)!=oc); x++); l = x; } while (x<=x2); } efree(stack); im->alphaBlendingFlag = alphablending_bak; } void _gdImageFillTiled(gdImagePtr im, int x, int y, int nc) { int i,l, x1, x2, dy; int oc; /* old pixel value */ int tiled; int wx2,wy2; /* stack of filled segments */ struct seg *stack; struct seg *sp; int **pts; if(!im->tile){ return; } wx2=im->sx;wy2=im->sy; tiled = nc==gdTiled; nc = gdImageTileGet(im,x,y); pts = (int **) ecalloc(sizeof(int *) * im->sy, sizeof(int)); for (i=0; isy;i++) { pts[i] = (int *) ecalloc(im->sx, sizeof(int)); } stack = (struct seg *)emalloc(sizeof(struct seg) * ((int)(im->sy*im->sx)/4)+1); sp = stack; oc = gdImageGetPixel(im, x, y); /* required! */ FILL_PUSH(y,x,x,1); /* seed segment (popped 1st) */ FILL_PUSH(y+1, x, x, -1); while (sp>stack) { FILL_POP(y, x1, x2, dy); for (x=x1; x>=0 && (!pts[y][x] && gdImageGetPixel(im,x,y)==oc); x--) { if (pts[y][x]){ /* we should never be here */ break; } nc = gdImageTileGet(im,x,y); pts[y][x]=1; gdImageSetPixel(im,x, y, nc); } if (x>=x1) { goto skip; } l = x+1; /* leak on left? */ if (lx2+1) { FILL_PUSH(y, x2+1, x-1, -dy); } skip: for (x++; x<=x2 && (pts[y][x] || gdImageGetPixel(im,x, y)!=oc); x++); l = x; } while (x<=x2); } for (i=0; isy;i++) { efree(pts[i]); } efree(pts); efree(stack); } void gdImageRectangle (gdImagePtr im, int x1, int y1, int x2, int y2, int color) { int x1h = x1, x1v = x1, y1h = y1, y1v = y1, x2h = x2, x2v = x2, y2h = y2, y2v = y2; int thick = im->thick; int half1 = 1; int t; if (y2 < y1) { t=y1; y1 = y2; y2 = t; t = x1; x1 = x2; x2 = t; } x1h = x1; x1v = x1; y1h = y1; y1v = y1; x2h = x2; x2v = x2; y2h = y2; y2v = y2; if (thick > 1) { int cx, cy, x1ul, y1ul, x2lr, y2lr; int half = thick >> 1; half1 = thick - half; x1ul = x1 - half; y1ul = y1 - half; x2lr = x2 + half; y2lr = y2 + half; cy = y1ul + thick; while (cy-- > y1ul) { cx = x1ul - 1; while (cx++ < x2lr) { gdImageSetPixel(im, cx, cy, color); } } cy = y2lr - thick; while (cy++ < y2lr) { cx = x1ul - 1; while (cx++ < x2lr) { gdImageSetPixel(im, cx, cy, color); } } cy = y1ul + thick - 1; while (cy++ < y2lr -thick) { cx = x1ul - 1; while (cx++ < x1ul + thick) { gdImageSetPixel(im, cx, cy, color); } } cy = y1ul + thick - 1; while (cy++ < y2lr -thick) { cx = x2lr - thick - 1; while (cx++ < x2lr) { gdImageSetPixel(im, cx, cy, color); } } return; } else { y1v = y1h + 1; y2v = y2h - 1; gdImageLine(im, x1h, y1h, x2h, y1h, color); gdImageLine(im, x1h, y2h, x2h, y2h, color); gdImageLine(im, x1v, y1v, x1v, y2v, color); gdImageLine(im, x2v, y1v, x2v, y2v, color); } } void gdImageFilledRectangle (gdImagePtr im, int x1, int y1, int x2, int y2, int color) { int x, y; /* Nick Atty: limit the points at the edge. Note that this also * nicely kills any plotting for rectangles completely outside the * window as it makes the tests in the for loops fail */ if (x1 < 0) { x1 = 0; } if (x1 > gdImageSX(im)) { x1 = gdImageSX(im); } if(y1 < 0) { y1 = 0; } if (y1 > gdImageSY(im)) { y1 = gdImageSY(im); } if (y2 < y1) { int t; t=y1; y1 = y2; y2 = t; t = x1; x1 = x2; x2 = t; } for (y = y1; (y <= y2); y++) { for (x = x1; (x <= x2); x++) { gdImageSetPixel (im, x, y, color); } } } void gdImageCopy (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int w, int h) { int c; int x, y; int tox, toy; int i; int colorMap[gdMaxColors]; if (dst->trueColor) { /* 2.0: much easier when the destination is truecolor. */ /* 2.0.10: needs a transparent-index check that is still valid if * the source is not truecolor. Thanks to Frank Warmerdam. */ if (src->trueColor) { for (y = 0; (y < h); y++) { for (x = 0; (x < w); x++) { int c = gdImageGetTrueColorPixel (src, srcX + x, srcY + y); gdImageSetPixel (dst, dstX + x, dstY + y, c); } } } else { /* source is palette based */ for (y = 0; (y < h); y++) { for (x = 0; (x < w); x++) { int c = gdImageGetPixel (src, srcX + x, srcY + y); if (c != src->transparent) { gdImageSetPixel (dst, dstX + x, dstY + y, gdTrueColor(src->red[c], src->green[c], src->blue[c])); } } } } return; } /* Destination is palette based */ if (src->trueColor) { /* But source is truecolor (Ouch!) */ toy = dstY; for (y = srcY; (y < (srcY + h)); y++) { tox = dstX; for (x = srcX; x < (srcX + w); x++) { int nc; c = gdImageGetPixel (src, x, y); /* Get best match possible. */ nc = gdImageColorResolveAlpha(dst, gdTrueColorGetRed(c), gdTrueColorGetGreen(c), gdTrueColorGetBlue(c), gdTrueColorGetAlpha(c)); gdImageSetPixel(dst, tox, toy, nc); tox++; } toy++; } return; } /* Palette based to palette based */ for (i = 0; i < gdMaxColors; i++) { colorMap[i] = (-1); } toy = dstY; for (y = srcY; y < (srcY + h); y++) { tox = dstX; for (x = srcX; x < (srcX + w); x++) { int nc; int mapTo; c = gdImageGetPixel (src, x, y); /* Added 7/24/95: support transparent copies */ if (gdImageGetTransparent (src) == c) { tox++; continue; } /* Have we established a mapping for this color? */ if (src->trueColor) { /* 2.05: remap to the palette available in the destination image. This is slow and * works badly, but it beats crashing! Thanks to Padhrig McCarthy. */ mapTo = gdImageColorResolveAlpha (dst, gdTrueColorGetRed (c), gdTrueColorGetGreen (c), gdTrueColorGetBlue (c), gdTrueColorGetAlpha (c)); } else if (colorMap[c] == (-1)) { /* If it's the same image, mapping is trivial */ if (dst == src) { nc = c; } else { /* Get best match possible. This function never returns error. */ nc = gdImageColorResolveAlpha (dst, src->red[c], src->green[c], src->blue[c], src->alpha[c]); } colorMap[c] = nc; mapTo = colorMap[c]; } else { mapTo = colorMap[c]; } gdImageSetPixel (dst, tox, toy, mapTo); tox++; } toy++; } } /* This function is a substitute for real alpha channel operations, so it doesn't pay attention to the alpha channel. */ void gdImageCopyMerge (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int w, int h, int pct) { int c, dc; int x, y; int tox, toy; int ncR, ncG, ncB; toy = dstY; for (y = srcY; y < (srcY + h); y++) { tox = dstX; for (x = srcX; x < (srcX + w); x++) { int nc; c = gdImageGetPixel(src, x, y); /* Added 7/24/95: support transparent copies */ if (gdImageGetTransparent(src) == c) { tox++; continue; } /* If it's the same image, mapping is trivial */ if (dst == src) { nc = c; } else { dc = gdImageGetPixel(dst, tox, toy); ncR = (int)(gdImageRed (src, c) * (pct / 100.0) + gdImageRed (dst, dc) * ((100 - pct) / 100.0)); ncG = (int)(gdImageGreen (src, c) * (pct / 100.0) + gdImageGreen (dst, dc) * ((100 - pct) / 100.0)); ncB = (int)(gdImageBlue (src, c) * (pct / 100.0) + gdImageBlue (dst, dc) * ((100 - pct) / 100.0)); /* Find a reasonable color */ nc = gdImageColorResolve (dst, ncR, ncG, ncB); } gdImageSetPixel (dst, tox, toy, nc); tox++; } toy++; } } /* This function is a substitute for real alpha channel operations, so it doesn't pay attention to the alpha channel. */ void gdImageCopyMergeGray (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int w, int h, int pct) { int c, dc; int x, y; int tox, toy; int ncR, ncG, ncB; float g; toy = dstY; for (y = srcY; (y < (srcY + h)); y++) { tox = dstX; for (x = srcX; (x < (srcX + w)); x++) { int nc; c = gdImageGetPixel (src, x, y); /* Added 7/24/95: support transparent copies */ if (gdImageGetTransparent(src) == c) { tox++; continue; } /* * If it's the same image, mapping is NOT trivial since we * merge with greyscale target, but if pct is 100, the grey * value is not used, so it becomes trivial. pjw 2.0.12. */ if (dst == src && pct == 100) { nc = c; } else { dc = gdImageGetPixel(dst, tox, toy); g = (0.29900f * gdImageRed(dst, dc)) + (0.58700f * gdImageGreen(dst, dc)) + (0.11400f * gdImageBlue(dst, dc)); ncR = (int)(gdImageRed (src, c) * (pct / 100.0f) + g * ((100 - pct) / 100.0)); ncG = (int)(gdImageGreen (src, c) * (pct / 100.0f) + g * ((100 - pct) / 100.0)); ncB = (int)(gdImageBlue (src, c) * (pct / 100.0f) + g * ((100 - pct) / 100.0)); /* First look for an exact match */ nc = gdImageColorExact(dst, ncR, ncG, ncB); if (nc == (-1)) { /* No, so try to allocate it */ nc = gdImageColorAllocate(dst, ncR, ncG, ncB); /* If we're out of colors, go for the closest color */ if (nc == (-1)) { nc = gdImageColorClosest(dst, ncR, ncG, ncB); } } } gdImageSetPixel(dst, tox, toy, nc); tox++; } toy++; } } void gdImageCopyResized (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int dstW, int dstH, int srcW, int srcH) { int c; int x, y; int tox, toy; int ydest; int i; int colorMap[gdMaxColors]; /* Stretch vectors */ int *stx, *sty; /* We only need to use floating point to determine the correct stretch vector for one line's worth. */ double accum; stx = (int *) safe_emalloc(sizeof(int), srcW, 0); sty = (int *) safe_emalloc(sizeof(int), srcH, 0); accum = 0; /* Fixed by Mao Morimoto 2.0.16 */ for (i = 0; (i < srcW); i++) { stx[i] = dstW * (i+1) / srcW - dstW * i / srcW ; } for (i = 0; (i < srcH); i++) { sty[i] = dstH * (i+1) / srcH - dstH * i / srcH ; } for (i = 0; (i < gdMaxColors); i++) { colorMap[i] = (-1); } toy = dstY; for (y = srcY; (y < (srcY + srcH)); y++) { for (ydest = 0; (ydest < sty[y - srcY]); ydest++) { tox = dstX; for (x = srcX; (x < (srcX + srcW)); x++) { int nc = 0; int mapTo; if (!stx[x - srcX]) { continue; } if (dst->trueColor) { /* 2.0.9: Thorben Kundinger: Maybe the source image is not a truecolor image */ if (!src->trueColor) { int tmp = gdImageGetPixel (src, x, y); mapTo = gdImageGetTrueColorPixel (src, x, y); if (gdImageGetTransparent (src) == tmp) { /* 2.0.21, TK: not tox++ */ tox += stx[x - srcX]; continue; } } else { /* TK: old code follows */ mapTo = gdImageGetTrueColorPixel (src, x, y); /* Added 7/24/95: support transparent copies */ if (gdImageGetTransparent (src) == mapTo) { /* 2.0.21, TK: not tox++ */ tox += stx[x - srcX]; continue; } } } else { c = gdImageGetPixel (src, x, y); /* Added 7/24/95: support transparent copies */ if (gdImageGetTransparent (src) == c) { tox += stx[x - srcX]; continue; } if (src->trueColor) { /* Remap to the palette available in the destination image. This is slow and works badly. */ mapTo = gdImageColorResolveAlpha(dst, gdTrueColorGetRed(c), gdTrueColorGetGreen(c), gdTrueColorGetBlue(c), gdTrueColorGetAlpha (c)); } else { /* Have we established a mapping for this color? */ if (colorMap[c] == (-1)) { /* If it's the same image, mapping is trivial */ if (dst == src) { nc = c; } else { /* Find or create the best match */ /* 2.0.5: can't use gdTrueColorGetRed, etc with palette */ nc = gdImageColorResolveAlpha(dst, gdImageRed(src, c), gdImageGreen(src, c), gdImageBlue(src, c), gdImageAlpha(src, c)); } colorMap[c] = nc; } mapTo = colorMap[c]; } } for (i = 0; (i < stx[x - srcX]); i++) { gdImageSetPixel (dst, tox, toy, mapTo); tox++; } } toy++; } } gdFree (stx); gdFree (sty); } /* When gd 1.x was first created, floating point was to be avoided. These days it is often faster than table lookups or integer arithmetic. The routine below is shamelessly, gloriously floating point. TBB */ void gdImageCopyResampled (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int dstW, int dstH, int srcW, int srcH) { int x, y; double sy1, sy2, sx1, sx2; if (!dst->trueColor) { gdImageCopyResized (dst, src, dstX, dstY, srcX, srcY, dstW, dstH, srcW, srcH); return; } for (y = dstY; (y < dstY + dstH); y++) { sy1 = ((double) y - (double) dstY) * (double) srcH / (double) dstH; sy2 = ((double) (y + 1) - (double) dstY) * (double) srcH / (double) dstH; for (x = dstX; (x < dstX + dstW); x++) { double sx, sy; double spixels = 0; double red = 0.0, green = 0.0, blue = 0.0, alpha = 0.0; double alpha_factor, alpha_sum = 0.0, contrib_sum = 0.0; sx1 = ((double) x - (double) dstX) * (double) srcW / dstW; sx2 = ((double) (x + 1) - (double) dstX) * (double) srcW / dstW; sy = sy1; do { double yportion; if (floor_cast(sy) == floor_cast(sy1)) { yportion = 1.0f - (sy - floor_cast(sy)); if (yportion > sy2 - sy1) { yportion = sy2 - sy1; } sy = floor_cast(sy); } else if (sy == floorf(sy2)) { yportion = sy2 - floor_cast(sy2); } else { yportion = 1.0f; } sx = sx1; do { double xportion; double pcontribution; int p; if (floorf(sx) == floor_cast(sx1)) { xportion = 1.0f - (sx - floor_cast(sx)); if (xportion > sx2 - sx1) { xportion = sx2 - sx1; } sx = floor_cast(sx); } else if (sx == floorf(sx2)) { xportion = sx2 - floor_cast(sx2); } else { xportion = 1.0f; } pcontribution = xportion * yportion; p = gdImageGetTrueColorPixel(src, (int) sx + srcX, (int) sy + srcY); alpha_factor = ((gdAlphaMax - gdTrueColorGetAlpha(p))) * pcontribution; red += gdTrueColorGetRed (p) * alpha_factor; green += gdTrueColorGetGreen (p) * alpha_factor; blue += gdTrueColorGetBlue (p) * alpha_factor; alpha += gdTrueColorGetAlpha (p) * pcontribution; alpha_sum += alpha_factor; contrib_sum += pcontribution; spixels += xportion * yportion; sx += 1.0f; } while (sx < sx2); sy += 1.0f; } while (sy < sy2); if (spixels != 0.0f) { red /= spixels; green /= spixels; blue /= spixels; alpha /= spixels; } if ( alpha_sum != 0.0f) { if( contrib_sum != 0.0f) { alpha_sum /= contrib_sum; } red /= alpha_sum; green /= alpha_sum; blue /= alpha_sum; } /* Clamping to allow for rounding errors above */ if (red > 255.0f) { red = 255.0f; } if (green > 255.0f) { green = 255.0f; } if (blue > 255.0f) { blue = 255.0f; } if (alpha > gdAlphaMax) { alpha = gdAlphaMax; } gdImageSetPixel(dst, x, y, gdTrueColorAlpha ((int) red, (int) green, (int) blue, (int) alpha)); } } } /* * Rotate function Added on 2003/12 * by Pierre-Alain Joye (pajoye@pearfr.org) **/ /* Begin rotate function */ #ifdef ROTATE_PI #undef ROTATE_PI #endif /* ROTATE_PI */ #define ROTATE_DEG2RAD 3.1415926535897932384626433832795/180 void gdImageSkewX (gdImagePtr dst, gdImagePtr src, int uRow, int iOffset, double dWeight, int clrBack) { typedef int (*FuncPtr)(gdImagePtr, int, int); int i, r, g, b, a, clrBackR, clrBackG, clrBackB, clrBackA; FuncPtr f; int pxlOldLeft, pxlLeft=0, pxlSrc; /* Keep clrBack as color index if required */ if (src->trueColor) { pxlOldLeft = clrBack; f = gdImageGetTrueColorPixel; } else { pxlOldLeft = clrBack; clrBackR = gdImageRed(src, clrBack); clrBackG = gdImageGreen(src, clrBack); clrBackB = gdImageBlue(src, clrBack); clrBackA = gdImageAlpha(src, clrBack); clrBack = gdTrueColorAlpha(clrBackR, clrBackG, clrBackB, clrBackA); f = gdImageGetPixel; } for (i = 0; i < iOffset; i++) { gdImageSetPixel (dst, i, uRow, clrBack); } if (i < dst->sx) { gdImageSetPixel (dst, i, uRow, clrBack); } for (i = 0; i < src->sx; i++) { pxlSrc = f (src,i,uRow); r = (int)(gdImageRed(src,pxlSrc) * dWeight); g = (int)(gdImageGreen(src,pxlSrc) * dWeight); b = (int)(gdImageBlue(src,pxlSrc) * dWeight); a = (int)(gdImageAlpha(src,pxlSrc) * dWeight); pxlLeft = gdImageColorAllocateAlpha(src, r, g, b, a); if (pxlLeft == -1) { pxlLeft = gdImageColorClosestAlpha(src, r, g, b, a); } r = gdImageRed(src,pxlSrc) - (gdImageRed(src,pxlLeft) - gdImageRed(src,pxlOldLeft)); g = gdImageGreen(src,pxlSrc) - (gdImageGreen(src,pxlLeft) - gdImageGreen(src,pxlOldLeft)); b = gdImageBlue(src,pxlSrc) - (gdImageBlue(src,pxlLeft) - gdImageBlue(src,pxlOldLeft)); a = gdImageAlpha(src,pxlSrc) - (gdImageAlpha(src,pxlLeft) - gdImageAlpha(src,pxlOldLeft)); if (r>255) { r = 255; } if (g>255) { g = 255; } if (b>255) { b = 255; } if (a>127) { a = 127; } pxlSrc = gdImageColorAllocateAlpha(dst, r, g, b, a); if (pxlSrc == -1) { pxlSrc = gdImageColorClosestAlpha(dst, r, g, b, a); } if ((i + iOffset >= 0) && (i + iOffset < dst->sx)) { gdImageSetPixel (dst, i+iOffset, uRow, pxlSrc); } pxlOldLeft = pxlLeft; } i += iOffset; if (i < dst->sx) { gdImageSetPixel (dst, i, uRow, pxlLeft); } gdImageSetPixel (dst, iOffset, uRow, clrBack); i--; while (++i < dst->sx) { gdImageSetPixel (dst, i, uRow, clrBack); } } void gdImageSkewY (gdImagePtr dst, gdImagePtr src, int uCol, int iOffset, double dWeight, int clrBack) { typedef int (*FuncPtr)(gdImagePtr, int, int); int i, iYPos=0, r, g, b, a; FuncPtr f; int pxlOldLeft, pxlLeft=0, pxlSrc; if (src->trueColor) { f = gdImageGetTrueColorPixel; } else { f = gdImageGetPixel; } for (i = 0; i<=iOffset; i++) { gdImageSetPixel (dst, uCol, i, clrBack); } r = (int)((double)gdImageRed(src,clrBack) * dWeight); g = (int)((double)gdImageGreen(src,clrBack) * dWeight); b = (int)((double)gdImageBlue(src,clrBack) * dWeight); a = (int)((double)gdImageAlpha(src,clrBack) * dWeight); pxlOldLeft = gdImageColorAllocateAlpha(dst, r, g, b, a); for (i = 0; i < src->sy; i++) { pxlSrc = f (src, uCol, i); iYPos = i + iOffset; r = (int)((double)gdImageRed(src,pxlSrc) * dWeight); g = (int)((double)gdImageGreen(src,pxlSrc) * dWeight); b = (int)((double)gdImageBlue(src,pxlSrc) * dWeight); a = (int)((double)gdImageAlpha(src,pxlSrc) * dWeight); pxlLeft = gdImageColorAllocateAlpha(src, r, g, b, a); if (pxlLeft == -1) { pxlLeft = gdImageColorClosestAlpha(src, r, g, b, a); } r = gdImageRed(src,pxlSrc) - (gdImageRed(src,pxlLeft) - gdImageRed(src,pxlOldLeft)); g = gdImageGreen(src,pxlSrc) - (gdImageGreen(src,pxlLeft) - gdImageGreen(src,pxlOldLeft)); b = gdImageBlue(src,pxlSrc) - (gdImageBlue(src,pxlLeft) - gdImageBlue(src,pxlOldLeft)); a = gdImageAlpha(src,pxlSrc) - (gdImageAlpha(src,pxlLeft) - gdImageAlpha(src,pxlOldLeft)); if (r>255) { r = 255; } if (g>255) { g = 255; } if (b>255) { b = 255; } if (a>127) { a = 127; } pxlSrc = gdImageColorAllocateAlpha(dst, r, g, b, a); if (pxlSrc == -1) { pxlSrc = gdImageColorClosestAlpha(dst, r, g, b, a); } if ((iYPos >= 0) && (iYPos < dst->sy)) { gdImageSetPixel (dst, uCol, iYPos, pxlSrc); } pxlOldLeft = pxlLeft; } i = iYPos; if (i < dst->sy) { gdImageSetPixel (dst, uCol, i, pxlLeft); } i--; while (++i < dst->sy) { gdImageSetPixel (dst, uCol, i, clrBack); } } /* Rotates an image by 90 degrees (counter clockwise) */ gdImagePtr gdImageRotate90 (gdImagePtr src) { int uY, uX; int c, r,g,b,a; gdImagePtr dst; typedef int (*FuncPtr)(gdImagePtr, int, int); FuncPtr f; if (src->trueColor) { f = gdImageGetTrueColorPixel; } else { f = gdImageGetPixel; } dst = gdImageCreateTrueColor(src->sy, src->sx); if (dst != NULL) { gdImagePaletteCopy (dst, src); for (uY = 0; uYsy; uY++) { for (uX = 0; uXsx; uX++) { c = f (src, uX, uY); if (!src->trueColor) { r = gdImageRed(src,c); g = gdImageGreen(src,c); b = gdImageBlue(src,c); a = gdImageAlpha(src,c); c = gdTrueColorAlpha(r, g, b, a); } gdImageSetPixel(dst, uY, (dst->sy - uX - 1), c); } } } return dst; } /* Rotates an image by 180 degrees (counter clockwise) */ gdImagePtr gdImageRotate180 (gdImagePtr src) { int uY, uX; int c,r,g,b,a; gdImagePtr dst; typedef int (*FuncPtr)(gdImagePtr, int, int); FuncPtr f; if (src->trueColor) { f = gdImageGetTrueColorPixel; } else { f = gdImageGetPixel; } dst = gdImageCreateTrueColor(src->sx, src->sy); if (dst != NULL) { gdImagePaletteCopy (dst, src); for (uY = 0; uYsy; uY++) { for (uX = 0; uXsx; uX++) { c = f (src, uX, uY); if (!src->trueColor) { r = gdImageRed(src,c); g = gdImageGreen(src,c); b = gdImageBlue(src,c); a = gdImageAlpha(src,c); c = gdTrueColorAlpha(r, g, b, a); } gdImageSetPixel(dst, (dst->sx - uX - 1), (dst->sy - uY - 1), c); } } } return dst; } /* Rotates an image by 270 degrees (counter clockwise) */ gdImagePtr gdImageRotate270 ( gdImagePtr src ) { int uY, uX; int c,r,g,b,a; gdImagePtr dst; typedef int (*FuncPtr)(gdImagePtr, int, int); FuncPtr f; if (src->trueColor) { f = gdImageGetTrueColorPixel; } else { f = gdImageGetPixel; } dst = gdImageCreateTrueColor(src->sy, src->sx); if (dst != NULL) { gdImagePaletteCopy (dst, src); for (uY = 0; uYsy; uY++) { for (uX = 0; uXsx; uX++) { c = f (src, uX, uY); if (!src->trueColor) { r = gdImageRed(src,c); g = gdImageGreen(src,c); b = gdImageBlue(src,c); a = gdImageAlpha(src,c); c = gdTrueColorAlpha(r, g, b, a); } gdImageSetPixel(dst, (dst->sx - uY - 1), uX, c); } } } return dst; } gdImagePtr gdImageRotate45 (gdImagePtr src, double dAngle, int clrBack) { typedef int (*FuncPtr)(gdImagePtr, int, int); gdImagePtr dst1,dst2,dst3; FuncPtr f; double dRadAngle, dSinE, dTan, dShear; double dOffset; /* Variable skew offset */ int u, iShear, newx, newy; int clrBackR, clrBackG, clrBackB, clrBackA; /* See GEMS I for the algorithm details */ dRadAngle = dAngle * ROTATE_DEG2RAD; /* Angle in radians */ dSinE = sin (dRadAngle); dTan = tan (dRadAngle / 2.0); newx = (int)(src->sx + src->sy * fabs(dTan)); newy = src->sy; /* 1st shear */ if (src->trueColor) { f = gdImageGetTrueColorPixel; } else { f = gdImageGetPixel; } dst1 = gdImageCreateTrueColor(newx, newy); /******* Perform 1st shear (horizontal) ******/ if (dst1 == NULL) { return NULL; } dst1->alphaBlendingFlag = gdEffectReplace; if (dAngle == 0.0) { /* Returns copy of src */ gdImageCopy (dst1, src,0,0,0,0,src->sx,src->sy); return dst1; } gdImagePaletteCopy (dst1, src); dRadAngle = dAngle * ROTATE_DEG2RAD; /* Angle in radians */ dSinE = sin (dRadAngle); dTan = tan (dRadAngle / 2.0); for (u = 0; u < dst1->sy; u++) { if (dTan >= 0.0) { dShear = ((double)(u + 0.5)) * dTan; } else { dShear = ((double)(u - dst1->sy) + 0.5) * dTan; } iShear = (int)floor(dShear); gdImageSkewX(dst1, src, u, iShear, (dShear - iShear), clrBack); } /* The 1st shear may use the original clrBack as color index Convert it once here */ if(!src->trueColor) { clrBackR = gdImageRed(src, clrBack); clrBackG = gdImageGreen(src, clrBack); clrBackB = gdImageBlue(src, clrBack); clrBackA = gdImageAlpha(src, clrBack); clrBack = gdTrueColorAlpha(clrBackR, clrBackG, clrBackB, clrBackA); } /* 2nd shear */ newx = dst1->sx; if (dSinE > 0.0) { dOffset = (src->sx-1) * dSinE; } else { dOffset = -dSinE * (src->sx - newx); } newy = (int) ((double) src->sx * fabs( dSinE ) + (double) src->sy * cos (dRadAngle))+1; if (src->trueColor) { f = gdImageGetTrueColorPixel; } else { f = gdImageGetPixel; } dst2 = gdImageCreateTrueColor(newx, newy); if (dst2 == NULL) { gdImageDestroy(dst1); return NULL; } dst2->alphaBlendingFlag = gdEffectReplace; for (u = 0; u < dst2->sx; u++, dOffset -= dSinE) { iShear = (int)floor (dOffset); gdImageSkewY(dst2, dst1, u, iShear, (dOffset - (double)iShear), clrBack); } /* 3rd shear */ gdImageDestroy(dst1); newx = (int) ((double)src->sy * fabs (dSinE) + (double)src->sx * cos (dRadAngle)) + 1; newy = dst2->sy; if (src->trueColor) { f = gdImageGetTrueColorPixel; } else { f = gdImageGetPixel; } dst3 = gdImageCreateTrueColor(newx, newy); if (dst3 == NULL) { gdImageDestroy(dst2); return NULL; } if (dSinE >= 0.0) { dOffset = (double)(src->sx - 1) * dSinE * -dTan; } else { dOffset = dTan * ((double)(src->sx - 1) * -dSinE + (double)(1 - newy)); } for (u = 0; u < dst3->sy; u++, dOffset += dTan) { int iShear = (int)floor(dOffset); gdImageSkewX(dst3, dst2, u, iShear, (dOffset - iShear), clrBack); } gdImageDestroy(dst2); return dst3; } gdImagePtr gdImageRotate (gdImagePtr src, double dAngle, int clrBack) { gdImagePtr pMidImg; gdImagePtr rotatedImg; int r,g,b,a; if (src == NULL) { return NULL; } if (!gdImageTrueColor(src) && clrBack>=gdImageColorsTotal(src)) { return NULL; } while (dAngle >= 360.0) { dAngle -= 360.0; } while (dAngle < 0) { dAngle += 360.0; } if (dAngle == 90.00) { return gdImageRotate90(src); } if (dAngle == 180.00) { return gdImageRotate180(src); } if(dAngle == 270.00) { return gdImageRotate270 ( src); } if ((dAngle > 45.0) && (dAngle <= 135.0)) { pMidImg = gdImageRotate90 (src); dAngle -= 90.0; } else if ((dAngle > 135.0) && (dAngle <= 225.0)) { pMidImg = gdImageRotate180 (src); dAngle -= 180.0; } else if ((dAngle > 225.0) && (dAngle <= 315.0)) { pMidImg = gdImageRotate270 (src); dAngle -= 270.0; } else { return gdImageRotate45 (src, dAngle, clrBack); } if (pMidImg == NULL) { return NULL; } if(!src->trueColor) { r = gdImageRed(src, clrBack); g = gdImageGreen(src, clrBack); b = gdImageBlue(src, clrBack); a = gdImageAlpha(src, clrBack); clrBack = gdTrueColorAlpha(r,g,b,a); } rotatedImg = gdImageRotate45 (pMidImg, dAngle, clrBack); gdImageDestroy(pMidImg); return rotatedImg; } /* End Rotate function */ void gdImagePolygon (gdImagePtr im, gdPointPtr p, int n, int c) { int i; int lx, ly; typedef void (*image_line)(gdImagePtr im, int x1, int y1, int x2, int y2, int color); image_line draw_line; if (!n) { return; } /* Let it be known that we are drawing a polygon so that the opacity * mask doesn't get cleared after each line. */ if (c == gdAntiAliased) { im->AA_polygon = 1; } if ( im->antialias) { draw_line = gdImageAALine; } else { draw_line = gdImageLine; } lx = p->x; ly = p->y; draw_line(im, lx, ly, p[n - 1].x, p[n - 1].y, c); for (i = 1; i < n; i++) { p++; draw_line(im, lx, ly, p->x, p->y, c); lx = p->x; ly = p->y; } if (c == gdAntiAliased) { im->AA_polygon = 0; gdImageAABlend(im); } } int gdCompareInt (const void *a, const void *b); /* THANKS to Kirsten Schulz for the polygon fixes! */ /* The intersection finding technique of this code could be improved * by remembering the previous intertersection, and by using the slope. * That could help to adjust intersections to produce a nice * interior_extrema. */ void gdImageFilledPolygon (gdImagePtr im, gdPointPtr p, int n, int c) { int i; int y; int miny, maxy; int x1, y1; int x2, y2; int ind1, ind2; int ints; int fill_color; if (!n) { return; } if (c == gdAntiAliased) { fill_color = im->AA_color; } else { fill_color = c; } if (!im->polyAllocated) { im->polyInts = (int *) safe_emalloc(sizeof(int), n, 0); im->polyAllocated = n; } if (im->polyAllocated < n) { while (im->polyAllocated < n) { im->polyAllocated *= 2; } im->polyInts = (int *) gdRealloc(im->polyInts, sizeof(int) * im->polyAllocated); } miny = p[0].y; maxy = p[0].y; for (i = 1; i < n; i++) { if (p[i].y < miny) { miny = p[i].y; } if (p[i].y > maxy) { maxy = p[i].y; } } /* 2.0.16: Optimization by Ilia Chipitsine -- don't waste time offscreen */ if (miny < 0) { miny = 0; } if (maxy >= gdImageSY(im)) { maxy = gdImageSY(im) - 1; } /* Fix in 1.3: count a vertex only once */ for (y = miny; y <= maxy; y++) { /*1.4 int interLast = 0; */ /* int dirLast = 0; */ /* int interFirst = 1; */ ints = 0; for (i = 0; i < n; i++) { if (!i) { ind1 = n - 1; ind2 = 0; } else { ind1 = i - 1; ind2 = i; } y1 = p[ind1].y; y2 = p[ind2].y; if (y1 < y2) { x1 = p[ind1].x; x2 = p[ind2].x; } else if (y1 > y2) { y2 = p[ind1].y; y1 = p[ind2].y; x2 = p[ind1].x; x1 = p[ind2].x; } else { continue; } /* Do the following math as float intermediately, and round to ensure * that Polygon and FilledPolygon for the same set of points have the * same footprint. */ if (y >= y1 && y < y2) { im->polyInts[ints++] = (float) ((y - y1) * (x2 - x1)) / (float) (y2 - y1) + 0.5 + x1; } else if (y == maxy && y > y1 && y <= y2) { im->polyInts[ints++] = (float) ((y - y1) * (x2 - x1)) / (float) (y2 - y1) + 0.5 + x1; } } qsort(im->polyInts, ints, sizeof(int), gdCompareInt); for (i = 0; i < ints; i += 2) { gdImageLine(im, im->polyInts[i], y, im->polyInts[i + 1], y, fill_color); } } /* If we are drawing this AA, then redraw the border with AA lines. */ if (c == gdAntiAliased) { gdImagePolygon(im, p, n, c); } } int gdCompareInt (const void *a, const void *b) { return (*(const int *) a) - (*(const int *) b); } void gdImageSetStyle (gdImagePtr im, int *style, int noOfPixels) { if (im->style) { gdFree(im->style); } im->style = (int *) safe_emalloc(sizeof(int), noOfPixels, 0); memcpy(im->style, style, sizeof(int) * noOfPixels); im->styleLength = noOfPixels; im->stylePos = 0; } void gdImageSetThickness (gdImagePtr im, int thickness) { im->thick = thickness; } void gdImageSetBrush (gdImagePtr im, gdImagePtr brush) { int i; im->brush = brush; if (!im->trueColor && !im->brush->trueColor) { for (i = 0; i < gdImageColorsTotal(brush); i++) { int index; index = gdImageColorResolveAlpha(im, gdImageRed(brush, i), gdImageGreen(brush, i), gdImageBlue(brush, i), gdImageAlpha(brush, i)); im->brushColorMap[i] = index; } } } void gdImageSetTile (gdImagePtr im, gdImagePtr tile) { int i; im->tile = tile; if (!im->trueColor && !im->tile->trueColor) { for (i = 0; i < gdImageColorsTotal(tile); i++) { int index; index = gdImageColorResolveAlpha(im, gdImageRed(tile, i), gdImageGreen(tile, i), gdImageBlue(tile, i), gdImageAlpha(tile, i)); im->tileColorMap[i] = index; } } } void gdImageSetAntiAliased (gdImagePtr im, int c) { im->AA = 1; im->AA_color = c; im->AA_dont_blend = -1; } void gdImageSetAntiAliasedDontBlend (gdImagePtr im, int c, int dont_blend) { im->AA = 1; im->AA_color = c; im->AA_dont_blend = dont_blend; } void gdImageInterlace (gdImagePtr im, int interlaceArg) { im->interlace = interlaceArg; } int gdImageCompare (gdImagePtr im1, gdImagePtr im2) { int x, y; int p1, p2; int cmpStatus = 0; int sx, sy; if (im1->interlace != im2->interlace) { cmpStatus |= GD_CMP_INTERLACE; } if (im1->transparent != im2->transparent) { cmpStatus |= GD_CMP_TRANSPARENT; } if (im1->trueColor != im2->trueColor) { cmpStatus |= GD_CMP_TRUECOLOR; } sx = im1->sx; if (im1->sx != im2->sx) { cmpStatus |= GD_CMP_SIZE_X + GD_CMP_IMAGE; if (im2->sx < im1->sx) { sx = im2->sx; } } sy = im1->sy; if (im1->sy != im2->sy) { cmpStatus |= GD_CMP_SIZE_Y + GD_CMP_IMAGE; if (im2->sy < im1->sy) { sy = im2->sy; } } if (im1->colorsTotal != im2->colorsTotal) { cmpStatus |= GD_CMP_NUM_COLORS; } for (y = 0; y < sy; y++) { for (x = 0; x < sx; x++) { p1 = im1->trueColor ? gdImageTrueColorPixel(im1, x, y) : gdImagePalettePixel(im1, x, y); p2 = im2->trueColor ? gdImageTrueColorPixel(im2, x, y) : gdImagePalettePixel(im2, x, y); if (gdImageRed(im1, p1) != gdImageRed(im2, p2)) { cmpStatus |= GD_CMP_COLOR + GD_CMP_IMAGE; break; } if (gdImageGreen(im1, p1) != gdImageGreen(im2, p2)) { cmpStatus |= GD_CMP_COLOR + GD_CMP_IMAGE; break; } if (gdImageBlue(im1, p1) != gdImageBlue(im2, p2)) { cmpStatus |= GD_CMP_COLOR + GD_CMP_IMAGE; break; } #if 0 /* Soon we'll add alpha channel to palettes */ if (gdImageAlpha(im1, p1) != gdImageAlpha(im2, p2)) { cmpStatus |= GD_CMP_COLOR + GD_CMP_IMAGE; break; } #endif } if (cmpStatus & GD_CMP_COLOR) { break; } } return cmpStatus; } int gdAlphaBlend (int dst, int src) { /* 2.0.12: TBB: alpha in the destination should be a * component of the result. Thanks to Frank Warmerdam for * pointing out the issue. */ return ((((gdTrueColorGetAlpha (src) * gdTrueColorGetAlpha (dst)) / gdAlphaMax) << 24) + ((((gdAlphaTransparent - gdTrueColorGetAlpha (src)) * gdTrueColorGetRed (src) / gdAlphaMax) + (gdTrueColorGetAlpha (src) * gdTrueColorGetRed (dst)) / gdAlphaMax) << 16) + ((((gdAlphaTransparent - gdTrueColorGetAlpha (src)) * gdTrueColorGetGreen (src) / gdAlphaMax) + (gdTrueColorGetAlpha (src) * gdTrueColorGetGreen (dst)) / gdAlphaMax) << 8) + (((gdAlphaTransparent - gdTrueColorGetAlpha (src)) * gdTrueColorGetBlue (src) / gdAlphaMax) + (gdTrueColorGetAlpha (src) * gdTrueColorGetBlue (dst)) / gdAlphaMax)); } void gdImageAlphaBlending (gdImagePtr im, int alphaBlendingArg) { im->alphaBlendingFlag = alphaBlendingArg; } void gdImageAntialias (gdImagePtr im, int antialias) { if (im->trueColor){ im->antialias = antialias; } } void gdImageSaveAlpha (gdImagePtr im, int saveAlphaArg) { im->saveAlphaFlag = saveAlphaArg; } static int gdFullAlphaBlend (int dst, int src) { int a1, a2; a1 = gdAlphaTransparent - gdTrueColorGetAlpha(src); a2 = gdAlphaTransparent - gdTrueColorGetAlpha(dst); return ( ((gdAlphaTransparent - ((a1+a2)-(a1*a2/gdAlphaMax))) << 24) + (gdAlphaBlendColor( gdTrueColorGetRed(src), gdTrueColorGetRed(dst), a1, a2 ) << 16) + (gdAlphaBlendColor( gdTrueColorGetGreen(src), gdTrueColorGetGreen(dst), a1, a2 ) << 8) + (gdAlphaBlendColor( gdTrueColorGetBlue(src), gdTrueColorGetBlue(dst), a1, a2 )) ); } static int gdAlphaBlendColor( int b1, int b2, int a1, int a2 ) { int c; int w; /* deal with special cases */ if( (gdAlphaMax == a1) || (0 == a2) ) { /* the back pixel can't be seen */ return b1; } else if(0 == a1) { /* the front pixel can't be seen */ return b2; } else if(gdAlphaMax == a2) { /* the back pixel is opaque */ return ( a1 * b1 + ( gdAlphaMax - a1 ) * b2 ) / gdAlphaMax; } /* the general case */ w = ( a1 * ( gdAlphaMax - a2 ) / ( gdAlphaMax - a1 * a2 / gdAlphaMax ) * b1 + \ a2 * ( gdAlphaMax - a1 ) / ( gdAlphaMax - a1 * a2 / gdAlphaMax ) * b2 ) / gdAlphaMax; c = (a2 * b2 + ( gdAlphaMax - a2 ) * w ) / gdAlphaMax; return ( a1 * b1 + ( gdAlphaMax - a1 ) * c ) / gdAlphaMax; } static int gdLayerOverlay (int dst, int src) { int a1, a2; a1 = gdAlphaMax - gdTrueColorGetAlpha(dst); a2 = gdAlphaMax - gdTrueColorGetAlpha(src); return ( ((gdAlphaMax - a1*a2/gdAlphaMax) << 24) + (gdAlphaOverlayColor( gdTrueColorGetRed(src), gdTrueColorGetRed(dst), gdRedMax ) << 16) + (gdAlphaOverlayColor( gdTrueColorGetGreen(src), gdTrueColorGetGreen(dst), gdGreenMax ) << 8) + (gdAlphaOverlayColor( gdTrueColorGetBlue(src), gdTrueColorGetBlue(dst), gdBlueMax )) ); } static int gdAlphaOverlayColor (int src, int dst, int max ) { /* this function implements the algorithm * * for dst[rgb] < 0.5, * c[rgb] = 2.src[rgb].dst[rgb] * and for dst[rgb] > 0.5, * c[rgb] = -2.src[rgb].dst[rgb] + 2.dst[rgb] + 2.src[rgb] - 1 * */ dst = dst << 1; if( dst > max ) { /* in the "light" zone */ return dst + (src << 1) - (dst * src / max) - max; } else { /* in the "dark" zone */ return dst * src / max; } } void gdImageSetClip (gdImagePtr im, int x1, int y1, int x2, int y2) { if (x1 < 0) { x1 = 0; } if (x1 >= im->sx) { x1 = im->sx - 1; } if (x2 < 0) { x2 = 0; } if (x2 >= im->sx) { x2 = im->sx - 1; } if (y1 < 0) { y1 = 0; } if (y1 >= im->sy) { y1 = im->sy - 1; } if (y2 < 0) { y2 = 0; } if (y2 >= im->sy) { y2 = im->sy - 1; } im->cx1 = x1; im->cy1 = y1; im->cx2 = x2; im->cy2 = y2; } void gdImageGetClip (gdImagePtr im, int *x1P, int *y1P, int *x2P, int *y2P) { *x1P = im->cx1; *y1P = im->cy1; *x2P = im->cx2; *y2P = im->cy2; } php-4.4.8/ext/gd/libgd/gd.h0000644000175000017500000006070710100044444014621 0ustar derickderick#ifndef GD_H #define GD_H 1 #ifdef __cplusplus extern "C" { #endif #ifndef WIN32 /* default fontpath for unix systems */ #define DEFAULT_FONTPATH "/usr/X11R6/lib/X11/fonts/TrueType:/usr/X11R6/lib/X11/fonts/truetype:/usr/X11R6/lib/X11/fonts/TTF:/usr/share/fonts/TrueType:/usr/share/fonts/truetype:/usr/openwin/lib/X11/fonts/TrueType:/usr/X11R6/lib/X11/fonts/Type1:." #define PATHSEPARATOR ":" #else /* default fontpath for windows systems */ #define DEFAULT_FONTPATH "c:\\winnt\\fonts;c:\\windows\\fonts;." #define PATHSEPARATOR ";" #endif /* gd.h: declarations file for the graphic-draw module. * 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 appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation. This software is provided "AS IS." Thomas Boutell and * Boutell.Com, Inc. disclaim all warranties, either express or implied, * including but not limited to implied warranties of merchantability and * fitness for a particular purpose, with respect to this code and accompanying * documentation. */ /* stdio is needed for file I/O. */ #include #include "gd_io.h" void php_gd_error_ex(int type, const char *format, ...); void php_gd_error(const char *format, ...); /* The maximum number of palette entries in palette-based images. In the wonderful new world of gd 2.0, you can of course have many more colors when using truecolor mode. */ #define gdMaxColors 256 /* Image type. See functions below; you will not need to change the elements directly. Use the provided macros to access sx, sy, the color table, and colorsTotal for read-only purposes. */ /* If 'truecolor' is set true, the image is truecolor; pixels are represented by integers, which must be 32 bits wide or more. True colors are repsented as follows: ARGB Where 'A' (alpha channel) occupies only the LOWER 7 BITS of the MSB. This very small loss of alpha channel resolution allows gd 2.x to keep backwards compatibility by allowing signed integers to be used to represent colors, and negative numbers to represent special cases, just as in gd 1.x. */ #define gdAlphaMax 127 #define gdAlphaOpaque 0 #define gdAlphaTransparent 127 #define gdRedMax 255 #define gdGreenMax 255 #define gdBlueMax 255 #define gdTrueColorGetAlpha(c) (((c) & 0x7F000000) >> 24) #define gdTrueColorGetRed(c) (((c) & 0xFF0000) >> 16) #define gdTrueColorGetGreen(c) (((c) & 0x00FF00) >> 8) #define gdTrueColorGetBlue(c) ((c) & 0x0000FF) #define gdEffectReplace 0 #define gdEffectAlphaBlend 1 #define gdEffectNormal 2 #define gdEffectOverlay 3 /* This function accepts truecolor pixel values only. The source color is composited with the destination color based on the alpha channel value of the source color. The resulting color is opaque. */ int gdAlphaBlend(int dest, int src); typedef struct gdImageStruct { /* Palette-based image pixels */ unsigned char ** pixels; int sx; int sy; /* These are valid in palette images only. See also 'alpha', which appears later in the structure to preserve binary backwards compatibility */ int colorsTotal; int red[gdMaxColors]; int green[gdMaxColors]; int blue[gdMaxColors]; int open[gdMaxColors]; /* For backwards compatibility, this is set to the first palette entry with 100% transparency, and is also set and reset by the gdImageColorTransparent function. Newer applications can allocate palette entries with any desired level of transparency; however, bear in mind that many viewers, notably many web browsers, fail to implement full alpha channel for PNG and provide support for full opacity or transparency only. */ int transparent; int *polyInts; int polyAllocated; struct gdImageStruct *brush; struct gdImageStruct *tile; int brushColorMap[gdMaxColors]; int tileColorMap[gdMaxColors]; int styleLength; int stylePos; int *style; int interlace; /* New in 2.0: thickness of line. Initialized to 1. */ int thick; /* New in 2.0: alpha channel for palettes. Note that only Macintosh Internet Explorer and (possibly) Netscape 6 really support multiple levels of transparency in palettes, to my knowledge, as of 2/15/01. Most common browsers will display 100% opaque and 100% transparent correctly, and do something unpredictable and/or undesirable for levels in between. TBB */ int alpha[gdMaxColors]; /* Truecolor flag and pixels. New 2.0 fields appear here at the end to minimize breakage of existing object code. */ int trueColor; int ** tpixels; /* Should alpha channel be copied, or applied, each time a pixel is drawn? This applies to truecolor images only. No attempt is made to alpha-blend in palette images, even if semitransparent palette entries exist. To do that, build your image as a truecolor image, then quantize down to 8 bits. */ int alphaBlendingFlag; /* Should antialias functions be used */ int antialias; /* Should the alpha channel of the image be saved? This affects PNG at the moment; other future formats may also have that capability. JPEG doesn't. */ int saveAlphaFlag; /* 2.0.12: anti-aliased globals */ int AA; int AA_color; int AA_dont_blend; unsigned char **AA_opacity; int AA_polygon; /* Stored and pre-computed variables for determining the perpendicular * distance from a point to the anti-aliased line being drawn: */ int AAL_x1; int AAL_y1; int AAL_x2; int AAL_y2; int AAL_Bx_Ax; int AAL_By_Ay; int AAL_LAB_2; float AAL_LAB; /* 2.0.12: simple clipping rectangle. These values must be checked for safety when set; please use gdImageSetClip */ int cx1; int cy1; int cx2; int cy2; } gdImage; typedef gdImage * gdImagePtr; typedef struct { /* # of characters in font */ int nchars; /* First character is numbered... (usually 32 = space) */ int offset; /* Character width and height */ int w; int h; /* Font data; array of characters, one row after another. Easily included in code, also easily loaded from data files. */ char *data; } gdFont; /* Text functions take these. */ typedef gdFont *gdFontPtr; /* For backwards compatibility only. Use gdImageSetStyle() for MUCH more flexible line drawing. Also see gdImageSetBrush(). */ #define gdDashSize 4 /* Special colors. */ #define gdStyled (-2) #define gdBrushed (-3) #define gdStyledBrushed (-4) #define gdTiled (-5) /* NOT the same as the transparent color index. This is used in line styles only. */ #define gdTransparent (-6) #define gdAntiAliased (-7) /* Functions to manipulate images. */ /* Creates a palette-based image (up to 256 colors). */ gdImagePtr gdImageCreate(int sx, int sy); /* An alternate name for the above (2.0). */ #define gdImageCreatePalette gdImageCreate /* Creates a truecolor image (millions of colors). */ gdImagePtr gdImageCreateTrueColor(int sx, int sy); /* Creates an image from various file types. These functions return a palette or truecolor image based on the nature of the file being loaded. Truecolor PNG stays truecolor; palette PNG stays palette-based; JPEG is always truecolor. */ gdImagePtr gdImageCreateFromPng(FILE *fd); gdImagePtr gdImageCreateFromPngCtx(gdIOCtxPtr in); gdImagePtr gdImageCreateFromWBMP(FILE *inFile); gdImagePtr gdImageCreateFromWBMPCtx(gdIOCtx *infile); gdImagePtr gdImageCreateFromJpeg(FILE *infile); gdImagePtr gdImageCreateFromJpegCtx(gdIOCtx *infile); /* A custom data source. */ /* The source function must return -1 on error, otherwise the number of bytes fetched. 0 is EOF, not an error! */ /* context will be passed to your source function. */ typedef struct { int (*source) (void *context, char *buffer, int len); void *context; } gdSource, *gdSourcePtr; gdImagePtr gdImageCreateFromPngSource(gdSourcePtr in); gdImagePtr gdImageCreateFromGd(FILE *in); gdImagePtr gdImageCreateFromGdCtx(gdIOCtxPtr in); gdImagePtr gdImageCreateFromGd2(FILE *in); gdImagePtr gdImageCreateFromGd2Ctx(gdIOCtxPtr in); gdImagePtr gdImageCreateFromGd2Part(FILE *in, int srcx, int srcy, int w, int h); gdImagePtr gdImageCreateFromGd2PartCtx(gdIOCtxPtr in, int srcx, int srcy, int w, int h); gdImagePtr gdImageCreateFromXbm(FILE *fd); void gdImageXbmCtx(gdImagePtr image, char* file_name, int fg, gdIOCtx * out); gdImagePtr gdImageCreateFromXpm (char *filename); void gdImageDestroy(gdImagePtr im); /* Replaces or blends with the background depending on the most recent call to gdImageAlphaBlending and the alpha channel value of 'color'; default is to overwrite. Tiling and line styling are also implemented here. All other gd drawing functions pass through this call, allowing for many useful effects. */ void gdImageSetPixel(gdImagePtr im, int x, int y, int color); int gdImageGetPixel(gdImagePtr im, int x, int y); void gdImageAABlend(gdImagePtr im); void gdImageLine(gdImagePtr im, int x1, int y1, int x2, int y2, int color); void gdImageAALine(gdImagePtr im, int x1, int y1, int x2, int y2, int color); /* For backwards compatibility only. Use gdImageSetStyle() for much more flexible line drawing. */ void gdImageDashedLine(gdImagePtr im, int x1, int y1, int x2, int y2, int color); /* Corners specified (not width and height). Upper left first, lower right second. */ void gdImageRectangle(gdImagePtr im, int x1, int y1, int x2, int y2, int color); /* Solid bar. Upper left corner first, lower right corner second. */ void gdImageFilledRectangle(gdImagePtr im, int x1, int y1, int x2, int y2, int color); void gdImageSetClip(gdImagePtr im, int x1, int y1, int x2, int y2); void gdImageGetClip(gdImagePtr im, int *x1P, int *y1P, int *x2P, int *y2P); void gdImageChar(gdImagePtr im, gdFontPtr f, int x, int y, int c, int color); void gdImageCharUp(gdImagePtr im, gdFontPtr f, int x, int y, int c, int color); void gdImageString(gdImagePtr im, gdFontPtr f, int x, int y, unsigned char *s, int color); void gdImageStringUp(gdImagePtr im, gdFontPtr f, int x, int y, unsigned char *s, int color); void gdImageString16(gdImagePtr im, gdFontPtr f, int x, int y, unsigned short *s, int color); void gdImageStringUp16(gdImagePtr im, gdFontPtr f, int x, int y, unsigned short *s, int color); /* 2.0.16: for thread-safe use of gdImageStringFT and friends, * call this before allowing any thread to call gdImageStringFT. * Otherwise it is invoked by the first thread to invoke * gdImageStringFT, with a very small but real risk of a race condition. * Return 0 on success, nonzero on failure to initialize freetype. */ int gdFontCacheSetup(void); /* Optional: clean up after application is done using fonts in gdImageStringFT(). */ void gdFontCacheShutdown(void); /* Calls gdImageStringFT. Provided for backwards compatibility only. */ char *gdImageStringTTF(gdImage *im, int *brect, int fg, char *fontlist, double ptsize, double angle, int x, int y, char *string); /* FreeType 2 text output */ char *gdImageStringFT(gdImage *im, int *brect, int fg, char *fontlist, double ptsize, double angle, int x, int y, char *string); typedef struct { double linespacing; /* fine tune line spacing for '\n' */ int flags; /* Logical OR of gdFTEX_ values */ int charmap; /* TBB: 2.0.12: may be gdFTEX_Unicode, gdFTEX_Shift_JIS, or gdFTEX_Big5; when not specified, maps are searched for in the above order. */ int hdpi; int vdpi; } gdFTStringExtra, *gdFTStringExtraPtr; #define gdFTEX_LINESPACE 1 #define gdFTEX_CHARMAP 2 #define gdFTEX_RESOLUTION 4 /* These are NOT flags; set one in 'charmap' if you set the gdFTEX_CHARMAP bit in 'flags'. */ #define gdFTEX_Unicode 0 #define gdFTEX_Shift_JIS 1 #define gdFTEX_Big5 2 /* FreeType 2 text output with fine tuning */ char * gdImageStringFTEx(gdImage * im, int *brect, int fg, char * fontlist, double ptsize, double angle, int x, int y, char * string, gdFTStringExtraPtr strex); /* Point type for use in polygon drawing. */ typedef struct { int x, y; } gdPoint, *gdPointPtr; void gdImagePolygon(gdImagePtr im, gdPointPtr p, int n, int c); void gdImageFilledPolygon(gdImagePtr im, gdPointPtr p, int n, int c); /* These functions still work with truecolor images, for which they never return error. */ int gdImageColorAllocate(gdImagePtr im, int r, int g, int b); /* gd 2.0: palette entries with non-opaque transparency are permitted. */ int gdImageColorAllocateAlpha(gdImagePtr im, int r, int g, int b, int a); /* Assumes opaque is the preferred alpha channel value */ int gdImageColorClosest(gdImagePtr im, int r, int g, int b); /* Closest match taking all four parameters into account. A slightly different color with the same transparency beats the exact same color with radically different transparency */ int gdImageColorClosestAlpha(gdImagePtr im, int r, int g, int b, int a); /* An alternate method */ int gdImageColorClosestHWB(gdImagePtr im, int r, int g, int b); /* Returns exact, 100% opaque matches only */ int gdImageColorExact(gdImagePtr im, int r, int g, int b); /* Returns an exact match only, including alpha */ int gdImageColorExactAlpha(gdImagePtr im, int r, int g, int b, int a); /* Opaque only */ int gdImageColorResolve(gdImagePtr im, int r, int g, int b); /* Based on gdImageColorExactAlpha and gdImageColorClosestAlpha */ int gdImageColorResolveAlpha(gdImagePtr im, int r, int g, int b, int a); /* A simpler way to obtain an opaque truecolor value for drawing on a truecolor image. Not for use with palette images! */ #define gdTrueColor(r, g, b) (((r) << 16) + \ ((g) << 8) + \ (b)) /* Returns a truecolor value with an alpha channel component. gdAlphaMax (127, **NOT 255**) is transparent, 0 is completely opaque. */ #define gdTrueColorAlpha(r, g, b, a) (((a) << 24) + \ ((r) << 16) + \ ((g) << 8) + \ (b)) void gdImageColorDeallocate(gdImagePtr im, int color); /* Converts a truecolor image to a palette-based image, using a high-quality two-pass quantization routine which attempts to preserve alpha channel information as well as R/G/B color information when creating a palette. If ditherFlag is set, the image will be dithered to approximate colors better, at the expense of some obvious "speckling." colorsWanted can be anything up to 256. If the original source image includes photographic information or anything that came out of a JPEG, 256 is strongly recommended. Better yet, don't use this function -- write real truecolor PNGs and JPEGs. The disk space gain of conversion to palette is not great (for small images it can be negative) and the quality loss is ugly. */ gdImagePtr gdImageCreatePaletteFromTrueColor (gdImagePtr im, int ditherFlag, int colorsWanted); void gdImageTrueColorToPalette(gdImagePtr im, int ditherFlag, int colorsWanted); /* An attempt at getting the results of gdImageTrueColorToPalette to look a bit more like the original (im1 is the original and im2 is the palette version */ int gdImageColorMatch(gdImagePtr im1, gdImagePtr im2); /* Specifies a color index (if a palette image) or an RGB color (if a truecolor image) which should be considered 100% transparent. FOR TRUECOLOR IMAGES, THIS IS IGNORED IF AN ALPHA CHANNEL IS BEING SAVED. Use gdImageSaveAlpha(im, 0); to turn off the saving of a full alpha channel in a truecolor image. Note that gdImageColorTransparent is usually compatible with older browsers that do not understand full alpha channels well. TBB */ void gdImageColorTransparent(gdImagePtr im, int color); void gdImagePaletteCopy(gdImagePtr dst, gdImagePtr src); void gdImagePng(gdImagePtr im, FILE *out); void gdImagePngCtx(gdImagePtr im, gdIOCtx *out); void gdImageGif(gdImagePtr im, FILE *out); void gdImageGifCtx(gdImagePtr im, gdIOCtx *out); /* 2.0.12: Compression level: 0-9 or -1, where 0 is NO COMPRESSION at all, * 1 is FASTEST but produces larger files, 9 provides the best * compression (smallest files) but takes a long time to compress, and * -1 selects the default compiled into the zlib library. */ void gdImagePngEx(gdImagePtr im, FILE * out, int level); void gdImagePngCtxEx(gdImagePtr im, gdIOCtx * out, int level); void gdImageWBMP(gdImagePtr image, int fg, FILE *out); void gdImageWBMPCtx(gdImagePtr image, int fg, gdIOCtx *out); /* Guaranteed to correctly free memory returned by the gdImage*Ptr functions */ void gdFree(void *m); /* Best to free this memory with gdFree(), not free() */ void *gdImageWBMPPtr(gdImagePtr im, int *size, int fg); /* 100 is highest quality (there is always a little loss with JPEG). 0 is lowest. 10 is about the lowest useful setting. */ void gdImageJpeg(gdImagePtr im, FILE *out, int quality); void gdImageJpegCtx(gdImagePtr im, gdIOCtx *out, int quality); /* Best to free this memory with gdFree(), not free() */ void *gdImageJpegPtr(gdImagePtr im, int *size, int quality); gdImagePtr gdImageCreateFromGif(FILE *fd); gdImagePtr gdImageCreateFromGifCtx(gdIOCtxPtr in); gdImagePtr gdImageCreateFromGifSource(gdSourcePtr in); /* A custom data sink. For backwards compatibility. Use gdIOCtx instead. */ /* The sink function must return -1 on error, otherwise the number of bytes written, which must be equal to len. */ /* context will be passed to your sink function. */ typedef struct { int (*sink) (void *context, const char *buffer, int len); void *context; } gdSink, *gdSinkPtr; void gdImagePngToSink(gdImagePtr im, gdSinkPtr out); void gdImageGd(gdImagePtr im, FILE *out); void gdImageGd2(gdImagePtr im, FILE *out, int cs, int fmt); /* Best to free this memory with gdFree(), not free() */ void* gdImagePngPtr(gdImagePtr im, int *size); /* Best to free this memory with gdFree(), not free() */ void* gdImageGdPtr(gdImagePtr im, int *size); void *gdImagePngPtrEx(gdImagePtr im, int *size, int level); /* Best to free this memory with gdFree(), not free() */ void* gdImageGd2Ptr(gdImagePtr im, int cs, int fmt, int *size); void gdImageEllipse(gdImagePtr im, int cx, int cy, int w, int h, int c); /* Style is a bitwise OR ( | operator ) of these. gdArc and gdChord are mutually exclusive; gdChord just connects the starting and ending angles with a straight line, while gdArc produces a rounded edge. gdPie is a synonym for gdArc. gdNoFill indicates that the arc or chord should be outlined, not filled. gdEdged, used together with gdNoFill, indicates that the beginning and ending angles should be connected to the center; this is a good way to outline (rather than fill) a 'pie slice'. */ #define gdArc 0 #define gdPie gdArc #define gdChord 1 #define gdNoFill 2 #define gdEdged 4 void gdImageFilledArc(gdImagePtr im, int cx, int cy, int w, int h, int s, int e, int color, int style); void gdImageArc(gdImagePtr im, int cx, int cy, int w, int h, int s, int e, int color); void gdImageFilledEllipse(gdImagePtr im, int cx, int cy, int w, int h, int color); void gdImageFillToBorder(gdImagePtr im, int x, int y, int border, int color); void gdImageFill(gdImagePtr im, int x, int y, int color); void gdImageCopy(gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int w, int h); void gdImageCopyMerge(gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int w, int h, int pct); void gdImageCopyMergeGray(gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int w, int h, int pct); /* Stretches or shrinks to fit, as needed. Does NOT attempt to average the entire set of source pixels that scale down onto the destination pixel. */ void gdImageCopyResized(gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int dstW, int dstH, int srcW, int srcH); /* gd 2.0: stretches or shrinks to fit, as needed. When called with a truecolor destination image, this function averages the entire set of source pixels that scale down onto the destination pixel, taking into account what portion of the destination pixel each source pixel represents. This is a floating point operation, but this is not a performance issue on modern hardware, except for some embedded devices. If the destination is a palette image, gdImageCopyResized is substituted automatically. */ void gdImageCopyResampled(gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int dstW, int dstH, int srcW, int srcH); gdImagePtr gdImageRotate90(gdImagePtr src); gdImagePtr gdImageRotate180(gdImagePtr src); gdImagePtr gdImageRotate270(gdImagePtr src); gdImagePtr gdImageRotate45(gdImagePtr src, double dAngle, int clrBack); gdImagePtr gdImageRotate (gdImagePtr src, double dAngle, int clrBack); void gdImageSetBrush(gdImagePtr im, gdImagePtr brush); void gdImageSetTile(gdImagePtr im, gdImagePtr tile); void gdImageSetAntiAliased(gdImagePtr im, int c); void gdImageSetAntiAliasedDontBlend(gdImagePtr im, int c, int dont_blend); void gdImageSetStyle(gdImagePtr im, int *style, int noOfPixels); /* Line thickness (defaults to 1). Affects lines, ellipses, rectangles, polygons and so forth. */ void gdImageSetThickness(gdImagePtr im, int thickness); /* On or off (1 or 0) for all three of these. */ void gdImageInterlace(gdImagePtr im, int interlaceArg); void gdImageAlphaBlending(gdImagePtr im, int alphaBlendingArg); void gdImageAntialias(gdImagePtr im, int antialias); void gdImageSaveAlpha(gdImagePtr im, int saveAlphaArg); /* Macros to access information about images. */ /* Returns nonzero if the image is a truecolor image, zero for a palette image. */ #define gdImageTrueColor(im) ((im)->trueColor) #define gdImageSX(im) ((im)->sx) #define gdImageSY(im) ((im)->sy) #define gdImageColorsTotal(im) ((im)->colorsTotal) #define gdImageRed(im, c) ((im)->trueColor ? gdTrueColorGetRed(c) : \ (im)->red[(c)]) #define gdImageGreen(im, c) ((im)->trueColor ? gdTrueColorGetGreen(c) : \ (im)->green[(c)]) #define gdImageBlue(im, c) ((im)->trueColor ? gdTrueColorGetBlue(c) : \ (im)->blue[(c)]) #define gdImageAlpha(im, c) ((im)->trueColor ? gdTrueColorGetAlpha(c) : \ (im)->alpha[(c)]) #define gdImageGetTransparent(im) ((im)->transparent) #define gdImageGetInterlaced(im) ((im)->interlace) /* These macros provide direct access to pixels in palette-based and truecolor images, respectively. If you use these macros, you must perform your own bounds checking. Use of the macro for the correct type of image is also your responsibility. */ #define gdImagePalettePixel(im, x, y) (im)->pixels[(y)][(x)] #define gdImageTrueColorPixel(im, x, y) (im)->tpixels[(y)][(x)] /* I/O Support routines. */ gdIOCtx* gdNewFileCtx(FILE*); gdIOCtx* gdNewDynamicCtx(int, void*); gdIOCtx *gdNewDynamicCtxEx(int size, void *data, int freeFlag); gdIOCtx* gdNewSSCtx(gdSourcePtr in, gdSinkPtr out); void* gdDPExtractData(struct gdIOCtx* ctx, int *size); #define GD2_CHUNKSIZE 128 #define GD2_CHUNKSIZE_MIN 64 #define GD2_CHUNKSIZE_MAX 4096 #define GD2_VERS 2 #define GD2_ID "gd2" #define GD2_FMT_RAW 1 #define GD2_FMT_COMPRESSED 2 /* filters section * * Negate the imag src, white becomes black, * The red, green, and blue intensities of an image are negated. * White becomes black, yellow becomes blue, etc. */ int gdImageNegate(gdImagePtr src); /* Convert the image src to a grayscale image */ int gdImageGrayScale(gdImagePtr src); /* Set the brightness level for the image src */ int gdImageBrightness(gdImagePtr src, int brightness); /* Set the contrast level for the image */ int gdImageContrast(gdImagePtr src, double contrast); /* Simply adds or substracts respectively red, green or blue to a pixel */ int gdImageColor(gdImagePtr src, int red, int green, int blue); /* Image convolution by a 3x3 custom matrix */ int gdImageConvolution(gdImagePtr src, float ft[3][3], float filter_div, float offset); int gdImageEdgeDetectQuick(gdImagePtr src); int gdImageGaussianBlur(gdImagePtr im); int gdImageSelectiveBlur( gdImagePtr src); int gdImageEmboss(gdImagePtr im); int gdImageMeanRemoval(gdImagePtr im); int gdImageSmooth(gdImagePtr im, float weight); /* Image comparison definitions */ int gdImageCompare(gdImagePtr im1, gdImagePtr im2); #define GD_CMP_IMAGE 1 /* Actual image IS different */ #define GD_CMP_NUM_COLORS 2 /* Number of Colours in pallette differ */ #define GD_CMP_COLOR 4 /* Image colours differ */ #define GD_CMP_SIZE_X 8 /* Image width differs */ #define GD_CMP_SIZE_Y 16 /* Image heights differ */ #define GD_CMP_TRANSPARENT 32 /* Transparent colour */ #define GD_CMP_BACKGROUND 64 /* Background colour */ #define GD_CMP_INTERLACE 128 /* Interlaced setting */ #define GD_CMP_TRUECOLOR 256 /* Truecolor vs palette differs */ /* resolution affects ttf font rendering, particularly hinting */ #define GD_RESOLUTION 96 /* pixels per inch */ #ifdef __cplusplus } #endif /* 2.0.12: this now checks the clipping rectangle */ #define gdImageBoundsSafe(im, x, y) (!((((y) < (im)->cy1) || ((y) > (im)->cy2)) || (((x) < (im)->cx1) || ((x) > (im)->cx2)))) #endif /* GD_H */ php-4.4.8/ext/gd/libgd/gdtables.c0000644000175000017500000001256207455710735016031 0ustar derickderick int gdCosT[] = { 1024, 1023, 1023, 1022, 1021, 1020, 1018, 1016, 1014, 1011, 1008, 1005, 1001, 997, 993, 989, 984, 979, 973, 968, 962, 955, 949, 942, 935, 928, 920, 912, 904, 895, 886, 877, 868, 858, 848, 838, 828, 817, 806, 795, 784, 772, 760, 748, 736, 724, 711, 698, 685, 671, 658, 644, 630, 616, 601, 587, 572, 557, 542, 527, 512, 496, 480, 464, 448, 432, 416, 400, 383, 366, 350, 333, 316, 299, 282, 265, 247, 230, 212, 195, 177, 160, 142, 124, 107, 89, 71, 53, 35, 17, 0, -17, -35, -53, -71, -89, -107, -124, -142, -160, -177, -195, -212, -230, -247, -265, -282, -299, -316, -333, -350, -366, -383, -400, -416, -432, -448, -464, -480, -496, -512, -527, -542, -557, -572, -587, -601, -616, -630, -644, -658, -671, -685, -698, -711, -724, -736, -748, -760, -772, -784, -795, -806, -817, -828, -838, -848, -858, -868, -877, -886, -895, -904, -912, -920, -928, -935, -942, -949, -955, -962, -968, -973, -979, -984, -989, -993, -997, -1001, -1005, -1008, -1011, -1014, -1016, -1018, -1020, -1021, -1022, -1023, -1023, -1024, -1023, -1023, -1022, -1021, -1020, -1018, -1016, -1014, -1011, -1008, -1005, -1001, -997, -993, -989, -984, -979, -973, -968, -962, -955, -949, -942, -935, -928, -920, -912, -904, -895, -886, -877, -868, -858, -848, -838, -828, -817, -806, -795, -784, -772, -760, -748, -736, -724, -711, -698, -685, -671, -658, -644, -630, -616, -601, -587, -572, -557, -542, -527, -512, -496, -480, -464, -448, -432, -416, -400, -383, -366, -350, -333, -316, -299, -282, -265, -247, -230, -212, -195, -177, -160, -142, -124, -107, -89, -71, -53, -35, -17, 0, 17, 35, 53, 71, 89, 107, 124, 142, 160, 177, 195, 212, 230, 247, 265, 282, 299, 316, 333, 350, 366, 383, 400, 416, 432, 448, 464, 480, 496, 512, 527, 542, 557, 572, 587, 601, 616, 630, 644, 658, 671, 685, 698, 711, 724, 736, 748, 760, 772, 784, 795, 806, 817, 828, 838, 848, 858, 868, 877, 886, 895, 904, 912, 920, 928, 935, 942, 949, 955, 962, 968, 973, 979, 984, 989, 993, 997, 1001, 1005, 1008, 1011, 1014, 1016, 1018, 1020, 1021, 1022, 1023, 1023 }; int gdSinT[] = { 0, 17, 35, 53, 71, 89, 107, 124, 142, 160, 177, 195, 212, 230, 247, 265, 282, 299, 316, 333, 350, 366, 383, 400, 416, 432, 448, 464, 480, 496, 512, 527, 542, 557, 572, 587, 601, 616, 630, 644, 658, 671, 685, 698, 711, 724, 736, 748, 760, 772, 784, 795, 806, 817, 828, 838, 848, 858, 868, 877, 886, 895, 904, 912, 920, 928, 935, 942, 949, 955, 962, 968, 973, 979, 984, 989, 993, 997, 1001, 1005, 1008, 1011, 1014, 1016, 1018, 1020, 1021, 1022, 1023, 1023, 1024, 1023, 1023, 1022, 1021, 1020, 1018, 1016, 1014, 1011, 1008, 1005, 1001, 997, 993, 989, 984, 979, 973, 968, 962, 955, 949, 942, 935, 928, 920, 912, 904, 895, 886, 877, 868, 858, 848, 838, 828, 817, 806, 795, 784, 772, 760, 748, 736, 724, 711, 698, 685, 671, 658, 644, 630, 616, 601, 587, 572, 557, 542, 527, 512, 496, 480, 464, 448, 432, 416, 400, 383, 366, 350, 333, 316, 299, 282, 265, 247, 230, 212, 195, 177, 160, 142, 124, 107, 89, 71, 53, 35, 17, 0, -17, -35, -53, -71, -89, -107, -124, -142, -160, -177, -195, -212, -230, -247, -265, -282, -299, -316, -333, -350, -366, -383, -400, -416, -432, -448, -464, -480, -496, -512, -527, -542, -557, -572, -587, -601, -616, -630, -644, -658, -671, -685, -698, -711, -724, -736, -748, -760, -772, -784, -795, -806, -817, -828, -838, -848, -858, -868, -877, -886, -895, -904, -912, -920, -928, -935, -942, -949, -955, -962, -968, -973, -979, -984, -989, -993, -997, -1001, -1005, -1008, -1011, -1014, -1016, -1018, -1020, -1021, -1022, -1023, -1023, -1024, -1023, -1023, -1022, -1021, -1020, -1018, -1016, -1014, -1011, -1008, -1005, -1001, -997, -993, -989, -984, -979, -973, -968, -962, -955, -949, -942, -935, -928, -920, -912, -904, -895, -886, -877, -868, -858, -848, -838, -828, -817, -806, -795, -784, -772, -760, -748, -736, -724, -711, -698, -685, -671, -658, -644, -630, -616, -601, -587, -572, -557, -542, -527, -512, -496, -480, -464, -448, -432, -416, -400, -383, -366, -350, -333, -316, -299, -282, -265, -247, -230, -212, -195, -177, -160, -142, -124, -107, -89, -71, -53, -35, -17 }; php-4.4.8/ext/gd/libgd/gd_gd2.c0000644000175000017500000004651110032064414015350 0ustar derickderick/* * gd_gd2.c * * Implements the I/O and support for the GD2 format. * * Changing the definition of GD2_DBG (below) will cause copious messages * to be displayed while it processes requests. * * Designed, Written & Copyright 1999, Philip Warner. * */ #include #include #include #include #include #include "gd.h" #include "gdhelpers.h" #include #define TRUE 1 #define FALSE 0 /* 2.11: not part of the API, as the save routine can figure it out * from im->trueColor, and the load routine doesn't need to tell * the end user the saved format. NOTE: adding 2 is assumed * to result in the correct format value for truecolor! */ #define GD2_FMT_TRUECOLOR_RAW 3 #define GD2_FMT_TRUECOLOR_COMPRESSED 4 #define gd2_compressed(fmt) (((fmt) == GD2_FMT_COMPRESSED) || ((fmt) == GD2_FMT_TRUECOLOR_COMPRESSED)) #define gd2_truecolor(fmt) (((fmt) == GD2_FMT_TRUECOLOR_RAW) || ((fmt) == GD2_FMT_TRUECOLOR_COMPRESSED)) /* Use this for commenting out debug-print statements. */ /* Just use the first '#define' to allow all the prints... */ /* #define GD2_DBG(s) (s) */ #define GD2_DBG(s) typedef struct { int offset; int size; } t_chunk_info; extern int _gdGetColors(gdIOCtx * in, gdImagePtr im, int gd2xFlag); extern void _gdPutColors(gdImagePtr im, gdIOCtx * out); /* */ /* Read the extra info in the gd2 header. */ /* */ static int _gd2GetHeader(gdIOCtxPtr in, int *sx, int *sy, int *cs, int *vers, int *fmt, int *ncx, int *ncy, t_chunk_info ** chunkIdx) { int i; int ch; char id[5]; t_chunk_info *cidx; int sidx; int nc; GD2_DBG(php_gd_error("Reading gd2 header info\n")); for (i = 0; i < 4; i++) { ch = gdGetC(in); if (ch == EOF) { goto fail1; } id[i] = ch; } id[4] = 0; GD2_DBG(php_gd_error("Got file code: %s\n", id)); /* Equiv. of 'magick'. */ if (strcmp(id, GD2_ID) != 0) { GD2_DBG(php_gd_error("Not a valid gd2 file\n")); goto fail1; } /* Version */ if (gdGetWord(vers, in) != 1) { goto fail1; } GD2_DBG(php_gd_error("Version: %d\n", *vers)); if ((*vers != 1) && (*vers != 2)) { GD2_DBG(php_gd_error("Bad version: %d\n", *vers)); goto fail1; } /* Image Size */ if (!gdGetWord(sx, in)) { GD2_DBG(php_gd_error("Could not get x-size\n")); goto fail1; } if (!gdGetWord(sy, in)) { GD2_DBG(php_gd_error("Could not get y-size\n")); goto fail1; } GD2_DBG(php_gd_error("Image is %dx%d\n", *sx, *sy)); /* Chunk Size (pixels, not bytes!) */ if (gdGetWord(cs, in) != 1) { goto fail1; } GD2_DBG(php_gd_error("ChunkSize: %d\n", *cs)); if ((*cs < GD2_CHUNKSIZE_MIN) || (*cs > GD2_CHUNKSIZE_MAX)) { GD2_DBG(php_gd_error("Bad chunk size: %d\n", *cs)); goto fail1; } /* Data Format */ if (gdGetWord(fmt, in) != 1) { goto fail1; } GD2_DBG(php_gd_error("Format: %d\n", *fmt)); if ((*fmt != GD2_FMT_RAW) && (*fmt != GD2_FMT_COMPRESSED) && (*fmt != GD2_FMT_TRUECOLOR_RAW) && (*fmt != GD2_FMT_TRUECOLOR_COMPRESSED)) { GD2_DBG(php_gd_error("Bad data format: %d\n", *fmt)); goto fail1; } /* # of chunks wide */ if (gdGetWord(ncx, in) != 1) { goto fail1; } GD2_DBG(php_gd_error("%d Chunks Wide\n", *ncx)); /* # of chunks high */ if (gdGetWord(ncy, in) != 1) { goto fail1; } GD2_DBG(php_gd_error("%d Chunks vertically\n", *ncy)); if (gd2_compressed(*fmt)) { nc = (*ncx) * (*ncy); GD2_DBG(php_gd_error("Reading %d chunk index entries\n", nc)); sidx = sizeof(t_chunk_info) * nc; if (sidx <= 0) { goto fail1; } cidx = gdCalloc(sidx, 1); for (i = 0; i < nc; i++) { if (gdGetInt(&cidx[i].offset, in) != 1) { goto fail1; } if (gdGetInt(&cidx[i].size, in) != 1) { goto fail1; } } *chunkIdx = cidx; } GD2_DBG(php_gd_error("gd2 header complete\n")); return 1; fail1: return 0; } static gdImagePtr _gd2CreateFromFile (gdIOCtxPtr in, int *sx, int *sy, int *cs, int *vers, int *fmt, int *ncx, int *ncy, t_chunk_info ** cidx) { gdImagePtr im; if (_gd2GetHeader (in, sx, sy, cs, vers, fmt, ncx, ncy, cidx) != 1) { GD2_DBG(php_gd_error("Bad GD2 header\n")); goto fail1; } if (gd2_truecolor(*fmt)) { im = gdImageCreateTrueColor(*sx, *sy); } else { im = gdImageCreate(*sx, *sy); } if (im == NULL) { GD2_DBG(php_gd_error("Could not create gdImage\n")); goto fail1; } if (!_gdGetColors(in, im, (*vers) == 2)) { GD2_DBG(php_gd_error("Could not read color palette\n")); goto fail2; } GD2_DBG(php_gd_error("Image palette completed: %d colours\n", im->colorsTotal)); return im; fail2: gdImageDestroy(im); return 0; fail1: return 0; } static int _gd2ReadChunk (int offset, char *compBuf, int compSize, char *chunkBuf, uLongf * chunkLen, gdIOCtx * in) { int zerr; if (gdTell(in) != offset) { GD2_DBG(php_gd_error("Positioning in file to %d\n", offset)); gdSeek(in, offset); } else { GD2_DBG(php_gd_error("Already Positioned in file to %d\n", offset)); } /* Read and uncompress an entire chunk. */ GD2_DBG(php_gd_error("Reading file\n")); if (gdGetBuf(compBuf, compSize, in) != compSize) { return FALSE; } GD2_DBG(php_gd_error("Got %d bytes. Uncompressing into buffer of %d bytes\n", compSize, (int)*chunkLen)); zerr = uncompress((unsigned char *) chunkBuf, chunkLen, (unsigned char *) compBuf, compSize); if (zerr != Z_OK) { GD2_DBG(php_gd_error("Error %d from uncompress\n", zerr)); return FALSE; } GD2_DBG(php_gd_error("Got chunk\n")); return TRUE; } gdImagePtr gdImageCreateFromGd2 (FILE * inFile) { gdIOCtx *in = gdNewFileCtx(inFile); gdImagePtr im; im = gdImageCreateFromGd2Ctx(in); in->gd_free(in); return im; } gdImagePtr gdImageCreateFromGd2Ptr (int size, void *data) { gdImagePtr im; gdIOCtx *in = gdNewDynamicCtxEx(size, data, 0); im = gdImageCreateFromGd2Ctx(in); in->gd_free(in); return im; } gdImagePtr gdImageCreateFromGd2Ctx (gdIOCtxPtr in) { int sx, sy; int i; int ncx, ncy, nc, cs, cx, cy; int x, y, ylo, yhi, xlo, xhi; int vers, fmt; t_chunk_info *chunkIdx = NULL; /* So we can gdFree it with impunity. */ unsigned char *chunkBuf = NULL; /* So we can gdFree it with impunity. */ int chunkNum = 0; int chunkMax = 0; uLongf chunkLen; int chunkPos = 0; int compMax = 0; int bytesPerPixel; char *compBuf = NULL; /* So we can gdFree it with impunity. */ gdImagePtr im; /* Get the header */ if (!(im = _gd2CreateFromFile(in, &sx, &sy, &cs, &vers, &fmt, &ncx, &ncy, &chunkIdx))) { return 0; } bytesPerPixel = im->trueColor ? 4 : 1; nc = ncx * ncy; if (gd2_compressed(fmt)) { /* Find the maximum compressed chunk size. */ compMax = 0; for (i = 0; (i < nc); i++) { if (chunkIdx[i].size > compMax) { compMax = chunkIdx[i].size; } } compMax++; /* Allocate buffers */ chunkMax = cs * bytesPerPixel * cs; if (chunkMax <= 0) { return 0; } chunkBuf = gdCalloc(chunkMax, 1); compBuf = gdCalloc(compMax, 1); GD2_DBG(php_gd_error("Largest compressed chunk is %d bytes\n", compMax)); } /* Read the data... */ for (cy = 0; (cy < ncy); cy++) { for (cx = 0; (cx < ncx); cx++) { ylo = cy * cs; yhi = ylo + cs; if (yhi > im->sy) { yhi = im->sy; } GD2_DBG(php_gd_error("Processing Chunk %d (%d, %d), y from %d to %d\n", chunkNum, cx, cy, ylo, yhi)); if (gd2_compressed(fmt)) { chunkLen = chunkMax; if (!_gd2ReadChunk(chunkIdx[chunkNum].offset, compBuf, chunkIdx[chunkNum].size, (char *) chunkBuf, &chunkLen, in)) { GD2_DBG(php_gd_error("Error reading comproessed chunk\n")); goto fail2; } chunkPos = 0; } for (y = ylo; (y < yhi); y++) { xlo = cx * cs; xhi = xlo + cs; if (xhi > im->sx) { xhi = im->sx; } if (!gd2_compressed(fmt)) { for (x = xlo; x < xhi; x++) { if (im->trueColor) { if (!gdGetInt(&im->tpixels[y][x], in)) { im->tpixels[y][x] = 0; } } else { int ch; if (!gdGetByte(&ch, in)) { ch = 0; } im->pixels[y][x] = ch; } } } else { for (x = xlo; x < xhi; x++) { if (im->trueColor) { /* 2.0.1: work around a gcc bug by being verbose. TBB */ int a = chunkBuf[chunkPos++] << 24; int r = chunkBuf[chunkPos++] << 16; int g = chunkBuf[chunkPos++] << 8; int b = chunkBuf[chunkPos++]; im->tpixels[y][x] = a + r + g + b; } else { im->pixels[y][x] = chunkBuf[chunkPos++]; } } } } chunkNum++; } } GD2_DBG(php_gd_error("Freeing memory\n")); if (chunkBuf) { gdFree(chunkBuf); } if (compBuf) { gdFree(compBuf); } if (chunkIdx) { gdFree(chunkIdx); } GD2_DBG(php_gd_error("Done\n")); return im; fail2: gdImageDestroy(im); if (chunkBuf) { gdFree(chunkBuf); } if (compBuf) { gdFree(compBuf); } if (chunkIdx) { gdFree(chunkIdx); } return 0; } gdImagePtr gdImageCreateFromGd2PartPtr (int size, void *data, int srcx, int srcy, int w, int h) { gdImagePtr im; gdIOCtx *in = gdNewDynamicCtxEx(size, data, 0); im = gdImageCreateFromGd2PartCtx(in, srcx, srcy, w, h); in->gd_free(in); return im; } gdImagePtr gdImageCreateFromGd2Part (FILE * inFile, int srcx, int srcy, int w, int h) { gdImagePtr im; gdIOCtx *in = gdNewFileCtx(inFile); im = gdImageCreateFromGd2PartCtx(in, srcx, srcy, w, h); in->gd_free(in); return im; } gdImagePtr gdImageCreateFromGd2PartCtx (gdIOCtx * in, int srcx, int srcy, int w, int h) { int scx, scy, ecx, ecy, fsx, fsy; int nc, ncx, ncy, cs, cx, cy; int x, y, ylo, yhi, xlo, xhi; int dstart, dpos; int i; /* 2.0.12: unsigned is correct; fixes problems with color munging. Thanks to Steven Brown. */ unsigned int ch; int vers, fmt; t_chunk_info *chunkIdx = NULL; unsigned char *chunkBuf = NULL; int chunkNum; int chunkMax = 0; uLongf chunkLen; int chunkPos = 0; int compMax; char *compBuf = NULL; gdImagePtr im; /* The next few lines are basically copied from gd2CreateFromFile * we change the file size, so don't want to use the code directly. * but we do need to know the file size. */ if (_gd2GetHeader(in, &fsx, &fsy, &cs, &vers, &fmt, &ncx, &ncy, &chunkIdx) != 1) { goto fail1; } GD2_DBG(php_gd_error("File size is %dx%d\n", fsx, fsy)); /* This is the difference - make a file based on size of chunks. */ if (gd2_truecolor(fmt)) { im = gdImageCreateTrueColor(w, h); } else { im = gdImageCreate(w, h); } if (im == NULL) { goto fail1; } if (!_gdGetColors(in, im, vers == 2)) { goto fail2; } GD2_DBG(php_gd_error("Image palette completed: %d colours\n", im->colorsTotal)); /* Process the header info */ nc = ncx * ncy; if (gd2_compressed(fmt)) { /* Find the maximum compressed chunk size. */ compMax = 0; for (i = 0; (i < nc); i++) { if (chunkIdx[i].size > compMax) { compMax = chunkIdx[i].size; } } compMax++; if (im->trueColor) { chunkMax = cs * cs * 4; } else { chunkMax = cs * cs; } if (chunkMax <= 0) { goto fail2; } chunkBuf = gdCalloc(chunkMax, 1); compBuf = gdCalloc(compMax, 1); } /* Work out start/end chunks */ scx = srcx / cs; scy = srcy / cs; if (scx < 0) { scx = 0; } if (scy < 0) { scy = 0; } ecx = (srcx + w) / cs; ecy = (srcy + h) / cs; if (ecx >= ncx) { ecx = ncx - 1; } if (ecy >= ncy) { ecy = ncy - 1; } /* Remember file position of image data. */ dstart = gdTell(in); GD2_DBG(php_gd_error("Data starts at %d\n", dstart)); /* Loop through the chunks. */ for (cy = scy; (cy <= ecy); cy++) { ylo = cy * cs; yhi = ylo + cs; if (yhi > fsy) { yhi = fsy; } for (cx = scx; cx <= ecx; cx++) { xlo = cx * cs; xhi = xlo + cs; if (xhi > fsx) { xhi = fsx; } GD2_DBG(php_gd_error("Processing Chunk (%d, %d), from %d to %d\n", cx, cy, ylo, yhi)); if (!gd2_compressed(fmt)) { GD2_DBG(php_gd_error("Using raw format data\n")); if (im->trueColor) { dpos = (cy * (cs * fsx) * 4 + cx * cs * (yhi - ylo) * 4) + dstart; } else { dpos = cy * (cs * fsx) + cx * cs * (yhi - ylo) + dstart; } /* gd 2.0.11: gdSeek returns TRUE on success, not 0. Longstanding bug. 01/16/03 */ if (!gdSeek(in, dpos)) { php_gd_error_ex(E_WARNING, "Error from seek: %d\n", errno); goto fail2; } GD2_DBG(php_gd_error("Reading (%d, %d) from position %d\n", cx, cy, dpos - dstart)); } else { chunkNum = cx + cy * ncx; chunkLen = chunkMax; if (!_gd2ReadChunk (chunkIdx[chunkNum].offset, compBuf, chunkIdx[chunkNum].size, chunkBuf, &chunkLen, in)) { php_gd_error("Error reading comproessed chunk\n"); goto fail2; } chunkPos = 0; GD2_DBG(php_gd_error("Reading (%d, %d) from chunk %d\n", cx, cy, chunkNum)); } GD2_DBG(php_gd_error(" into (%d, %d) - (%d, %d)\n", xlo, ylo, xhi, yhi)); for (y = ylo; (y < yhi); y++) { for (x = xlo; x < xhi; x++) { if (!gd2_compressed(fmt)) { if (im->trueColor) { if (!gdGetInt(&ch, in)) { ch = 0; } } else { ch = gdGetC(in); if ((int)ch == EOF) { ch = 0; } } } else { if (im->trueColor) { ch = chunkBuf[chunkPos++]; ch = (ch << 8) + chunkBuf[chunkPos++]; ch = (ch << 8) + chunkBuf[chunkPos++]; ch = (ch << 8) + chunkBuf[chunkPos++]; } else { ch = chunkBuf[chunkPos++]; } } /* Only use a point that is in the image. */ if ((x >= srcx) && (x < (srcx + w)) && (x < fsx) && (x >= 0) && (y >= srcy) && (y < (srcy + h)) && (y < fsy) && (y >= 0)) { if (im->trueColor) { im->tpixels[y - srcy][x - srcx] = ch; } else { im->pixels[y - srcy][x - srcx] = ch; } } } } } } if (chunkBuf) { gdFree(chunkBuf); } if (compBuf) { gdFree(compBuf); } if (chunkIdx) { gdFree(chunkIdx); } return im; fail2: gdImageDestroy(im); fail1: if (chunkBuf) { gdFree(chunkBuf); } if (compBuf) { gdFree(compBuf); } if (chunkIdx) { gdFree(chunkIdx); } return 0; } static void _gd2PutHeader (gdImagePtr im, gdIOCtx * out, int cs, int fmt, int cx, int cy) { int i; /* Send the gd2 id, to verify file format. */ for (i = 0; i < 4; i++) { gdPutC((unsigned char) (GD2_ID[i]), out); } /* We put the version info first, so future versions can easily change header info. */ gdPutWord(GD2_VERS, out); gdPutWord(im->sx, out); gdPutWord(im->sy, out); gdPutWord(cs, out); gdPutWord(fmt, out); gdPutWord(cx, out); gdPutWord(cy, out); } static void _gdImageGd2 (gdImagePtr im, gdIOCtx * out, int cs, int fmt) { int ncx, ncy, cx, cy; int x, y, ylo, yhi, xlo, xhi; int chunkLen; int chunkNum = 0; char *chunkData = NULL; /* So we can gdFree it with impunity. */ char *compData = NULL; /* So we can gdFree it with impunity. */ uLongf compLen; int idxPos = 0; int idxSize; t_chunk_info *chunkIdx = NULL; /* So we can gdFree it with impunity. */ int posSave; int bytesPerPixel = im->trueColor ? 4 : 1; int compMax = 0; /* Force fmt to a valid value since we don't return anything. */ if ((fmt != GD2_FMT_RAW) && (fmt != GD2_FMT_COMPRESSED)) { fmt = im->trueColor ? GD2_FMT_TRUECOLOR_COMPRESSED : GD2_FMT_COMPRESSED; } if (im->trueColor) { fmt += 2; } /* Make sure chunk size is valid. These are arbitrary values; 64 because it seems * a little silly to expect performance improvements on a 64x64 bit scale, and * 4096 because we buffer one chunk, and a 16MB buffer seems a little large - it may be * OK for one user, but for another to read it, they require the buffer. */ if (cs == 0) { cs = GD2_CHUNKSIZE; } else if (cs < GD2_CHUNKSIZE_MIN) { cs = GD2_CHUNKSIZE_MIN; } else if (cs > GD2_CHUNKSIZE_MAX) { cs = GD2_CHUNKSIZE_MAX; } /* Work out number of chunks. */ ncx = im->sx / cs + 1; ncy = im->sy / cs + 1; /* Write the standard header. */ _gd2PutHeader (im, out, cs, fmt, ncx, ncy); if (gd2_compressed(fmt)) { /* Work out size of buffer for compressed data, If CHUNKSIZE is large, * then these will be large! */ /* The zlib notes say output buffer size should be (input size) * 1.01 * 12 * - we'll use 1.02 to be paranoid. */ compMax = (int)(cs * bytesPerPixel * cs * 1.02f) + 12; /* Allocate the buffers. */ chunkData = safe_emalloc(cs * bytesPerPixel, cs, 0); memset(chunkData, 0, cs * bytesPerPixel * cs); if (compMax <= 0) { goto fail; } compData = gdCalloc(compMax, 1); /* Save the file position of chunk index, and allocate enough space for * each chunk_info block . */ idxPos = gdTell(out); idxSize = ncx * ncy * sizeof(t_chunk_info); GD2_DBG(php_gd_error("Index size is %d\n", idxSize)); gdSeek(out, idxPos + idxSize); chunkIdx = safe_emalloc(idxSize, sizeof(t_chunk_info), 0); memset(chunkIdx, 0, idxSize * sizeof(t_chunk_info)); } _gdPutColors (im, out); GD2_DBG(php_gd_error("Size: %dx%d\n", im->sx, im->sy)); GD2_DBG(php_gd_error("Chunks: %dx%d\n", ncx, ncy)); for (cy = 0; (cy < ncy); cy++) { for (cx = 0; (cx < ncx); cx++) { ylo = cy * cs; yhi = ylo + cs; if (yhi > im->sy) { yhi = im->sy; } GD2_DBG(php_gd_error("Processing Chunk (%dx%d), y from %d to %d\n", cx, cy, ylo, yhi)); chunkLen = 0; for (y = ylo; (y < yhi); y++) { GD2_DBG(php_gd_error("y=%d: ",y)); xlo = cx * cs; xhi = xlo + cs; if (xhi > im->sx) { xhi = im->sx; } if (gd2_compressed(fmt)) { for (x = xlo; x < xhi; x++) { GD2_DBG(php_gd_error("%d...",x)); if (im->trueColor) { int p = im->tpixels[y][x]; chunkData[chunkLen++] = gdTrueColorGetAlpha(p); chunkData[chunkLen++] = gdTrueColorGetRed(p); chunkData[chunkLen++] = gdTrueColorGetGreen(p); chunkData[chunkLen++] = gdTrueColorGetBlue(p); } else { chunkData[chunkLen++] = im->pixels[y][x]; } } } else { for (x = xlo; x < xhi; x++) { GD2_DBG(php_gd_error("%d, ",x)); if (im->trueColor) { gdPutInt(im->tpixels[y][x], out); } else { gdPutC((unsigned char) im->pixels[y][x], out); } } } GD2_DBG(php_gd_error("y=%d done.\n",y)); } if (gd2_compressed(fmt)) { compLen = compMax; if (compress((unsigned char *) &compData[0], &compLen, (unsigned char *) &chunkData[0], chunkLen) != Z_OK) { php_gd_error("Error from compressing\n"); } else { chunkIdx[chunkNum].offset = gdTell(out); chunkIdx[chunkNum++].size = compLen; GD2_DBG(php_gd_error("Chunk %d size %d offset %d\n", chunkNum, chunkIdx[chunkNum - 1].size, chunkIdx[chunkNum - 1].offset)); if (gdPutBuf (compData, compLen, out) <= 0) { /* Any alternate suggestions for handling this? */ php_gd_error_ex(E_WARNING, "Error %d on write\n", errno); } } } } } if (gd2_compressed(fmt)) { /* Save the position, write the index, restore position (paranoia). */ GD2_DBG(php_gd_error("Seeking %d to write index\n", idxPos)); posSave = gdTell(out); gdSeek(out, idxPos); GD2_DBG(php_gd_error("Writing index\n")); for (x = 0; x < chunkNum; x++) { GD2_DBG(php_gd_error("Chunk %d size %d offset %d\n", x, chunkIdx[x].size, chunkIdx[x].offset)); gdPutInt(chunkIdx[x].offset, out); gdPutInt(chunkIdx[x].size, out); } gdSeek(out, posSave); } fail: GD2_DBG(php_gd_error("Freeing memory\n")); if (chunkData) { gdFree(chunkData); } if (compData) { gdFree(compData); } if (chunkIdx) { gdFree(chunkIdx); } GD2_DBG(php_gd_error("Done\n")); } void gdImageGd2 (gdImagePtr im, FILE * outFile, int cs, int fmt) { gdIOCtx *out = gdNewFileCtx(outFile); _gdImageGd2(im, out, cs, fmt); out->gd_free(out); } void *gdImageGd2Ptr (gdImagePtr im, int cs, int fmt, int *size) { void *rv; gdIOCtx *out = gdNewDynamicCtx(2048, NULL); _gdImageGd2(im, out, cs, fmt); rv = gdDPExtractData(out, size); out->gd_free(out); return rv; } php-4.4.8/ext/gd/libgd/gd_png.c0000644000175000017500000005210410622705623015464 0ustar derickderick#include #include #include #include #include "gd.h" /* JCE: Arrange HAVE_LIBPNG so that it can be set in gd.h */ #ifdef HAVE_LIBPNG #include "png.h" /* includes zlib.h and setjmp.h */ #include "gdhelpers.h" #define TRUE 1 #define FALSE 0 /*--------------------------------------------------------------------------- gd_png.c Copyright 1999 Greg Roelofs and Thomas Boutell The routines in this file, gdImagePng*() and gdImageCreateFromPng*(), are drop-in replacements for gdImageGif*() and gdImageCreateFromGif*(), except that these functions are noisier in the case of errors (comment out all fprintf() statements to disable that). GD 2.0 supports RGBA truecolor and will read and write truecolor PNGs. GD 2.0 supports 8 bits of color resolution per channel and 7 bits of alpha channel resolution. Images with more than 8 bits per channel are reduced to 8 bits. Images with an alpha channel are only able to resolve down to '1/128th opaque' instead of '1/256th', and this conversion is also automatic. I very much doubt you can see it. Both tRNS and true alpha are supported. Gamma is ignored, and there is no support for text annotations. Last updated: 9 February 2001 ---------------------------------------------------------------------------*/ #ifndef PNG_SETJMP_NOT_SUPPORTED typedef struct _jmpbuf_wrapper { jmp_buf jmpbuf; } jmpbuf_wrapper; static jmpbuf_wrapper gdPngJmpbufStruct; static void gdPngErrorHandler (png_structp png_ptr, png_const_charp msg) { jmpbuf_wrapper *jmpbuf_ptr; /* This function, aside from the extra step of retrieving the "error * pointer" (below) and the fact that it exists within the application * rather than within libpng, is essentially identical to libpng's * default error handler. The second point is critical: since both * setjmp() and longjmp() are called from the same code, they are * guaranteed to have compatible notions of how big a jmp_buf is, * regardless of whether _BSD_SOURCE or anything else has (or has not) * been defined. */ php_gd_error_ex(E_ERROR, "gd-png: fatal libpng error: %s\n", msg); jmpbuf_ptr = png_get_error_ptr (png_ptr); if (jmpbuf_ptr == NULL) { /* we are completely hosed now */ php_gd_error_ex(E_ERROR, "gd-png: EXTREMELY fatal error: jmpbuf unrecoverable; terminating.\n"); } longjmp (jmpbuf_ptr->jmpbuf, 1); } #endif static void gdPngReadData (png_structp png_ptr, png_bytep data, png_size_t length) { int check; check = gdGetBuf(data, length, (gdIOCtx *) png_get_io_ptr(png_ptr)); if (check != length) { png_error(png_ptr, "Read Error: truncated data"); } } static void gdPngWriteData (png_structp png_ptr, png_bytep data, png_size_t length) { gdPutBuf (data, length, (gdIOCtx *) png_get_io_ptr(png_ptr)); } static void gdPngFlushData (png_structp png_ptr) { } gdImagePtr gdImageCreateFromPng (FILE * inFile) { gdImagePtr im; gdIOCtx *in = gdNewFileCtx(inFile); im = gdImageCreateFromPngCtx(in); in->gd_free(in); return im; } gdImagePtr gdImageCreateFromPngPtr (int size, void *data) { gdImagePtr im; gdIOCtx *in = gdNewDynamicCtxEx(size, data, 0); im = gdImageCreateFromPngCtx(in); in->gd_free(in); return im; } /* This routine is based in part on the Chapter 13 demo code in "PNG: The * Definitive Guide" (http://www.cdrom.com/pub/png/pngbook.html). */ gdImagePtr gdImageCreateFromPngCtx (gdIOCtx * infile) { png_byte sig[8]; png_structp png_ptr; png_infop info_ptr; png_uint_32 width, height, rowbytes, w, h; int bit_depth, color_type, interlace_type; int num_palette, num_trans; png_colorp palette; png_color_16p trans_gray_rgb; png_color_16p trans_color_rgb; png_bytep trans; png_bytep image_data = NULL; png_bytepp row_pointers = NULL; gdImagePtr im = NULL; int i, j, *open = NULL; volatile int transparent = -1; volatile int palette_allocated = FALSE; /* Make sure the signature can't match by dumb luck -- TBB */ /* GRR: isn't sizeof(infile) equal to the size of the pointer? */ memset (infile, 0, sizeof(infile)); /* first do a quick check that the file really is a PNG image; could * have used slightly more general png_sig_cmp() function instead */ gdGetBuf(sig, 8, infile); if (!png_check_sig (sig, 8)) { /* bad signature */ return NULL; } #ifndef PNG_SETJMP_NOT_SUPPORTED png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, &gdPngJmpbufStruct, gdPngErrorHandler, NULL); #else png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); #endif if (png_ptr == NULL) { php_gd_error("gd-png error: cannot allocate libpng main struct\n"); return NULL; } info_ptr = png_create_info_struct(png_ptr); if (info_ptr == NULL) { php_gd_error("gd-png error: cannot allocate libpng info struct\n"); png_destroy_read_struct (&png_ptr, NULL, NULL); return NULL; } /* we could create a second info struct here (end_info), but it's only * useful if we want to keep pre- and post-IDAT chunk info separated * (mainly for PNG-aware image editors and converters) */ /* setjmp() must be called in every non-callback function that calls a * PNG-reading libpng function */ #ifndef PNG_SETJMP_NOT_SUPPORTED if (setjmp(gdPngJmpbufStruct.jmpbuf)) { php_gd_error("gd-png error: setjmp returns error condition\n"); png_destroy_read_struct(&png_ptr, &info_ptr, NULL); return NULL; } #endif png_set_sig_bytes(png_ptr, 8); /* we already read the 8 signature bytes */ png_set_read_fn(png_ptr, (void *) infile, gdPngReadData); png_read_info(png_ptr, info_ptr); /* read all PNG info up to image data */ png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, &interlace_type, NULL, NULL); if ((color_type == PNG_COLOR_TYPE_RGB) || (color_type == PNG_COLOR_TYPE_RGB_ALPHA)) { im = gdImageCreateTrueColor((int) width, (int) height); } else { im = gdImageCreate((int) width, (int) height); } if (im == NULL) { php_gd_error("gd-png error: cannot allocate gdImage struct\n"); png_destroy_read_struct(&png_ptr, &info_ptr, NULL); gdFree(image_data); gdFree(row_pointers); return NULL; } if (bit_depth == 16) { png_set_strip_16(png_ptr); } else if (bit_depth < 8) { png_set_packing (png_ptr); /* expand to 1 byte per pixel */ } switch (color_type) { case PNG_COLOR_TYPE_PALETTE: png_get_PLTE(png_ptr, info_ptr, &palette, &num_palette); #ifdef DEBUG php_gd_error("gd-png color_type is palette, colors: %d\n", num_palette); #endif /* DEBUG */ if (png_get_valid (png_ptr, info_ptr, PNG_INFO_tRNS)) { /* gd 2.0: we support this rather thoroughly now. Grab the * first fully transparent entry, if any, as the value of * the simple-transparency index, mostly for backwards * binary compatibility. The alpha channel is where it's * really at these days. */ int firstZero = 1; png_get_tRNS(png_ptr, info_ptr, &trans, &num_trans, NULL); for (i = 0; i < num_trans; ++i) { im->alpha[i] = gdAlphaMax - (trans[i] >> 1); if ((trans[i] == 0) && (firstZero)) { transparent = i; firstZero = 0; } } } break; case PNG_COLOR_TYPE_GRAY: case PNG_COLOR_TYPE_GRAY_ALPHA: /* create a fake palette and check for single-shade transparency */ if ((palette = (png_colorp) safe_emalloc(256, sizeof(png_color), 0)) == NULL) { php_gd_error("gd-png error: cannot allocate gray palette\n"); png_destroy_read_struct(&png_ptr, &info_ptr, NULL); return NULL; } palette_allocated = TRUE; if (bit_depth < 8) { num_palette = 1 << bit_depth; for (i = 0; i < 256; ++i) { j = (255 * i) / (num_palette - 1); palette[i].red = palette[i].green = palette[i].blue = j; } } else { num_palette = 256; for (i = 0; i < 256; ++i) { palette[i].red = palette[i].green = palette[i].blue = i; } } if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) { png_get_tRNS(png_ptr, info_ptr, NULL, NULL, &trans_gray_rgb); if (bit_depth == 16) { /* png_set_strip_16() not yet in effect */ transparent = trans_gray_rgb->gray >> 8; } else { transparent = trans_gray_rgb->gray; } /* Note slight error in 16-bit case: up to 256 16-bit shades * may get mapped to a single 8-bit shade, and only one of them * is supposed to be transparent. IOW, both opaque pixels and * transparent pixels will be mapped into the transparent entry. * There is no particularly good way around this in the case * that all 256 8-bit shades are used, but one could write some * custom 16-bit code to handle the case where there are gdFree * palette entries. This error will be extremely rare in * general, though. (Quite possibly there is only one such * image in existence.) */ } break; case PNG_COLOR_TYPE_RGB: case PNG_COLOR_TYPE_RGB_ALPHA: /* gd 2.0: we now support truecolor. See the comment above * for a rare situation in which the transparent pixel may not * work properly with 16-bit channels. */ if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) { png_get_tRNS(png_ptr, info_ptr, NULL, NULL, &trans_color_rgb); if (bit_depth == 16) { /* png_set_strip_16() not yet in effect */ transparent = gdTrueColor(trans_color_rgb->red >> 8, trans_color_rgb->green >> 8, trans_color_rgb->blue >> 8); } else { transparent = gdTrueColor(trans_color_rgb->red, trans_color_rgb->green, trans_color_rgb->blue); } } break; } png_read_update_info(png_ptr, info_ptr); /* allocate space for the PNG image data */ rowbytes = png_get_rowbytes(png_ptr, info_ptr); image_data = (png_bytep) safe_emalloc(rowbytes, height, 0); row_pointers = (png_bytepp) safe_emalloc(height, sizeof (png_bytep), 0); /* set the individual row_pointers to point at the correct offsets */ for (h = 0; h < height; ++h) { row_pointers[h] = image_data + h * rowbytes; } png_read_image(png_ptr, row_pointers); /* read whole image... */ png_read_end(png_ptr, NULL); /* ...done! */ if (!im->trueColor) { im->colorsTotal = num_palette; /* load the palette and mark all entries "open" (unused) for now */ open = im->open; for (i = 0; i < num_palette; ++i) { im->red[i] = palette[i].red; im->green[i] = palette[i].green; im->blue[i] = palette[i].blue; open[i] = 1; } for (i = num_palette; i < gdMaxColors; ++i) { open[i] = 1; } } /* 2.0.12: Slaven Rezic: palette images are not the only images * with a simple transparent color setting. */ im->transparent = transparent; im->interlace = (interlace_type == PNG_INTERLACE_ADAM7); /* can't nuke structs until done with palette */ png_destroy_read_struct(&png_ptr, &info_ptr, NULL); switch (color_type) { case PNG_COLOR_TYPE_RGB: for (h = 0; h < height; h++) { int boffset = 0; for (w = 0; w < width; w++) { register png_byte r = row_pointers[h][boffset++]; register png_byte g = row_pointers[h][boffset++]; register png_byte b = row_pointers[h][boffset++]; im->tpixels[h][w] = gdTrueColor (r, g, b); } } break; case PNG_COLOR_TYPE_RGB_ALPHA: for (h = 0; h < height; h++) { int boffset = 0; for (w = 0; w < width; w++) { register png_byte r = row_pointers[h][boffset++]; register png_byte g = row_pointers[h][boffset++]; register png_byte b = row_pointers[h][boffset++]; /* gd has only 7 bits of alpha channel resolution, and * 127 is transparent, 0 opaque. A moment of convenience, * a lifetime of compatibility. */ register png_byte a = gdAlphaMax - (row_pointers[h][boffset++] >> 1); im->tpixels[h][w] = gdTrueColorAlpha(r, g, b, a); } } break; default: /* Palette image, or something coerced to be one */ for (h = 0; h < height; ++h) { for (w = 0; w < width; ++w) { register png_byte idx = row_pointers[h][w]; im->pixels[h][w] = idx; open[idx] = 0; } } } #ifdef DEBUG if (!im->trueColor) { for (i = num_palette; i < gdMaxColors; ++i) { if (!open[i]) { php_gd_error("gd-png warning: image data references out-of-range color index (%d)\n", i); } } } #endif if (palette_allocated) { gdFree(palette); } gdFree(image_data); gdFree(row_pointers); return im; } void gdImagePngEx (gdImagePtr im, FILE * outFile, int level) { gdIOCtx *out = gdNewFileCtx(outFile); gdImagePngCtxEx(im, out, level); out->gd_free(out); } void gdImagePng (gdImagePtr im, FILE * outFile) { gdIOCtx *out = gdNewFileCtx(outFile); gdImagePngCtxEx(im, out, -1); out->gd_free(out); } void * gdImagePngPtr (gdImagePtr im, int *size) { void *rv; gdIOCtx *out = gdNewDynamicCtx(2048, NULL); gdImagePngCtxEx(im, out, -1); rv = gdDPExtractData(out, size); out->gd_free(out); return rv; } void * gdImagePngPtrEx (gdImagePtr im, int *size, int level) { void *rv; gdIOCtx *out = gdNewDynamicCtx(2048, NULL); gdImagePngCtxEx(im, out, level); rv = gdDPExtractData(out, size); out->gd_free(out); return rv; } void gdImagePngCtx (gdImagePtr im, gdIOCtx * outfile) { gdImagePngCtxEx(im, outfile, -1); } /* This routine is based in part on code from Dale Lutz (Safe Software Inc.) * and in part on demo code from Chapter 15 of "PNG: The Definitive Guide" * (http://www.cdrom.com/pub/png/pngbook.html). */ void gdImagePngCtxEx (gdImagePtr im, gdIOCtx * outfile, int level) { int i, j, bit_depth = 0, interlace_type; int width = im->sx; int height = im->sy; int colors = im->colorsTotal; int *open = im->open; int mapping[gdMaxColors]; /* mapping[gd_index] == png_index */ png_byte trans_values[256]; png_color_16 trans_rgb_value; png_color palette[gdMaxColors]; png_structp png_ptr; png_infop info_ptr; volatile int transparent = im->transparent; volatile int remap = FALSE; #ifndef PNG_SETJMP_NOT_SUPPORTED png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, &gdPngJmpbufStruct, gdPngErrorHandler, NULL); #else png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); #endif if (png_ptr == NULL) { php_gd_error("gd-png error: cannot allocate libpng main struct\n"); return; } info_ptr = png_create_info_struct(png_ptr); if (info_ptr == NULL) { php_gd_error("gd-png error: cannot allocate libpng info struct\n"); png_destroy_write_struct (&png_ptr, (png_infopp) NULL); return; } #ifndef PNG_SETJMP_NOT_SUPPORTED if (setjmp (gdPngJmpbufStruct.jmpbuf)) { php_gd_error("gd-png error: setjmp returns error condition\n"); png_destroy_write_struct (&png_ptr, &info_ptr); return; } #endif png_set_write_fn(png_ptr, (void *) outfile, gdPngWriteData, gdPngFlushData); /* This is best for palette images, and libpng defaults to it for * palette images anyway, so we don't need to do it explicitly. * What to ideally do for truecolor images depends, alas, on the image. * gd is intentionally imperfect and doesn't spend a lot of time * fussing with such things. */ /* png_set_filter(png_ptr, 0, PNG_FILTER_NONE); */ /* 2.0.12: this is finally a parameter */ png_set_compression_level(png_ptr, level); /* can set this to a smaller value without compromising compression if all * image data is 16K or less; will save some decoder memory [min == 8] */ /* png_set_compression_window_bits(png_ptr, 15); */ if (!im->trueColor) { if (transparent >= im->colorsTotal || (transparent >= 0 && open[transparent])) { transparent = -1; } for (i = 0; i < gdMaxColors; ++i) { mapping[i] = -1; } /* count actual number of colors used (colorsTotal == high-water mark) */ colors = 0; for (i = 0; i < im->colorsTotal; ++i) { if (!open[i]) { mapping[i] = colors; ++colors; } } if (colors < im->colorsTotal) { remap = TRUE; } if (colors <= 2) { bit_depth = 1; } else if (colors <= 4) { bit_depth = 2; } else if (colors <= 16) { bit_depth = 4; } else { bit_depth = 8; } } interlace_type = im->interlace ? PNG_INTERLACE_ADAM7 : PNG_INTERLACE_NONE; if (im->trueColor) { if (im->saveAlphaFlag) { png_set_IHDR(png_ptr, info_ptr, width, height, 8, PNG_COLOR_TYPE_RGB_ALPHA, interlace_type, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); } else { png_set_IHDR(png_ptr, info_ptr, width, height, 8, PNG_COLOR_TYPE_RGB, interlace_type, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); } } else { png_set_IHDR(png_ptr, info_ptr, width, height, bit_depth, PNG_COLOR_TYPE_PALETTE, interlace_type, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); } if (im->trueColor && !im->saveAlphaFlag && (transparent >= 0)) { /* 2.0.9: fixed by Thomas Winzig */ trans_rgb_value.red = gdTrueColorGetRed (im->transparent); trans_rgb_value.green = gdTrueColorGetGreen (im->transparent); trans_rgb_value.blue = gdTrueColorGetBlue (im->transparent); png_set_tRNS(png_ptr, info_ptr, 0, 0, &trans_rgb_value); } if (!im->trueColor) { /* Oy veh. Remap the PNG palette to put the entries with interesting alpha channel * values first. This minimizes the size of the tRNS chunk and thus the size * of the PNG file as a whole. */ int tc = 0; int i; int j; int k; for (i = 0; (i < im->colorsTotal); i++) { if ((!im->open[i]) && (im->alpha[i] != gdAlphaOpaque)) { tc++; } } if (tc) { #if 0 for (i = 0; (i < im->colorsTotal); i++) { trans_values[i] = 255 - ((im->alpha[i] << 1) + (im->alpha[i] >> 6)); } png_set_tRNS (png_ptr, info_ptr, trans_values, 256, NULL); #endif if (!remap) { remap = TRUE; } /* (Semi-)transparent indexes come up from the bottom of the list of real colors; opaque * indexes come down from the top */ j = 0; k = colors - 1; for (i = 0; i < im->colorsTotal; i++) { if (!im->open[i]) { if (im->alpha[i] != gdAlphaOpaque) { /* Andrew Hull: >> 6, not >> 7! (gd 2.0.5) */ trans_values[j] = 255 - ((im->alpha[i] << 1) + (im->alpha[i] >> 6)); mapping[i] = j++; } else { mapping[i] = k--; } } } png_set_tRNS(png_ptr, info_ptr, trans_values, tc, NULL); } } /* convert palette to libpng layout */ if (!im->trueColor) { if (remap) { for (i = 0; i < im->colorsTotal; ++i) { if (mapping[i] < 0) { continue; } palette[mapping[i]].red = im->red[i]; palette[mapping[i]].green = im->green[i]; palette[mapping[i]].blue = im->blue[i]; } } else { for (i = 0; i < colors; ++i) { palette[i].red = im->red[i]; palette[i].green = im->green[i]; palette[i].blue = im->blue[i]; } } png_set_PLTE(png_ptr, info_ptr, palette, colors); } /* write out the PNG header info (everything up to first IDAT) */ png_write_info(png_ptr, info_ptr); /* make sure < 8-bit images are packed into pixels as tightly as possible */ png_set_packing(png_ptr); /* This code allocates a set of row buffers and copies the gd image data * into them only in the case that remapping is necessary; in gd 1.3 and * later, the im->pixels array is laid out identically to libpng's row * pointers and can be passed to png_write_image() function directly. * The remapping case could be accomplished with less memory for non- * interlaced images, but interlacing causes some serious complications. */ if (im->trueColor) { /* performance optimizations by Phong Tran */ int channels = im->saveAlphaFlag ? 4 : 3; /* Our little 7-bit alpha channel trick costs us a bit here. */ png_bytep *row_pointers; unsigned char* pOutputRow; int **ptpixels = im->tpixels; int *pThisRow; unsigned char a; int thisPixel; png_bytep *prow_pointers; int saveAlphaFlag = im->saveAlphaFlag; row_pointers = safe_emalloc(sizeof(png_bytep), height, 0); prow_pointers = row_pointers; for (j = 0; j < height; ++j) { *prow_pointers = (png_bytep) safe_emalloc(width, channels, 0); pOutputRow = *prow_pointers++; pThisRow = *ptpixels++; for (i = 0; i < width; ++i) { thisPixel = *pThisRow++; *pOutputRow++ = gdTrueColorGetRed(thisPixel); *pOutputRow++ = gdTrueColorGetGreen(thisPixel); *pOutputRow++ = gdTrueColorGetBlue(thisPixel); if (saveAlphaFlag) { /* convert the 7-bit alpha channel to an 8-bit alpha channel. * We do a little bit-flipping magic, repeating the MSB * as the LSB, to ensure that 0 maps to 0 and * 127 maps to 255. We also have to invert to match * PNG's convention in which 255 is opaque. */ a = gdTrueColorGetAlpha(thisPixel); /* Andrew Hull: >> 6, not >> 7! (gd 2.0.5) */ *pOutputRow++ = 255 - ((a << 1) + (a >> 6)); } } } png_write_image(png_ptr, row_pointers); png_write_end(png_ptr, info_ptr); for (j = 0; j < height; ++j) { gdFree(row_pointers[j]); } gdFree(row_pointers); } else { if (remap) { png_bytep *row_pointers; row_pointers = safe_emalloc(sizeof(png_bytep), height, 0); for (j = 0; j < height; ++j) { row_pointers[j] = (png_bytep) gdMalloc(width); for (i = 0; i < width; ++i) { row_pointers[j][i] = mapping[im->pixels[j][i]]; } } png_write_image(png_ptr, row_pointers); png_write_end(png_ptr, info_ptr); for (j = 0; j < height; ++j) { gdFree(row_pointers[j]); } gdFree(row_pointers); } else { png_write_image(png_ptr, im->pixels); png_write_end(png_ptr, info_ptr); } } /* 1.6.3: maybe we should give that memory BACK! TBB */ png_destroy_write_struct(&png_ptr, &info_ptr); } #endif /* HAVE_LIBPNG */ php-4.4.8/ext/gd/libgd/pngtogd2.c0000644000175000017500000000226307455710735015765 0ustar derickderick #include #include #include "gd.h" /* A short program which converts a .png file into a .gd file, for your convenience in creating images on the fly from a basis image that must be loaded quickly. The .gd format is not intended to be a general-purpose format. */ int main (int argc, char **argv) { gdImagePtr im; FILE *in, *out; int cs, fmt; if (argc != 5) { fprintf (stderr, "Usage: pngtogd2 filename.png filename.gd2 cs fmt\n"); fprintf (stderr, " where cs is the chunk size\n"); fprintf (stderr, " fmt is 1 for raw, 2 for compressed\n"); exit (1); } in = fopen (argv[1], "rb"); if (!in) { fprintf (stderr, "Input file does not exist!\n"); exit (1); } im = gdImageCreateFromPng (in); fclose (in); if (!im) { fprintf (stderr, "Input is not in PNG format!\n"); exit (1); } out = fopen (argv[2], "wb"); if (!out) { fprintf (stderr, "Output file cannot be written to!\n"); gdImageDestroy (im); exit (1); } cs = atoi (argv[3]); fmt = atoi (argv[4]); gdImageGd2 (im, out, cs, fmt); fclose (out); gdImageDestroy (im); return 0; } php-4.4.8/ext/gd/libgd/gddemo.c0000644000175000017500000000627507455710734015506 0ustar derickderick#include #include "gd.h" #include "gdfontg.h" #include "gdfonts.h" int main (void) { /* Input and output files */ FILE *in; FILE *out; /* Input and output images */ gdImagePtr im_in = 0, im_out = 0; /* Brush image */ gdImagePtr brush; /* Color indexes */ int white; int blue; int red; int green; /* Points for polygon */ gdPoint points[3]; /* Create output image, 256 by 256 pixels, true color. */ im_out = gdImageCreateTrueColor (256, 256); /* First color allocated is background. */ white = gdImageColorAllocate (im_out, 255, 255, 255); /* Set transparent color. */ gdImageColorTransparent (im_out, white); /* Try to load demoin.png and paste part of it into the output image. */ in = fopen ("demoin.png", "rb"); if (!in) { fprintf (stderr, "Can't load source image; this demo\n"); fprintf (stderr, "is much more impressive if demoin.png\n"); fprintf (stderr, "is available.\n"); im_in = 0; } else { im_in = gdImageCreateFromPng (in); fclose (in); /* Now copy, and magnify as we do so */ gdImageCopyResized (im_out, im_in, 32, 32, 0, 0, 192, 192, 255, 255); } red = gdImageColorAllocate (im_out, 255, 0, 0); green = gdImageColorAllocate (im_out, 0, 255, 0); blue = gdImageColorAllocate (im_out, 0, 0, 255); /* Rectangle */ gdImageLine (im_out, 16, 16, 240, 16, green); gdImageLine (im_out, 240, 16, 240, 240, green); gdImageLine (im_out, 240, 240, 16, 240, green); gdImageLine (im_out, 16, 240, 16, 16, green); /* Circle */ gdImageArc (im_out, 128, 128, 60, 20, 0, 720, blue); /* Arc */ gdImageArc (im_out, 128, 128, 40, 40, 90, 270, blue); /* Flood fill: doesn't do much on a continuously variable tone jpeg original. */ gdImageFill (im_out, 8, 8, blue); /* Polygon */ points[0].x = 64; points[0].y = 0; points[1].x = 0; points[1].y = 128; points[2].x = 128; points[2].y = 128; gdImageFilledPolygon (im_out, points, 3, green); /* Brush. A fairly wild example also involving a line style! */ if (im_in) { int style[8]; brush = gdImageCreateTrueColor (16, 16); gdImageCopyResized (brush, im_in, 0, 0, 0, 0, gdImageSX (brush), gdImageSY (brush), gdImageSX (im_in), gdImageSY (im_in)); gdImageSetBrush (im_out, brush); /* With a style, so they won't overprint each other. Normally, they would, yielding a fat-brush effect. */ style[0] = 0; style[1] = 0; style[2] = 0; style[3] = 0; style[4] = 0; style[5] = 0; style[6] = 0; style[7] = 1; gdImageSetStyle (im_out, style, 8); /* Draw the styled, brushed line */ gdImageLine (im_out, 0, 255, 255, 0, gdStyledBrushed); } /* Text */ gdImageString (im_out, gdFontGiant, 32, 32, (unsigned char *) "hi", red); gdImageStringUp (im_out, gdFontSmall, 64, 64, (unsigned char *) "hi", red); /* Make output image interlaced (progressive, in the case of JPEG) */ gdImageInterlace (im_out, 1); out = fopen ("demoout.png", "wb"); /* Write PNG */ gdImagePng (im_out, out); fclose (out); gdImageDestroy (im_out); if (im_in) { gdImageDestroy (im_in); } return 0; } php-4.4.8/ext/gd/libgd/xbm.c0000644000175000017500000000713710736114307015021 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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: xbm.c,v 1.2.2.1.8.3 2007/12/31 07:22:47 sebastian Exp $ */ #include #include #include #include #include "gd.h" #include "gdhelpers.h" #include "php.h" #define MAX_XBM_LINE_SIZE 255 gdImagePtr gdImageCreateFromXbm (FILE * fd) { char fline[MAX_XBM_LINE_SIZE]; char iname[MAX_XBM_LINE_SIZE]; char *type; int value; unsigned int width = 0, height = 0; int fail = 0; int max_bit = 0; gdImagePtr im; int bytes = 0, i; int bit, x = 0, y = 0; int ch; char h[8]; unsigned int b; rewind(fd); while (fgets(fline, MAX_XBM_LINE_SIZE, fd)) { fline[MAX_XBM_LINE_SIZE-1] = '\0'; if (strlen(fline) == MAX_XBM_LINE_SIZE-1) { return 0; } if (sscanf(fline, "#define %s %d", iname, &value) == 2) { if (!(type = strrchr(iname, '_'))) { type = iname; } else { type++; } if (!strcmp("width", type)) { width = (unsigned int) value; } if (!strcmp("height", type)) { height = (unsigned int) value; } } else { if ( sscanf(fline, "static unsigned char %s = {", iname) == 1 || sscanf(fline, "static char %s = {", iname) == 1) { max_bit = 128; } else if (sscanf(fline, "static unsigned short %s = {", iname) == 1 || sscanf(fline, "static short %s = {", iname) == 1) { max_bit = 32768; } if (max_bit) { bytes = (width * height / 8) + 1; if (!bytes) { return 0; } if (!(type = strrchr(iname, '_'))) { type = iname; } else { type++; } if (!strcmp("bits[]", type)) { break; } } } } if (!bytes || !max_bit) { return 0; } im = gdImageCreate(width, height); gdImageColorAllocate(im, 255, 255, 255); gdImageColorAllocate(im, 0, 0, 0); h[2] = '\0'; h[4] = '\0'; for (i = 0; i < bytes; i++) { while (1) { if ((ch=getc(fd)) == EOF) { fail = 1; break; } if (ch == 'x') { break; } } if (fail) { break; } /* Get hex value */ if ((ch=getc(fd)) == EOF) { break; } h[0] = ch; if ((ch=getc(fd)) == EOF) { break; } h[1] = ch; if (max_bit == 32768) { if ((ch=getc(fd)) == EOF) { break; } h[2] = ch; if ((ch=getc(fd)) == EOF) { break; } h[3] = ch; } sscanf(h, "%x", &b); for (bit = 1; bit <= max_bit; bit = bit << 1) { gdImageSetPixel(im, x++, y, (b & bit) ? 1 : 0); if (x == im->sx) { x = 0; y++; if (y == im->sy) { return im; } break; } } } php_gd_error("EOF before image was complete\n"); gdImageDestroy(im); return 0; } php-4.4.8/ext/gd/libgd/gd2topng.c0000644000175000017500000000204407557612321015755 0ustar derickderick #include #include "gd.h" /* A short program which converts a .png file into a .gd file, for your convenience in creating images on the fly from a basis image that must be loaded quickly. The .gd format is not intended to be a general-purpose format. */ int main (int argc, char **argv) { gdImagePtr im; FILE *in, *out; if (argc != 3) { fprintf (stderr, "Usage: gd2topng filename.gd2 filename.png\n"); exit (1); } in = fopen (argv[1], "rb"); if (!in) { fprintf (stderr, "Input file does not exist!\n"); exit (1); } im = gdImageCreateFromGd2 (in); fclose (in); if (!im) { fprintf (stderr, "Input is not in GD2 format!\n"); exit (1); } out = fopen (argv[2], "wb"); if (!out) { fprintf (stderr, "Output file cannot be written to!\n"); gdImageDestroy (im); exit (1); } #ifdef HAVE_LIBPNG gdImagePng (im, out); #else fprintf(stderr, "No PNG library support available.\n"); #endif fclose (out); gdImageDestroy (im); return 0; } php-4.4.8/ext/gd/libgd/README0000644000175000017500000000622507455710734014756 0ustar derickderickThis directory contains the GD library available from http://www.boutell.com/gd/ The inclusion of this library with PHP is in response to the popularity of the GD extension and the GD library itself. We felt it would be worthwhile to make sure everyone had access to the features of GD and by bundling GD with PHP we have a known target to work against. In addition to the above, a number of motivated PHP hackers have expressed an interest in extending the functionality of the PHP-GD combination. By putting a version of GD into PHP CVS we have provided a sandbox for them to throw sand at each other in. Any and all improvements we make to the GD library will be contributed back to the original maintainers of this library at boutell.com. The following statement is from the original GD package: Credits and license terms In order to resolve any possible confusion regarding the authorship of gd, the following copyright statement covers all of the authors who have required such a statement. _If you are aware of any oversights in this copyright notice, please contact Thomas Boutell who will be pleased to correct them._ COPYRIGHT STATEMENT FOLLOWS THIS LINE Portions copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 by Cold Spring Harbor Laboratory. Funded under Grant P41-RR02188 by the National Institutes of Health. Portions copyright 1996, 1997, 1998, 1999, 2000, 2001 by Boutell.Com, Inc. Portions relating to GD2 format copyright 1999, 2000 Philip Warner. Portions relating to PNG copyright 1999, 2000 Greg Roelofs. Portions relating to libttf copyright 1999, 2000 John Ellson (ellson@lucent.com). Portions relating to JPEG and to color quantization copyright 2000, Doug Becker and copyright (C) 1994-1998, Thomas G. Lane. This software is based in part on the work of the Independent JPEG Group. See the file README-JPEG.TXT for more information. Portions relating to WBMP copyright 2000 Maurice Szmurlo and Johan Van den Brande. _Permission has been granted to copy, distribute and modify gd in any context without fee, including a commercial application, provided that this notice is present in user-accessible supporting documentation._ This does not affect your ownership of the derived work itself, and the intent is to assure proper credit for the authors of gd, not to interfere with your productive use of gd. If you have questions, ask. "Derived works" includes all programs that utilize the library. Credit must be given in user-accessible documentation. _This software is provided "AS IS."_ The copyright holders disclaim all warranties, either express or implied, including but not limited to implied warranties of merchantability and fitness for a particular purpose, with respect to this code and accompanying documentation. Although their code does not appear in gd 2.0.1, the authors wish to thank David Koblas, David Rowley, and Hutchison Avenue Software Corporation for their prior contributions. END OF COPYRIGHT STATEMENT php-4.4.8/ext/gd/libgd/gdparttopng.c0000644000175000017500000000241107557612321016560 0ustar derickderick#include #include /* For atoi */ #include "gd.h" /* A short program which converts a .png file into a .gd file, for your convenience in creating images on the fly from a basis image that must be loaded quickly. The .gd format is not intended to be a general-purpose format. */ int main (int argc, char **argv) { gdImagePtr im; FILE *in, *out; int x, y, w, h; if (argc != 7) { fprintf (stderr, "Usage: gdparttopng filename.gd filename.png x y w h\n"); exit (1); } in = fopen (argv[1], "rb"); if (!in) { fprintf (stderr, "Input file does not exist!\n"); exit (1); } x = atoi (argv[3]); y = atoi (argv[4]); w = atoi (argv[5]); h = atoi (argv[6]); printf ("Extracting from (%d, %d), size is %dx%d\n", x, y, w, h); im = gdImageCreateFromGd2Part (in, x, y, w, h); fclose (in); if (!im) { fprintf (stderr, "Input is not in PNG format!\n"); exit (1); } out = fopen (argv[2], "wb"); if (!out) { fprintf (stderr, "Output file cannot be written to!\n"); gdImageDestroy (im); exit (1); } #ifdef HAVE_LIBPNG gdImagePng (im, out); #else fprintf(stderr, "No PNG library support.\n"); #endif fclose (out); gdImageDestroy (im); return 0; } php-4.4.8/ext/gd/libgd/gd_topal.c0000644000175000017500000020053710106525402016014 0ustar derickderick/* TODO: oim and nim in the lower level functions; correct use of stub (sigh). */ /* 2.0.12: a new adaptation from the same original, this time by Barend Gehrels. My attempt to incorporate alpha channel into the result worked poorly and degraded the quality of palette conversion even when the source contained no alpha channel data. This version does not attempt to produce an output file with transparency in some of the palette indexes, which, in practice, doesn't look so hot anyway. TBB */ /* * gd_topal, adapted from jquant2.c * * Copyright (C) 1991-1996, Thomas G. Lane. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * * This file contains 2-pass color quantization (color mapping) routines. * These routines provide selection of a custom color map for an image, * followed by mapping of the image to that color map, with optional * Floyd-Steinberg dithering. * It is also possible to use just the second pass to map to an arbitrary * externally-given color map. * * Note: ordered dithering is not supported, since there isn't any fast * way to compute intercolor distances; it's unclear that ordered dither's * fundamental assumptions even hold with an irregularly spaced color map. */ #ifdef ORIGINAL_LIB_JPEG #define JPEG_INTERNALS #include "jinclude.h" #include "jpeglib.h" #else /* * THOMAS BOUTELL & BAREND GEHRELS, february 2003 * adapted the code to work within gd rather than within libjpeg. * If it is not working, it's not Thomas G. Lane's fault. */ /* SETTING THIS ONE CAUSES STRIPED IMAGE to be done: solve this #define ORIGINAL_LIB_JPEG_REVERSE_ODD_ROWS */ #include #include "gd.h" #include "gdhelpers.h" /* (Re)define some defines known by libjpeg */ #define QUANT_2PASS_SUPPORTED #define RGB_RED 0 #define RGB_GREEN 1 #define RGB_BLUE 2 #define JSAMPLE unsigned char #define MAXJSAMPLE (gdMaxColors-1) #define BITS_IN_JSAMPLE 8 #define JSAMPROW int* #define JDIMENSION int #define METHODDEF(type) static type #define LOCAL(type) static type /* We assume that right shift corresponds to signed division by 2 with * rounding towards minus infinity. This is correct for typical "arithmetic * shift" instructions that shift in copies of the sign bit. But some * C compilers implement >> with an unsigned shift. For these machines you * must define RIGHT_SHIFT_IS_UNSIGNED. * RIGHT_SHIFT provides a proper signed right shift of an INT32 quantity. * It is only applied with constant shift counts. SHIFT_TEMPS must be * included in the variables of any routine using RIGHT_SHIFT. */ #ifdef RIGHT_SHIFT_IS_UNSIGNED #define SHIFT_TEMPS INT32 shift_temp; #define RIGHT_SHIFT(x,shft) \ ((shift_temp = (x)) < 0 ? \ (shift_temp >> (shft)) | ((~((INT32) 0)) << (32-(shft))) : \ (shift_temp >> (shft))) #else #define SHIFT_TEMPS #define RIGHT_SHIFT(x,shft) ((x) >> (shft)) #endif #define range_limit(x) { if(x<0) x=0; if (x>255) x=255; } #ifndef INT16 #define INT16 short #endif #ifndef UINT16 #define UINT16 unsigned short #endif #ifndef INT32 #define INT32 int #endif #ifndef FAR #define FAR #endif #ifndef boolean #define boolean int #endif #ifndef TRUE #define TRUE 1 #endif #ifndef FALSE #define FALSE 0 #endif #define input_buf (oim->tpixels) #define output_buf (nim->pixels) #endif #ifdef QUANT_2PASS_SUPPORTED /* * This module implements the well-known Heckbert paradigm for color * quantization. Most of the ideas used here can be traced back to * Heckbert's seminal paper * Heckbert, Paul. "Color Image Quantization for Frame Buffer Display", * Proc. SIGGRAPH '82, Computer Graphics v.16 #3 (July 1982), pp 297-304. * * In the first pass over the image, we accumulate a histogram showing the * usage count of each possible color. To keep the histogram to a reasonable * size, we reduce the precision of the input; typical practice is to retain * 5 or 6 bits per color, so that 8 or 4 different input values are counted * in the same histogram cell. * * Next, the color-selection step begins with a box representing the whole * color space, and repeatedly splits the "largest" remaining box until we * have as many boxes as desired colors. Then the mean color in each * remaining box becomes one of the possible output colors. * * The second pass over the image maps each input pixel to the closest output * color (optionally after applying a Floyd-Steinberg dithering correction). * This mapping is logically trivial, but making it go fast enough requires * considerable care. * * Heckbert-style quantizers vary a good deal in their policies for choosing * the "largest" box and deciding where to cut it. The particular policies * used here have proved out well in experimental comparisons, but better ones * may yet be found. * * In earlier versions of the IJG code, this module quantized in YCbCr color * space, processing the raw upsampled data without a color conversion step. * This allowed the color conversion math to be done only once per colormap * entry, not once per pixel. However, that optimization precluded other * useful optimizations (such as merging color conversion with upsampling) * and it also interfered with desired capabilities such as quantizing to an * externally-supplied colormap. We have therefore abandoned that approach. * The present code works in the post-conversion color space, typically RGB. * * To improve the visual quality of the results, we actually work in scaled * RGB space, giving G distances more weight than R, and R in turn more than * B. To do everything in integer math, we must use integer scale factors. * The 2/3/1 scale factors used here correspond loosely to the relative * weights of the colors in the NTSC grayscale equation. * If you want to use this code to quantize a non-RGB color space, you'll * probably need to change these scale factors. */ #define R_SCALE 2 /* scale R distances by this much */ #define G_SCALE 3 /* scale G distances by this much */ #define B_SCALE 1 /* and B by this much */ /* Relabel R/G/B as components 0/1/2, respecting the RGB ordering defined * in jmorecfg.h. As the code stands, it will do the right thing for R,G,B * and B,G,R orders. If you define some other weird order in jmorecfg.h, * you'll get compile errors until you extend this logic. In that case * you'll probably want to tweak the histogram sizes too. */ #if RGB_RED == 0 #define C0_SCALE R_SCALE #endif #if RGB_BLUE == 0 #define C0_SCALE B_SCALE #endif #if RGB_GREEN == 1 #define C1_SCALE G_SCALE #endif #if RGB_RED == 2 #define C2_SCALE R_SCALE #endif #if RGB_BLUE == 2 #define C2_SCALE B_SCALE #endif /* * First we have the histogram data structure and routines for creating it. * * The number of bits of precision can be adjusted by changing these symbols. * We recommend keeping 6 bits for G and 5 each for R and B. * If you have plenty of memory and cycles, 6 bits all around gives marginally * better results; if you are short of memory, 5 bits all around will save * some space but degrade the results. * To maintain a fully accurate histogram, we'd need to allocate a "long" * (preferably unsigned long) for each cell. In practice this is overkill; * we can get by with 16 bits per cell. Few of the cell counts will overflow, * and clamping those that do overflow to the maximum value will give close- * enough results. This reduces the recommended histogram size from 256Kb * to 128Kb, which is a useful savings on PC-class machines. * (In the second pass the histogram space is re-used for pixel mapping data; * in that capacity, each cell must be able to store zero to the number of * desired colors. 16 bits/cell is plenty for that too.) * Since the JPEG code is intended to run in small memory model on 80x86 * machines, we can't just allocate the histogram in one chunk. Instead * of a true 3-D array, we use a row of pointers to 2-D arrays. Each * pointer corresponds to a C0 value (typically 2^5 = 32 pointers) and * each 2-D array has 2^6*2^5 = 2048 or 2^6*2^6 = 4096 entries. Note that * on 80x86 machines, the pointer row is in near memory but the actual * arrays are in far memory (same arrangement as we use for image arrays). */ #define MAXNUMCOLORS (MAXJSAMPLE+1) /* maximum size of colormap */ /* These will do the right thing for either R,G,B or B,G,R color order, * but you may not like the results for other color orders. */ #define HIST_C0_BITS 5 /* bits of precision in R/B histogram */ #define HIST_C1_BITS 6 /* bits of precision in G histogram */ #define HIST_C2_BITS 5 /* bits of precision in B/R histogram */ /* Number of elements along histogram axes. */ #define HIST_C0_ELEMS (1<cquantize; #endif register JSAMPROW ptr; register histptr histp; register hist3d histogram = cquantize->histogram; int row; JDIMENSION col; #ifdef ORIGINAL_LIB_JPEG JDIMENSION width = cinfo->output_width; #else int width = oim->sx; int num_rows = oim->sy; #endif for (row = 0; row < num_rows; row++) { ptr = input_buf[row]; for (col = width; col > 0; col--) { #ifdef ORIGINAL_LIB_JPEG int r = GETJSAMPLE (ptr[0]) >> C0_SHIFT; int g = GETJSAMPLE (ptr[1]) >> C1_SHIFT; int b = GETJSAMPLE (ptr[2]) >> C2_SHIFT; #else int r = gdTrueColorGetRed (*ptr) >> C0_SHIFT; int g = gdTrueColorGetGreen (*ptr) >> C1_SHIFT; int b = gdTrueColorGetBlue (*ptr) >> C2_SHIFT; /* 2.0.12: Steven Brown: support a single totally transparent color in the original. */ if ((oim->transparent >= 0) && (*ptr == oim->transparent)) { ptr++; continue; } #endif /* get pixel value and index into the histogram */ histp = &histogram[r][g][b]; /* increment, check for overflow and undo increment if so. */ if (++(*histp) == 0) (*histp)--; #ifdef ORIGINAL_LIB_JPEG ptr += 3; #else ptr++; #endif } } } /* * Next we have the really interesting routines: selection of a colormap * given the completed histogram. * These routines work with a list of "boxes", each representing a rectangular * subset of the input color space (to histogram precision). */ typedef struct { /* The bounds of the box (inclusive); expressed as histogram indexes */ int c0min, c0max; int c1min, c1max; int c2min, c2max; /* The volume (actually 2-norm) of the box */ INT32 volume; /* The number of nonzero histogram cells within this box */ long colorcount; } box; typedef box *boxptr; LOCAL (boxptr) find_biggest_color_pop (boxptr boxlist, int numboxes) /* Find the splittable box with the largest color population */ /* Returns NULL if no splittable boxes remain */ { register boxptr boxp; register int i; register long maxc = 0; boxptr which = NULL; for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++) { if (boxp->colorcount > maxc && boxp->volume > 0) { which = boxp; maxc = boxp->colorcount; } } return which; } LOCAL (boxptr) find_biggest_volume (boxptr boxlist, int numboxes) /* Find the splittable box with the largest (scaled) volume */ /* Returns NULL if no splittable boxes remain */ { register boxptr boxp; register int i; register INT32 maxv = 0; boxptr which = NULL; for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++) { if (boxp->volume > maxv) { which = boxp; maxv = boxp->volume; } } return which; } LOCAL (void) #ifndef ORIGINAL_LIB_JPEG update_box (gdImagePtr oim, gdImagePtr nim, my_cquantize_ptr cquantize, boxptr boxp) { #else update_box (j_decompress_ptr cinfo, boxptr boxp) /* Shrink the min/max bounds of a box to enclose only nonzero elements, */ /* and recompute its volume and population */ { my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; #endif hist3d histogram = cquantize->histogram; histptr histp; int c0, c1, c2; int c0min, c0max, c1min, c1max, c2min, c2max; INT32 dist0, dist1, dist2; long ccount; c0min = boxp->c0min; c0max = boxp->c0max; c1min = boxp->c1min; c1max = boxp->c1max; c2min = boxp->c2min; c2max = boxp->c2max; if (c0max > c0min) for (c0 = c0min; c0 <= c0max; c0++) for (c1 = c1min; c1 <= c1max; c1++) { histp = &histogram[c0][c1][c2min]; for (c2 = c2min; c2 <= c2max; c2++) if (*histp++ != 0) { boxp->c0min = c0min = c0; goto have_c0min; } } have_c0min: if (c0max > c0min) for (c0 = c0max; c0 >= c0min; c0--) for (c1 = c1min; c1 <= c1max; c1++) { histp = &histogram[c0][c1][c2min]; for (c2 = c2min; c2 <= c2max; c2++) if (*histp++ != 0) { boxp->c0max = c0max = c0; goto have_c0max; } } have_c0max: if (c1max > c1min) for (c1 = c1min; c1 <= c1max; c1++) for (c0 = c0min; c0 <= c0max; c0++) { histp = &histogram[c0][c1][c2min]; for (c2 = c2min; c2 <= c2max; c2++) if (*histp++ != 0) { boxp->c1min = c1min = c1; goto have_c1min; } } have_c1min: if (c1max > c1min) for (c1 = c1max; c1 >= c1min; c1--) for (c0 = c0min; c0 <= c0max; c0++) { histp = &histogram[c0][c1][c2min]; for (c2 = c2min; c2 <= c2max; c2++) if (*histp++ != 0) { boxp->c1max = c1max = c1; goto have_c1max; } } have_c1max: if (c2max > c2min) for (c2 = c2min; c2 <= c2max; c2++) for (c0 = c0min; c0 <= c0max; c0++) { histp = &histogram[c0][c1min][c2]; for (c1 = c1min; c1 <= c1max; c1++, histp += HIST_C2_ELEMS) if (*histp != 0) { boxp->c2min = c2min = c2; goto have_c2min; } } have_c2min: if (c2max > c2min) for (c2 = c2max; c2 >= c2min; c2--) for (c0 = c0min; c0 <= c0max; c0++) { histp = &histogram[c0][c1min][c2]; for (c1 = c1min; c1 <= c1max; c1++, histp += HIST_C2_ELEMS) if (*histp != 0) { boxp->c2max = c2max = c2; goto have_c2max; } } have_c2max: /* Update box volume. * We use 2-norm rather than real volume here; this biases the method * against making long narrow boxes, and it has the side benefit that * a box is splittable iff norm > 0. * Since the differences are expressed in histogram-cell units, * we have to shift back to JSAMPLE units to get consistent distances; * after which, we scale according to the selected distance scale factors. */ dist0 = ((c0max - c0min) << C0_SHIFT) * C0_SCALE; dist1 = ((c1max - c1min) << C1_SHIFT) * C1_SCALE; dist2 = ((c2max - c2min) << C2_SHIFT) * C2_SCALE; boxp->volume = dist0 * dist0 + dist1 * dist1 + dist2 * dist2; /* Now scan remaining volume of box and compute population */ ccount = 0; for (c0 = c0min; c0 <= c0max; c0++) for (c1 = c1min; c1 <= c1max; c1++) { histp = &histogram[c0][c1][c2min]; for (c2 = c2min; c2 <= c2max; c2++, histp++) if (*histp != 0) { ccount++; } } boxp->colorcount = ccount; } LOCAL (int) #ifdef ORIGINAL_LIB_JPEG median_cut (j_decompress_ptr cinfo, boxptr boxlist, int numboxes, int desired_colors) #else median_cut (gdImagePtr oim, gdImagePtr nim, my_cquantize_ptr cquantize, boxptr boxlist, int numboxes, int desired_colors) #endif /* Repeatedly select and split the largest box until we have enough boxes */ { int n, lb; int c0, c1, c2, cmax; register boxptr b1, b2; while (numboxes < desired_colors) { /* Select box to split. * Current algorithm: by population for first half, then by volume. */ if (numboxes * 2 <= desired_colors) { b1 = find_biggest_color_pop (boxlist, numboxes); } else { b1 = find_biggest_volume (boxlist, numboxes); } if (b1 == NULL) /* no splittable boxes left! */ break; b2 = &boxlist[numboxes]; /* where new box will go */ /* Copy the color bounds to the new box. */ b2->c0max = b1->c0max; b2->c1max = b1->c1max; b2->c2max = b1->c2max; b2->c0min = b1->c0min; b2->c1min = b1->c1min; b2->c2min = b1->c2min; /* Choose which axis to split the box on. * Current algorithm: longest scaled axis. * See notes in update_box about scaling distances. */ c0 = ((b1->c0max - b1->c0min) << C0_SHIFT) * C0_SCALE; c1 = ((b1->c1max - b1->c1min) << C1_SHIFT) * C1_SCALE; c2 = ((b1->c2max - b1->c2min) << C2_SHIFT) * C2_SCALE; /* We want to break any ties in favor of green, then red, blue last. * This code does the right thing for R,G,B or B,G,R color orders only. */ #if RGB_RED == 0 cmax = c1; n = 1; if (c0 > cmax) { cmax = c0; n = 0; } if (c2 > cmax) { n = 2; } #else cmax = c1; n = 1; if (c2 > cmax) { cmax = c2; n = 2; } if (c0 > cmax) { n = 0; } #endif /* Choose split point along selected axis, and update box bounds. * Current algorithm: split at halfway point. * (Since the box has been shrunk to minimum volume, * any split will produce two nonempty subboxes.) * Note that lb value is max for lower box, so must be < old max. */ switch (n) { case 0: lb = (b1->c0max + b1->c0min) / 2; b1->c0max = lb; b2->c0min = lb + 1; break; case 1: lb = (b1->c1max + b1->c1min) / 2; b1->c1max = lb; b2->c1min = lb + 1; break; case 2: lb = (b1->c2max + b1->c2min) / 2; b1->c2max = lb; b2->c2min = lb + 1; break; } /* Update stats for boxes */ #ifdef ORIGINAL_LIB_JPEG update_box (cinfo, b1); update_box (cinfo, b2); #else update_box (oim, nim, cquantize, b1); update_box (oim, nim, cquantize, b2); #endif numboxes++; } return numboxes; } LOCAL (void) #ifndef ORIGINAL_LIB_JPEG compute_color (gdImagePtr oim, gdImagePtr nim, my_cquantize_ptr cquantize, boxptr boxp, int icolor) { #else compute_color (j_decompress_ptr cinfo, boxptr boxp, int icolor) /* Compute representative color for a box, put it in colormap[icolor] */ { /* Current algorithm: mean weighted by pixels (not colors) */ /* Note it is important to get the rounding correct! */ my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; #endif hist3d histogram = cquantize->histogram; histptr histp; int c0, c1, c2; int c0min, c0max, c1min, c1max, c2min, c2max; long count = 0; /* 2.0.28: = 0 */ long total = 0; long c0total = 0; long c1total = 0; long c2total = 0; c0min = boxp->c0min; c0max = boxp->c0max; c1min = boxp->c1min; c1max = boxp->c1max; c2min = boxp->c2min; c2max = boxp->c2max; for (c0 = c0min; c0 <= c0max; c0++) for (c1 = c1min; c1 <= c1max; c1++) { histp = &histogram[c0][c1][c2min]; for (c2 = c2min; c2 <= c2max; c2++) { if ((count = *histp++) != 0) { total += count; c0total += ((c0 << C0_SHIFT) + ((1 << C0_SHIFT) >> 1)) * count; c1total += ((c1 << C1_SHIFT) + ((1 << C1_SHIFT) >> 1)) * count; c2total += ((c2 << C2_SHIFT) + ((1 << C2_SHIFT) >> 1)) * count; } } } #ifdef ORIGINAL_LIB_JPEG cinfo->colormap[0][icolor] = (JSAMPLE) ((c0total + (total >> 1)) / total); cinfo->colormap[1][icolor] = (JSAMPLE) ((c1total + (total >> 1)) / total); cinfo->colormap[2][icolor] = (JSAMPLE) ((c2total + (total >> 1)) / total); #else /* 2.0.16: Paul den Dulk found an occasion where total can be 0 */ if (count) { nim->red[icolor] = (int) ((c0total + (total >> 1)) / total); nim->green[icolor] = (int) ((c1total + (total >> 1)) / total); nim->blue[icolor] = (int) ((c2total + (total >> 1)) / total); } else { nim->red[icolor] = 255; nim->green[icolor] = 255; nim->blue[icolor] = 255; } #endif } LOCAL (void) #ifdef ORIGINAL_LIB_JPEG select_colors (j_decompress_ptr cinfo, int desired_colors) #else select_colors (gdImagePtr oim, gdImagePtr nim, my_cquantize_ptr cquantize, int desired_colors) #endif /* Master routine for color selection */ { boxptr boxlist; int numboxes; int i; /* Allocate workspace for box list */ #ifdef ORIGINAL_LIB_JPEG boxlist = (boxptr) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, desired_colors * SIZEOF (box)); #else boxlist = (boxptr) safe_emalloc(desired_colors, sizeof (box), 1); #endif /* Initialize one box containing whole space */ numboxes = 1; boxlist[0].c0min = 0; boxlist[0].c0max = MAXJSAMPLE >> C0_SHIFT; boxlist[0].c1min = 0; boxlist[0].c1max = MAXJSAMPLE >> C1_SHIFT; boxlist[0].c2min = 0; boxlist[0].c2max = MAXJSAMPLE >> C2_SHIFT; #ifdef ORIGINAL_LIB_JPEG /* Shrink it to actually-used volume and set its statistics */ update_box (cinfo, &boxlist[0]); /* Perform median-cut to produce final box list */ numboxes = median_cut (cinfo, boxlist, numboxes, desired_colors); /* Compute the representative color for each box, fill colormap */ for (i = 0; i < numboxes; i++) compute_color (cinfo, &boxlist[i], i); cinfo->actual_number_of_colors = numboxes; TRACEMS1 (cinfo, 1, JTRC_QUANT_SELECTED, numboxes); #else /* Shrink it to actually-used volume and set its statistics */ update_box (oim, nim, cquantize, &boxlist[0]); /* Perform median-cut to produce final box list */ numboxes = median_cut (oim, nim, cquantize, boxlist, numboxes, desired_colors); /* Compute the representative color for each box, fill colormap */ for (i = 0; i < numboxes; i++) compute_color (oim, nim, cquantize, &boxlist[i], i); nim->colorsTotal = numboxes; /* If we had a pure transparency color, add it as the last palette entry. * Skip incrementing the color count so that the dither / matching phase * won't use it on pixels that shouldn't have been transparent. We'll * increment it after all that finishes. */ if (oim->transparent >= 0) { /* Save the transparent color. */ nim->red[nim->colorsTotal] = gdTrueColorGetRed (oim->transparent); nim->green[nim->colorsTotal] = gdTrueColorGetGreen (oim->transparent); nim->blue[nim->colorsTotal] = gdTrueColorGetBlue (oim->transparent); nim->alpha[nim->colorsTotal] = gdAlphaTransparent; nim->open[nim->colorsTotal] = 0; } gdFree (boxlist); #endif } /* * These routines are concerned with the time-critical task of mapping input * colors to the nearest color in the selected colormap. * * We re-use the histogram space as an "inverse color map", essentially a * cache for the results of nearest-color searches. All colors within a * histogram cell will be mapped to the same colormap entry, namely the one * closest to the cell's center. This may not be quite the closest entry to * the actual input color, but it's almost as good. A zero in the cache * indicates we haven't found the nearest color for that cell yet; the array * is cleared to zeroes before starting the mapping pass. When we find the * nearest color for a cell, its colormap index plus one is recorded in the * cache for future use. The pass2 scanning routines call fill_inverse_cmap * when they need to use an unfilled entry in the cache. * * Our method of efficiently finding nearest colors is based on the "locally * sorted search" idea described by Heckbert and on the incremental distance * calculation described by Spencer W. Thomas in chapter III.1 of Graphics * Gems II (James Arvo, ed. Academic Press, 1991). Thomas points out that * the distances from a given colormap entry to each cell of the histogram can * be computed quickly using an incremental method: the differences between * distances to adjacent cells themselves differ by a constant. This allows a * fairly fast implementation of the "brute force" approach of computing the * distance from every colormap entry to every histogram cell. Unfortunately, * it needs a work array to hold the best-distance-so-far for each histogram * cell (because the inner loop has to be over cells, not colormap entries). * The work array elements have to be INT32s, so the work array would need * 256Kb at our recommended precision. This is not feasible in DOS machines. * * To get around these problems, we apply Thomas' method to compute the * nearest colors for only the cells within a small subbox of the histogram. * The work array need be only as big as the subbox, so the memory usage * problem is solved. Furthermore, we need not fill subboxes that are never * referenced in pass2; many images use only part of the color gamut, so a * fair amount of work is saved. An additional advantage of this * approach is that we can apply Heckbert's locality criterion to quickly * eliminate colormap entries that are far away from the subbox; typically * three-fourths of the colormap entries are rejected by Heckbert's criterion, * and we need not compute their distances to individual cells in the subbox. * The speed of this approach is heavily influenced by the subbox size: too * small means too much overhead, too big loses because Heckbert's criterion * can't eliminate as many colormap entries. Empirically the best subbox * size seems to be about 1/512th of the histogram (1/8th in each direction). * * Thomas' article also describes a refined method which is asymptotically * faster than the brute-force method, but it is also far more complex and * cannot efficiently be applied to small subboxes. It is therefore not * useful for programs intended to be portable to DOS machines. On machines * with plenty of memory, filling the whole histogram in one shot with Thomas' * refined method might be faster than the present code --- but then again, * it might not be any faster, and it's certainly more complicated. */ /* log2(histogram cells in update box) for each axis; this can be adjusted */ #define BOX_C0_LOG (HIST_C0_BITS-3) #define BOX_C1_LOG (HIST_C1_BITS-3) #define BOX_C2_LOG (HIST_C2_BITS-3) #define BOX_C0_ELEMS (1<actual_number_of_colors; #else int numcolors = nim->colorsTotal; #endif int maxc0, maxc1, maxc2; int centerc0, centerc1, centerc2; int i, x, ncolors; INT32 minmaxdist, min_dist, max_dist, tdist; INT32 mindist[MAXNUMCOLORS]; /* min distance to colormap entry i */ /* Compute true coordinates of update box's upper corner and center. * Actually we compute the coordinates of the center of the upper-corner * histogram cell, which are the upper bounds of the volume we care about. * Note that since ">>" rounds down, the "center" values may be closer to * min than to max; hence comparisons to them must be "<=", not "<". */ maxc0 = minc0 + ((1 << BOX_C0_SHIFT) - (1 << C0_SHIFT)); centerc0 = (minc0 + maxc0) >> 1; maxc1 = minc1 + ((1 << BOX_C1_SHIFT) - (1 << C1_SHIFT)); centerc1 = (minc1 + maxc1) >> 1; maxc2 = minc2 + ((1 << BOX_C2_SHIFT) - (1 << C2_SHIFT)); centerc2 = (minc2 + maxc2) >> 1; /* For each color in colormap, find: * 1. its minimum squared-distance to any point in the update box * (zero if color is within update box); * 2. its maximum squared-distance to any point in the update box. * Both of these can be found by considering only the corners of the box. * We save the minimum distance for each color in mindist[]; * only the smallest maximum distance is of interest. */ minmaxdist = 0x7FFFFFFFL; for (i = 0; i < numcolors; i++) { /* We compute the squared-c0-distance term, then add in the other two. */ #ifdef ORIGINAL_LIB_JPEG x = GETJSAMPLE (cinfo->colormap[0][i]); #else x = nim->red[i]; #endif if (x < minc0) { tdist = (x - minc0) * C0_SCALE; min_dist = tdist * tdist; tdist = (x - maxc0) * C0_SCALE; max_dist = tdist * tdist; } else if (x > maxc0) { tdist = (x - maxc0) * C0_SCALE; min_dist = tdist * tdist; tdist = (x - minc0) * C0_SCALE; max_dist = tdist * tdist; } else { /* within cell range so no contribution to min_dist */ min_dist = 0; if (x <= centerc0) { tdist = (x - maxc0) * C0_SCALE; max_dist = tdist * tdist; } else { tdist = (x - minc0) * C0_SCALE; max_dist = tdist * tdist; } } #ifdef ORIGINAL_LIB_JPEG x = GETJSAMPLE (cinfo->colormap[1][i]); #else x = nim->green[i]; #endif if (x < minc1) { tdist = (x - minc1) * C1_SCALE; min_dist += tdist * tdist; tdist = (x - maxc1) * C1_SCALE; max_dist += tdist * tdist; } else if (x > maxc1) { tdist = (x - maxc1) * C1_SCALE; min_dist += tdist * tdist; tdist = (x - minc1) * C1_SCALE; max_dist += tdist * tdist; } else { /* within cell range so no contribution to min_dist */ if (x <= centerc1) { tdist = (x - maxc1) * C1_SCALE; max_dist += tdist * tdist; } else { tdist = (x - minc1) * C1_SCALE; max_dist += tdist * tdist; } } #ifdef ORIGINAL_LIB_JPEG x = GETJSAMPLE (cinfo->colormap[2][i]); #else x = nim->blue[i]; #endif if (x < minc2) { tdist = (x - minc2) * C2_SCALE; min_dist += tdist * tdist; tdist = (x - maxc2) * C2_SCALE; max_dist += tdist * tdist; } else if (x > maxc2) { tdist = (x - maxc2) * C2_SCALE; min_dist += tdist * tdist; tdist = (x - minc2) * C2_SCALE; max_dist += tdist * tdist; } else { /* within cell range so no contribution to min_dist */ if (x <= centerc2) { tdist = (x - maxc2) * C2_SCALE; max_dist += tdist * tdist; } else { tdist = (x - minc2) * C2_SCALE; max_dist += tdist * tdist; } } mindist[i] = min_dist; /* save away the results */ if (max_dist < minmaxdist) minmaxdist = max_dist; } /* Now we know that no cell in the update box is more than minmaxdist * away from some colormap entry. Therefore, only colors that are * within minmaxdist of some part of the box need be considered. */ ncolors = 0; for (i = 0; i < numcolors; i++) { if (mindist[i] <= minmaxdist) colorlist[ncolors++] = (JSAMPLE) i; } return ncolors; } LOCAL (void) find_best_colors ( #ifdef ORIGINAL_LIB_JPEG j_decompress_ptr cinfo, #else gdImagePtr oim, gdImagePtr nim, my_cquantize_ptr cquantize, #endif int minc0, int minc1, int minc2, int numcolors, JSAMPLE colorlist[], JSAMPLE bestcolor[]) /* Find the closest colormap entry for each cell in the update box, * given the list of candidate colors prepared by find_nearby_colors. * Return the indexes of the closest entries in the bestcolor[] array. * This routine uses Thomas' incremental distance calculation method to * find the distance from a colormap entry to successive cells in the box. */ { int ic0, ic1, ic2; int i, icolor; register INT32 *bptr; /* pointer into bestdist[] array */ JSAMPLE *cptr; /* pointer into bestcolor[] array */ INT32 dist0, dist1; /* initial distance values */ register INT32 dist2; /* current distance in inner loop */ INT32 xx0, xx1; /* distance increments */ register INT32 xx2; INT32 inc0, inc1, inc2; /* initial values for increments */ /* This array holds the distance to the nearest-so-far color for each cell */ INT32 bestdist[BOX_C0_ELEMS * BOX_C1_ELEMS * BOX_C2_ELEMS]; /* Initialize best-distance for each cell of the update box */ bptr = bestdist; for (i = BOX_C0_ELEMS * BOX_C1_ELEMS * BOX_C2_ELEMS - 1; i >= 0; i--) *bptr++ = 0x7FFFFFFFL; /* For each color selected by find_nearby_colors, * compute its distance to the center of each cell in the box. * If that's less than best-so-far, update best distance and color number. */ /* Nominal steps between cell centers ("x" in Thomas article) */ #define STEP_C0 ((1 << C0_SHIFT) * C0_SCALE) #define STEP_C1 ((1 << C1_SHIFT) * C1_SCALE) #define STEP_C2 ((1 << C2_SHIFT) * C2_SCALE) for (i = 0; i < numcolors; i++) { int r, g, b; #ifdef ORIGINAL_LIB_JPEG icolor = GETJSAMPLE (colorlist[i]); r = GETJSAMPLE (cinfo->colormap[0][icolor]); g = GETJSAMPLE (cinfo->colormap[1][icolor]); b = GETJSAMPLE (cinfo->colormap[2][icolor]); #else icolor = colorlist[i]; r = nim->red[icolor]; g = nim->green[icolor]; b = nim->blue[icolor]; #endif /* Compute (square of) distance from minc0/c1/c2 to this color */ inc0 = (minc0 - r) * C0_SCALE; dist0 = inc0 * inc0; inc1 = (minc1 - g) * C1_SCALE; dist0 += inc1 * inc1; inc2 = (minc2 - b) * C2_SCALE; dist0 += inc2 * inc2; /* Form the initial difference increments */ inc0 = inc0 * (2 * STEP_C0) + STEP_C0 * STEP_C0; inc1 = inc1 * (2 * STEP_C1) + STEP_C1 * STEP_C1; inc2 = inc2 * (2 * STEP_C2) + STEP_C2 * STEP_C2; /* Now loop over all cells in box, updating distance per Thomas method */ bptr = bestdist; cptr = bestcolor; xx0 = inc0; for (ic0 = BOX_C0_ELEMS - 1; ic0 >= 0; ic0--) { dist1 = dist0; xx1 = inc1; for (ic1 = BOX_C1_ELEMS - 1; ic1 >= 0; ic1--) { dist2 = dist1; xx2 = inc2; for (ic2 = BOX_C2_ELEMS - 1; ic2 >= 0; ic2--) { if (dist2 < *bptr) { *bptr = dist2; *cptr = (JSAMPLE) icolor; } dist2 += xx2; xx2 += 2 * STEP_C2 * STEP_C2; bptr++; cptr++; } dist1 += xx1; xx1 += 2 * STEP_C1 * STEP_C1; } dist0 += xx0; xx0 += 2 * STEP_C0 * STEP_C0; } } } LOCAL (void) fill_inverse_cmap ( #ifdef ORIGINAL_LIB_JPEG j_decompress_ptr cinfo, #else gdImagePtr oim, gdImagePtr nim, my_cquantize_ptr cquantize, #endif int c0, int c1, int c2) /* Fill the inverse-colormap entries in the update box that contains */ /* histogram cell c0/c1/c2. (Only that one cell MUST be filled, but */ /* we can fill as many others as we wish.) */ { #ifdef ORIGINAL_LIB_JPEG my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; #endif hist3d histogram = cquantize->histogram; int minc0, minc1, minc2; /* lower left corner of update box */ int ic0, ic1, ic2; register JSAMPLE *cptr; /* pointer into bestcolor[] array */ register histptr cachep; /* pointer into main cache array */ /* This array lists the candidate colormap indexes. */ JSAMPLE colorlist[MAXNUMCOLORS]; int numcolors; /* number of candidate colors */ /* This array holds the actually closest colormap index for each cell. */ JSAMPLE bestcolor[BOX_C0_ELEMS * BOX_C1_ELEMS * BOX_C2_ELEMS]; /* Convert cell coordinates to update box ID */ c0 >>= BOX_C0_LOG; c1 >>= BOX_C1_LOG; c2 >>= BOX_C2_LOG; /* Compute true coordinates of update box's origin corner. * Actually we compute the coordinates of the center of the corner * histogram cell, which are the lower bounds of the volume we care about. */ minc0 = (c0 << BOX_C0_SHIFT) + ((1 << C0_SHIFT) >> 1); minc1 = (c1 << BOX_C1_SHIFT) + ((1 << C1_SHIFT) >> 1); minc2 = (c2 << BOX_C2_SHIFT) + ((1 << C2_SHIFT) >> 1); /* Determine which colormap entries are close enough to be candidates * for the nearest entry to some cell in the update box. */ #ifdef ORIGINAL_LIB_JPEG numcolors = find_nearby_colors (cinfo, minc0, minc1, minc2, colorlist); /* Determine the actually nearest colors. */ find_best_colors (cinfo, minc0, minc1, minc2, numcolors, colorlist, bestcolor); #else numcolors = find_nearby_colors (oim, nim, cquantize, minc0, minc1, minc2, colorlist); find_best_colors (oim, nim, cquantize, minc0, minc1, minc2, numcolors, colorlist, bestcolor); #endif /* Save the best color numbers (plus 1) in the main cache array */ c0 <<= BOX_C0_LOG; /* convert ID back to base cell indexes */ c1 <<= BOX_C1_LOG; c2 <<= BOX_C2_LOG; cptr = bestcolor; for (ic0 = 0; ic0 < BOX_C0_ELEMS; ic0++) { for (ic1 = 0; ic1 < BOX_C1_ELEMS; ic1++) { cachep = &histogram[c0 + ic0][c1 + ic1][c2]; for (ic2 = 0; ic2 < BOX_C2_ELEMS; ic2++) { #ifdef ORIGINAL_LIB_JPEG *cachep++ = (histcell) (GETJSAMPLE (*cptr++) + 1); #else *cachep++ = (histcell) ((*cptr++) + 1); #endif } } } } /* * Map some rows of pixels to the output colormapped representation. */ METHODDEF (void) #ifndef ORIGINAL_LIB_JPEG pass2_no_dither (gdImagePtr oim, gdImagePtr nim, my_cquantize_ptr cquantize) { register int *inptr; register unsigned char *outptr; int width = oim->sx; int num_rows = oim->sy; #else pass2_no_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows) /* This version performs no dithering */ { my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; register JSAMPROW inptr, outptr; JDIMENSION width = cinfo->output_width; #endif hist3d histogram = cquantize->histogram; register int c0, c1, c2; int row; JDIMENSION col; register histptr cachep; for (row = 0; row < num_rows; row++) { inptr = input_buf[row]; outptr = output_buf[row]; for (col = width; col > 0; col--) { /* get pixel value and index into the cache */ int r, g, b; #ifdef ORIGINAL_LIB_JPEG r = GETJSAMPLE (*inptr++); g = GETJSAMPLE (*inptr++); b = GETJSAMPLE (*inptr++); #else r = gdTrueColorGetRed (*inptr); g = gdTrueColorGetGreen (*inptr); /* 2.0.24: inptr must not be incremented until after transparency check, if any. Thanks to "Super Pikeman." */ b = gdTrueColorGetBlue (*inptr); /* If the pixel is transparent, we assign it the palette index that * will later be added at the end of the palette as the transparent * index. */ if ((oim->transparent >= 0) && (oim->transparent == *(inptr - 1))) { *outptr++ = nim->colorsTotal; inptr++; continue; } inptr++; #endif c0 = r >> C0_SHIFT; c1 = g >> C1_SHIFT; c2 = b >> C2_SHIFT; cachep = &histogram[c0][c1][c2]; /* If we have not seen this color before, find nearest colormap entry */ /* and update the cache */ if (*cachep == 0) #ifdef ORIGINAL_LIB_JPEG fill_inverse_cmap (cinfo, c0, c1, c2); #else fill_inverse_cmap (oim, nim, cquantize, c0, c1, c2); #endif /* Now emit the colormap index for this cell */ #ifdef ORIGINAL_LIB_JPEG *outptr++ = (JSAMPLE) (*cachep - 1); #else *outptr++ = (*cachep - 1); #endif } } } METHODDEF (void) #ifndef ORIGINAL_LIB_JPEG pass2_fs_dither (gdImagePtr oim, gdImagePtr nim, my_cquantize_ptr cquantize) { #else pass2_fs_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf, JSAMPARRAY output_buf, int num_rows) /* This version performs Floyd-Steinberg dithering */ { my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; JSAMPROW inptr; /* => current input pixel */ #endif hist3d histogram = cquantize->histogram; register LOCFSERROR cur0, cur1, cur2; /* current error or pixel value */ LOCFSERROR belowerr0, belowerr1, belowerr2; /* error for pixel below cur */ LOCFSERROR bpreverr0, bpreverr1, bpreverr2; /* error for below/prev col */ register FSERRPTR errorptr; /* => fserrors[] at column before current */ histptr cachep; int dir; /* +1 or -1 depending on direction */ int dir3; /* 3*dir, for advancing inptr & errorptr */ int row; JDIMENSION col; #ifdef ORIGINAL_LIB_JPEG JSAMPROW outptr; /* => current output pixel */ JDIMENSION width = cinfo->output_width; JSAMPLE *range_limit = cinfo->sample_range_limit; JSAMPROW colormap0 = cinfo->colormap[0]; JSAMPROW colormap1 = cinfo->colormap[1]; JSAMPROW colormap2 = cinfo->colormap[2]; #else int *inptr; /* => current input pixel */ unsigned char *outptr; /* => current output pixel */ int width = oim->sx; int num_rows = oim->sy; int *colormap0 = nim->red; int *colormap1 = nim->green; int *colormap2 = nim->blue; #endif int *error_limit = cquantize->error_limiter; SHIFT_TEMPS for (row = 0; row < num_rows; row++) { inptr = input_buf[row]; outptr = output_buf[row]; if (cquantize->on_odd_row) { /* work right to left in this row */ inptr += (width - 1) * 3; /* so point to rightmost pixel */ outptr += width - 1; dir = -1; dir3 = -3; errorptr = cquantize->fserrors + (width + 1) * 3; /* => entry after last column */ #ifdef ORIGINAL_LIB_JPEG_REVERSE_ODD_ROWS cquantize->on_odd_row = FALSE; /* flip for next time */ #endif } else { /* work left to right in this row */ dir = 1; dir3 = 3; errorptr = cquantize->fserrors; /* => entry before first real column */ #ifdef ORIGINAL_LIB_JPEG_REVERSE_ODD_ROWS cquantize->on_odd_row = TRUE; /* flip for next time */ #endif } /* Preset error values: no error propagated to first pixel from left */ cur0 = cur1 = cur2 = 0; /* and no error propagated to row below yet */ belowerr0 = belowerr1 = belowerr2 = 0; bpreverr0 = bpreverr1 = bpreverr2 = 0; for (col = width; col > 0; col--) { /* If this pixel is transparent, we want to assign it to the special * transparency color index past the end of the palette rather than * go through matching / dithering. */ if ((oim->transparent >= 0) && (*inptr == oim->transparent)) { *outptr = nim->colorsTotal; errorptr[0] = 0; errorptr[1] = 0; errorptr[2] = 0; errorptr[3] = 0; inptr += dir; outptr += dir; errorptr += dir3; continue; } /* curN holds the error propagated from the previous pixel on the * current line. Add the error propagated from the previous line * to form the complete error correction term for this pixel, and * round the error term (which is expressed * 16) to an integer. * RIGHT_SHIFT rounds towards minus infinity, so adding 8 is correct * for either sign of the error value. * Note: errorptr points to *previous* column's array entry. */ cur0 = RIGHT_SHIFT (cur0 + errorptr[dir3 + 0] + 8, 4); cur1 = RIGHT_SHIFT (cur1 + errorptr[dir3 + 1] + 8, 4); cur2 = RIGHT_SHIFT (cur2 + errorptr[dir3 + 2] + 8, 4); /* Limit the error using transfer function set by init_error_limit. * See comments with init_error_limit for rationale. */ cur0 = error_limit[cur0]; cur1 = error_limit[cur1]; cur2 = error_limit[cur2]; /* Form pixel value + error, and range-limit to 0..MAXJSAMPLE. * The maximum error is +- MAXJSAMPLE (or less with error limiting); * this sets the required size of the range_limit array. */ #ifdef ORIGINAL_LIB_JPEG cur0 += GETJSAMPLE (inptr[0]); cur1 += GETJSAMPLE (inptr[1]); cur2 += GETJSAMPLE (inptr[2]); cur0 = GETJSAMPLE (range_limit[cur0]); cur1 = GETJSAMPLE (range_limit[cur1]); cur2 = GETJSAMPLE (range_limit[cur2]); #else cur0 += gdTrueColorGetRed (*inptr); cur1 += gdTrueColorGetGreen (*inptr); cur2 += gdTrueColorGetBlue (*inptr); range_limit (cur0); range_limit (cur1); range_limit (cur2); #endif /* Index into the cache with adjusted pixel value */ cachep = &histogram[cur0 >> C0_SHIFT][cur1 >> C1_SHIFT][cur2 >> C2_SHIFT]; /* If we have not seen this color before, find nearest colormap */ /* entry and update the cache */ if (*cachep == 0) #ifdef ORIGINAL_LIB_JPEG fill_inverse_cmap (cinfo, cur0 >> C0_SHIFT, cur1 >> C1_SHIFT, cur2 >> C2_SHIFT); #else fill_inverse_cmap (oim, nim, cquantize, cur0 >> C0_SHIFT, cur1 >> C1_SHIFT, cur2 >> C2_SHIFT); #endif /* Now emit the colormap index for this cell */ { register int pixcode = *cachep - 1; *outptr = (JSAMPLE) pixcode; /* Compute representation error for this pixel */ #define GETJSAMPLE cur0 -= GETJSAMPLE (colormap0[pixcode]); cur1 -= GETJSAMPLE (colormap1[pixcode]); cur2 -= GETJSAMPLE (colormap2[pixcode]); #undef GETJSAMPLE } /* Compute error fractions to be propagated to adjacent pixels. * Add these into the running sums, and simultaneously shift the * next-line error sums left by 1 column. */ { register LOCFSERROR bnexterr, delta; bnexterr = cur0; /* Process component 0 */ delta = cur0 * 2; cur0 += delta; /* form error * 3 */ errorptr[0] = (FSERROR) (bpreverr0 + cur0); cur0 += delta; /* form error * 5 */ bpreverr0 = belowerr0 + cur0; belowerr0 = bnexterr; cur0 += delta; /* form error * 7 */ bnexterr = cur1; /* Process component 1 */ delta = cur1 * 2; cur1 += delta; /* form error * 3 */ errorptr[1] = (FSERROR) (bpreverr1 + cur1); cur1 += delta; /* form error * 5 */ bpreverr1 = belowerr1 + cur1; belowerr1 = bnexterr; cur1 += delta; /* form error * 7 */ bnexterr = cur2; /* Process component 2 */ delta = cur2 * 2; cur2 += delta; /* form error * 3 */ errorptr[2] = (FSERROR) (bpreverr2 + cur2); cur2 += delta; /* form error * 5 */ bpreverr2 = belowerr2 + cur2; belowerr2 = bnexterr; cur2 += delta; /* form error * 7 */ } /* At this point curN contains the 7/16 error value to be propagated * to the next pixel on the current line, and all the errors for the * next line have been shifted over. We are therefore ready to move on. */ #ifdef ORIGINAL_LIB_JPEG inptr += dir3; /* Advance pixel pointers to next column */ #else inptr += dir; /* Advance pixel pointers to next column */ #endif outptr += dir; errorptr += dir3; /* advance errorptr to current column */ } /* Post-loop cleanup: we must unload the final error values into the * final fserrors[] entry. Note we need not unload belowerrN because * it is for the dummy column before or after the actual array. */ errorptr[0] = (FSERROR) bpreverr0; /* unload prev errs into array */ errorptr[1] = (FSERROR) bpreverr1; errorptr[2] = (FSERROR) bpreverr2; } } /* * Initialize the error-limiting transfer function (lookup table). * The raw F-S error computation can potentially compute error values of up to * +- MAXJSAMPLE. But we want the maximum correction applied to a pixel to be * much less, otherwise obviously wrong pixels will be created. (Typical * effects include weird fringes at color-area boundaries, isolated bright * pixels in a dark area, etc.) The standard advice for avoiding this problem * is to ensure that the "corners" of the color cube are allocated as output * colors; then repeated errors in the same direction cannot cause cascading * error buildup. However, that only prevents the error from getting * completely out of hand; Aaron Giles reports that error limiting improves * the results even with corner colors allocated. * A simple clamping of the error values to about +- MAXJSAMPLE/8 works pretty * well, but the smoother transfer function used below is even better. Thanks * to Aaron Giles for this idea. */ LOCAL (void) #ifdef ORIGINAL_LIB_JPEG init_error_limit (j_decompress_ptr cinfo) #else init_error_limit (gdImagePtr oim, gdImagePtr nim, my_cquantize_ptr cquantize) #endif /* Allocate and fill in the error_limiter table */ { int *table; int in, out; #ifdef ORIGINAL_LIB_JPEG my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; table = (int *) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, (MAXJSAMPLE * 2 + 1) * SIZEOF (int)); #else cquantize->error_limiter_storage = (int *) safe_emalloc ((MAXJSAMPLE * 2 + 1), sizeof (int), 0); if (!cquantize->error_limiter_storage) { return; } table = cquantize->error_limiter_storage; #endif table += MAXJSAMPLE; /* so can index -MAXJSAMPLE .. +MAXJSAMPLE */ cquantize->error_limiter = table; #define STEPSIZE ((MAXJSAMPLE+1)/16) /* Map errors 1:1 up to +- MAXJSAMPLE/16 */ out = 0; for (in = 0; in < STEPSIZE; in++, out++) { table[in] = out; table[-in] = -out; } /* Map errors 1:2 up to +- 3*MAXJSAMPLE/16 */ for (; in < STEPSIZE * 3; in++, out += (in & 1) ? 0 : 1) { table[in] = out; table[-in] = -out; } /* Clamp the rest to final out value (which is (MAXJSAMPLE+1)/8) */ for (; in <= MAXJSAMPLE; in++) { table[in] = out; table[-in] = -out; } #undef STEPSIZE } /* * Finish up at the end of each pass. */ #ifdef ORIGINAL_LIB_JPEG METHODDEF (void) finish_pass1 (j_decompress_ptr cinfo) { my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; /* Select the representative colors and fill in cinfo->colormap */ cinfo->colormap = cquantize->sv_colormap; select_colors (cinfo, cquantize->desired); /* Force next pass to zero the color index table */ cquantize->needs_zeroed = TRUE; } METHODDEF (void) finish_pass2 (j_decompress_ptr cinfo) { /* no work */ } /* * Initialize for each processing pass. */ METHODDEF (void) start_pass_2_quant (j_decompress_ptr cinfo, boolean is_pre_scan) { my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; hist3d histogram = cquantize->histogram; int i; /* Only F-S dithering or no dithering is supported. */ /* If user asks for ordered dither, give him F-S. */ if (cinfo->dither_mode != JDITHER_NONE) cinfo->dither_mode = JDITHER_FS; if (is_pre_scan) { /* Set up method pointers */ cquantize->pub.color_quantize = prescan_quantize; cquantize->pub.finish_pass = finish_pass1; cquantize->needs_zeroed = TRUE; /* Always zero histogram */ } else { /* Set up method pointers */ if (cinfo->dither_mode == JDITHER_FS) cquantize->pub.color_quantize = pass2_fs_dither; else cquantize->pub.color_quantize = pass2_no_dither; cquantize->pub.finish_pass = finish_pass2; /* Make sure color count is acceptable */ i = cinfo->actual_number_of_colors; if (i < 1) ERREXIT1 (cinfo, JERR_QUANT_FEW_COLORS, 1); if (i > MAXNUMCOLORS) ERREXIT1 (cinfo, JERR_QUANT_MANY_COLORS, MAXNUMCOLORS); if (cinfo->dither_mode == JDITHER_FS) { size_t arraysize = (size_t) ((cinfo->output_width + 2) * (3 * SIZEOF (FSERROR))); /* Allocate Floyd-Steinberg workspace if we didn't already. */ if (cquantize->fserrors == NULL) cquantize->fserrors = (FSERRPTR) (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE, arraysize); /* Initialize the propagated errors to zero. */ jzero_far ((void FAR *) cquantize->fserrors, arraysize); /* Make the error-limit table if we didn't already. */ if (cquantize->error_limiter == NULL) init_error_limit (cinfo); cquantize->on_odd_row = FALSE; } } /* Zero the histogram or inverse color map, if necessary */ if (cquantize->needs_zeroed) { for (i = 0; i < HIST_C0_ELEMS; i++) { jzero_far ((void FAR *) histogram[i], HIST_C1_ELEMS * HIST_C2_ELEMS * SIZEOF (histcell)); } cquantize->needs_zeroed = FALSE; } } /* * Switch to a new external colormap between output passes. */ METHODDEF (void) new_color_map_2_quant (j_decompress_ptr cinfo) { my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; /* Reset the inverse color map */ cquantize->needs_zeroed = TRUE; } #else static void zeroHistogram (hist3d histogram) { int i; /* Zero the histogram or inverse color map */ for (i = 0; i < HIST_C0_ELEMS; i++) { memset (histogram[i], 0, HIST_C1_ELEMS * HIST_C2_ELEMS * sizeof (histcell)); } } #endif static void gdImageTrueColorToPaletteBody (gdImagePtr oim, int dither, int colorsWanted, gdImagePtr *cimP); gdImagePtr gdImageCreatePaletteFromTrueColor (gdImagePtr im, int dither, int colorsWanted) { gdImagePtr nim; gdImageTrueColorToPaletteBody(im, dither, colorsWanted, &nim); return nim; } void gdImageTrueColorToPalette (gdImagePtr im, int dither, int colorsWanted) { gdImageTrueColorToPaletteBody(im, dither, colorsWanted, 0); } /* * Module initialization routine for 2-pass color quantization. */ #ifdef ORIGINAL_LIB_JPEG GLOBAL (void) jinit_2pass_quantizer (j_decompress_ptr cinfo) #else static void gdImageTrueColorToPaletteBody (gdImagePtr oim, int dither, int colorsWanted, gdImagePtr *cimP) #endif { my_cquantize_ptr cquantize = NULL; int i; #ifndef ORIGINAL_LIB_JPEG /* Allocate the JPEG palette-storage */ size_t arraysize; int maxColors = gdMaxColors; gdImagePtr nim; if (cimP) { nim = gdImageCreate(oim->sx, oim->sy); *cimP = nim; if (!nim) { return; } } else { nim = oim; } if (!oim->trueColor) { /* (Almost) nothing to do! */ if (cimP) { gdImageCopy(nim, oim, 0, 0, 0, 0, oim->sx, oim->sy); *cimP = nim; } return; } /* If we have a transparent color (the alphaless mode of transparency), we * must reserve a palette entry for it at the end of the palette. */ if (oim->transparent >= 0) { maxColors--; } if (colorsWanted > maxColors) { colorsWanted = maxColors; } if (!cimP) { nim->pixels = gdCalloc (sizeof (unsigned char *), oim->sy); if (!nim->pixels) { /* No can do */ goto outOfMemory; } for (i = 0; (i < nim->sy); i++) { nim->pixels[i] = gdCalloc (sizeof (unsigned char *), oim->sx); if (!nim->pixels[i]) { goto outOfMemory; } } } #endif #ifdef ORIGINAL_LIB_JPEG cquantize = (my_cquantize_ptr) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF (my_cquantizer)); cinfo->cquantize = (struct jpeg_color_quantizer *) cquantize; cquantize->pub.start_pass = start_pass_2_quant; cquantize->pub.new_color_map = new_color_map_2_quant; /* Make sure jdmaster didn't give me a case I can't handle */ if (cinfo->out_color_components != 3) ERREXIT (cinfo, JERR_NOTIMPL); #else cquantize = (my_cquantize_ptr) gdCalloc (sizeof (my_cquantizer), 1); if (!cquantize) { /* No can do */ goto outOfMemory; } #endif cquantize->fserrors = NULL; /* flag optional arrays not allocated */ cquantize->error_limiter = NULL; /* Allocate the histogram/inverse colormap storage */ #ifdef ORIGINAL_LIB_JPEG cquantize->histogram = (hist3d) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, HIST_C0_ELEMS * SIZEOF (hist2d)); for (i = 0; i < HIST_C0_ELEMS; i++) { cquantize->histogram[i] = (hist2d) (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE, HIST_C1_ELEMS * HIST_C2_ELEMS * SIZEOF (histcell)); } cquantize->needs_zeroed = TRUE; /* histogram is garbage now */ #else cquantize->histogram = (hist3d) safe_emalloc (HIST_C0_ELEMS, sizeof (hist2d), 0); for (i = 0; i < HIST_C0_ELEMS; i++) { cquantize->histogram[i] = (hist2d) safe_emalloc (HIST_C1_ELEMS * HIST_C2_ELEMS, sizeof (histcell), 0); if (!cquantize->histogram[i]) { goto outOfMemory; } } #endif #ifdef ORIGINAL_LIB_JPEG /* Allocate storage for the completed colormap, if required. * We do this now since it is FAR storage and may affect * the memory manager's space calculations. */ if (cinfo->enable_2pass_quant) { /* Make sure color count is acceptable */ int desired = cinfo->desired_number_of_colors; /* Lower bound on # of colors ... somewhat arbitrary as long as > 0 */ if (desired < 8) ERREXIT1 (cinfo, JERR_QUANT_FEW_COLORS, 8); /* Make sure colormap indexes can be represented by JSAMPLEs */ if (desired > MAXNUMCOLORS) ERREXIT1 (cinfo, JERR_QUANT_MANY_COLORS, MAXNUMCOLORS); cquantize->sv_colormap = (*cinfo->mem->alloc_sarray) ((j_common_ptr) cinfo, JPOOL_IMAGE, (JDIMENSION) desired, (JDIMENSION) 3); cquantize->desired = desired; } else cquantize->sv_colormap = NULL; /* Only F-S dithering or no dithering is supported. */ /* If user asks for ordered dither, give him F-S. */ if (cinfo->dither_mode != JDITHER_NONE) cinfo->dither_mode = JDITHER_FS; /* Allocate Floyd-Steinberg workspace if necessary. * This isn't really needed until pass 2, but again it is FAR storage. * Although we will cope with a later change in dither_mode, * we do not promise to honor max_memory_to_use if dither_mode changes. */ if (cinfo->dither_mode == JDITHER_FS) { cquantize->fserrors = (FSERRPTR) (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE, (size_t) ((cinfo->output_width + 2) * (3 * SIZEOF (FSERROR)))); /* Might as well create the error-limiting table too. */ init_error_limit (cinfo); } #else cquantize->fserrors = (FSERRPTR) safe_emalloc (3, sizeof (FSERROR), 0); init_error_limit (oim, nim, cquantize); arraysize = (size_t) ((nim->sx + 2) * (3 * sizeof (FSERROR))); /* Allocate Floyd-Steinberg workspace. */ cquantize->fserrors = gdRealloc(cquantize->fserrors, arraysize); memset(cquantize->fserrors, 0, arraysize); if (!cquantize->fserrors) { goto outOfMemory; } cquantize->on_odd_row = FALSE; /* Do the work! */ zeroHistogram (cquantize->histogram); prescan_quantize (oim, nim, cquantize); /* TBB 2.0.5: pass colorsWanted, not 256! */ select_colors (oim, nim, cquantize, colorsWanted); zeroHistogram (cquantize->histogram); if (dither) { pass2_fs_dither (oim, nim, cquantize); } else { pass2_no_dither (oim, nim, cquantize); } #if 0 /* 2.0.12; we no longer attempt full alpha in palettes */ if (cquantize->transparentIsPresent) { int mt = -1; int mtIndex = -1; for (i = 0; (i < im->colorsTotal); i++) { if (im->alpha[i] > mt) { mtIndex = i; mt = im->alpha[i]; } } for (i = 0; (i < im->colorsTotal); i++) { if (im->alpha[i] == mt) { im->alpha[i] = gdAlphaTransparent; } } } if (cquantize->opaqueIsPresent) { int mo = 128; int moIndex = -1; for (i = 0; (i < im->colorsTotal); i++) { if (im->alpha[i] < mo) { moIndex = i; mo = im->alpha[i]; } } for (i = 0; (i < im->colorsTotal); i++) { if (im->alpha[i] == mo) { im->alpha[i] = gdAlphaOpaque; } } } #endif /* If we had a 'transparent' color, increment the color count so it's * officially in the palette and convert the transparent variable to point to * an index rather than a color (Its data already exists and transparent * pixels have already been mapped to it by this point, it is done late as to * avoid color matching / dithering with it). */ if (oim->transparent >= 0) { nim->transparent = nim->colorsTotal; nim->colorsTotal++; } /* Success! Get rid of the truecolor image data. */ if (!cimP) { oim->trueColor = 0; /* Junk the truecolor pixels */ for (i = 0; i < oim->sy; i++) { gdFree (oim->tpixels[i]); } gdFree (oim->tpixels); oim->tpixels = 0; } goto success; /* Tediously free stuff. */ outOfMemory: if (oim->trueColor) { if (!cimP) { /* On failure only */ for (i = 0; i < nim->sy; i++) { if (nim->pixels[i]) { gdFree (nim->pixels[i]); } } if (nim->pixels) { gdFree (nim->pixels); } nim->pixels = 0; } else { gdImageDestroy(nim); *cimP = 0; } } success: for (i = 0; i < HIST_C0_ELEMS; i++) { if (cquantize->histogram[i]) { gdFree (cquantize->histogram[i]); } } if (cquantize->histogram) { gdFree (cquantize->histogram); } if (cquantize->fserrors) { gdFree (cquantize->fserrors); } if (cquantize->error_limiter_storage) { gdFree (cquantize->error_limiter_storage); } if (cquantize) { gdFree (cquantize); } #endif } /* bring the palette colors in im2 to be closer to im1 * */ int gdImageColorMatch (gdImagePtr im1, gdImagePtr im2) { unsigned long *buf; /* stores our calculations */ unsigned long *bp; /* buf ptr */ int color, rgb; int x,y; int count; if( !im1->trueColor ) { return -1; /* im1 must be True Color */ } if( im2->trueColor ) { return -2; /* im2 must be indexed */ } if( (im1->sx != im2->sx) || (im1->sy != im2->sy) ) { return -3; /* the images are meant to be the same dimensions */ } buf = (unsigned long *)safe_emalloc(sizeof(unsigned long), 5 * im2->colorsTotal, 0); memset( buf, 0, sizeof(unsigned long) * 5 * im2->colorsTotal ); for (x=0; xsx; x++) { for( y=0; ysy; y++ ) { color = im2->pixels[y][x]; rgb = im1->tpixels[y][x]; bp = buf + (color * 5); (*(bp++))++; *(bp++) += gdTrueColorGetRed(rgb); *(bp++) += gdTrueColorGetGreen(rgb); *(bp++) += gdTrueColorGetBlue(rgb); *(bp++) += gdTrueColorGetAlpha(rgb); } } bp = buf; for (color=0; colorcolorsTotal; color++) { count = *(bp++); if( count > 0 ) { im2->red[color] = *(bp++) / count; im2->green[color] = *(bp++) / count; im2->blue[color] = *(bp++) / count; im2->alpha[color] = *(bp++) / count; } else { bp += 4; } } gdFree(buf); return 0; } #endif php-4.4.8/ext/gd/libgd/gdcache.c0000644000175000017500000001205607643610500015604 0ustar derickderick#include "gd.h" #include "gdhelpers.h" #ifdef HAVE_LIBTTF #define NEED_CACHE 1 #else #ifdef HAVE_LIBFREETYPE #define NEED_CACHE 1 #endif #endif #ifdef NEED_CACHE /* * gdcache.c * * Caches of pointers to user structs in which the least-recently-used * element is replaced in the event of a cache miss after the cache has * reached a given size. * * John Ellson (ellson@graphviz.org) Oct 31, 1997 * * Test this with: * gcc -o gdcache -g -Wall -DTEST gdcache.c * * The cache is implemented by a singly-linked list of elements * each containing a pointer to a user struct that is being managed by * the cache. * * The head structure has a pointer to the most-recently-used * element, and elements are moved to this position in the list each * time they are used. The head also contains pointers to three * user defined functions: * - a function to test if a cached userdata matches some keydata * - a function to provide a new userdata struct to the cache * if there has been a cache miss. * - a function to release a userdata struct when it is * no longer being managed by the cache * * In the event of a cache miss the cache is allowed to grow up to * a specified maximum size. After the maximum size is reached then * the least-recently-used element is discarded to make room for the * new. The most-recently-returned value is always left at the * beginning of the list after retrieval. * * In the current implementation the cache is traversed by a linear * search from most-recent to least-recent. This linear search * probably limits the usefulness of this implementation to cache * sizes of a few tens of elements. */ #include "gdcache.h" /*********************************************************/ /* implementation */ /*********************************************************/ /* create a new cache */ gdCache_head_t * gdCacheCreate ( int size, gdCacheTestFn_t gdCacheTest, gdCacheFetchFn_t gdCacheFetch, gdCacheReleaseFn_t gdCacheRelease) { gdCache_head_t *head; head = (gdCache_head_t *) gdPMalloc(sizeof (gdCache_head_t)); head->mru = NULL; head->size = size; head->gdCacheTest = gdCacheTest; head->gdCacheFetch = gdCacheFetch; head->gdCacheRelease = gdCacheRelease; return head; } void gdCacheDelete (gdCache_head_t * head) { gdCache_element_t *elem, *prev; elem = head->mru; while (elem) { (*(head->gdCacheRelease)) (elem->userdata); prev = elem; elem = elem->next; gdPFree ((char *) prev); } gdPFree ((char *) head); } void * gdCacheGet (gdCache_head_t * head, void *keydata) { int i = 0; gdCache_element_t *elem, *prev = NULL, *prevprev = NULL; void *userdata; elem = head->mru; while (elem) { if ((*(head->gdCacheTest)) (elem->userdata, keydata)) { if (i) { /* if not already most-recently-used */ /* relink to top of list */ prev->next = elem->next; elem->next = head->mru; head->mru = elem; } return elem->userdata; } prevprev = prev; prev = elem; elem = elem->next; i++; } userdata = (*(head->gdCacheFetch)) (&(head->error), keydata); if (!userdata) { /* if there was an error in the fetch then don't cache */ return NULL; } if (i < head->size) { /* cache still growing - add new elem */ elem = (gdCache_element_t *) gdPMalloc(sizeof (gdCache_element_t)); } else { /* cache full - replace least-recently-used */ /* preveprev becomes new end of list */ prevprev->next = NULL; elem = prev; (*(head->gdCacheRelease)) (elem->userdata); } /* relink to top of list */ elem->next = head->mru; head->mru = elem; elem->userdata = userdata; return userdata; } /*********************************************************/ /* test stub */ /*********************************************************/ #ifdef TEST #include typedef struct { int key; int value; } key_value_t; static int cacheTest (void *map, void *key) { return (((key_value_t *) map)->key == *(int *) key); } static void * cacheFetch (char **error, void *key) { key_value_t *map; map = (key_value_t *) gdMalloc (sizeof (key_value_t)); map->key = *(int *) key; map->value = 3; *error = NULL; return (void *) map; } static void cacheRelease (void *map) { gdFree ((char *) map); } int main (char *argv[], int argc) { gdCache_head_t *cacheTable; int elem, key; cacheTable = gdCacheCreate (3, cacheTest, cacheFetch, cacheRelease); key = 20; elem = *(int *) gdCacheGet (cacheTable, &key); key = 30; elem = *(int *) gdCacheGet (cacheTable, &key); key = 40; elem = *(int *) gdCacheGet (cacheTable, &key); key = 50; elem = *(int *) gdCacheGet (cacheTable, &key); key = 30; elem = *(int *) gdCacheGet (cacheTable, &key); key = 30; elem = *(int *) gdCacheGet (cacheTable, &key); gdCacheDelete (cacheTable); return 0; } #endif /* TEST */ #endif /* HAVE_LIBTTF */ php-4.4.8/ext/gd/libgd/gdcache.h0000644000175000017500000000524407643610500015612 0ustar derickderick/* * gdcache.h * * Caches of pointers to user structs in which the least-recently-used * element is replaced in the event of a cache miss after the cache has * reached a given size. * * John Ellson (ellson@graphviz.org) Oct 31, 1997 * * Test this with: * gcc -o gdcache -g -Wall -DTEST gdcache.c * * The cache is implemented by a singly-linked list of elements * each containing a pointer to a user struct that is being managed by * the cache. * * The head structure has a pointer to the most-recently-used * element, and elements are moved to this position in the list each * time they are used. The head also contains pointers to three * user defined functions: * - a function to test if a cached userdata matches some keydata * - a function to provide a new userdata struct to the cache * if there has been a cache miss. * - a function to release a userdata struct when it is * no longer being managed by the cache * * In the event of a cache miss the cache is allowed to grow up to * a specified maximum size. After the maximum size is reached then * the least-recently-used element is discarded to make room for the * new. The most-recently-returned value is always left at the * beginning of the list after retrieval. * * In the current implementation the cache is traversed by a linear * search from most-recent to least-recent. This linear search * probably limits the usefulness of this implementation to cache * sizes of a few tens of elements. */ /*********************************************************/ /* header */ /*********************************************************/ #include #ifdef HAVE_MALLOC_H #include #endif #ifndef NULL #define NULL (void *)0 #endif /* user defined function templates */ typedef int (*gdCacheTestFn_t)(void *userdata, void *keydata); typedef void *(*gdCacheFetchFn_t)(char **error, void *keydata); typedef void (*gdCacheReleaseFn_t)(void *userdata); /* element structure */ typedef struct gdCache_element_s gdCache_element_t; struct gdCache_element_s { gdCache_element_t *next; void *userdata; }; /* head structure */ typedef struct gdCache_head_s gdCache_head_t; struct gdCache_head_s { gdCache_element_t *mru; int size; char *error; gdCacheTestFn_t gdCacheTest; gdCacheFetchFn_t gdCacheFetch; gdCacheReleaseFn_t gdCacheRelease; }; /* function templates */ gdCache_head_t * gdCacheCreate( int size, gdCacheTestFn_t gdCacheTest, gdCacheFetchFn_t gdCacheFetch, gdCacheReleaseFn_t gdCacheRelease ); void gdCacheDelete( gdCache_head_t *head ); void * gdCacheGet( gdCache_head_t *head, void *keydata ); php-4.4.8/ext/gd/libgd/pngtogd.c0000644000175000017500000000170707455710735015705 0ustar derickderick #include #include "gd.h" /* A short program which converts a .png file into a .gd file, for your convenience in creating images on the fly from a basis image that must be loaded quickly. The .gd format is not intended to be a general-purpose format. */ int main (int argc, char **argv) { gdImagePtr im; FILE *in, *out; if (argc != 3) { fprintf (stderr, "Usage: pngtogd filename.png filename.gd\n"); exit (1); } in = fopen (argv[1], "rb"); if (!in) { fprintf (stderr, "Input file does not exist!\n"); exit (1); } im = gdImageCreateFromPng (in); fclose (in); if (!im) { fprintf (stderr, "Input is not in PNG format!\n"); exit (1); } out = fopen (argv[2], "wb"); if (!out) { fprintf (stderr, "Output file cannot be written to!\n"); gdImageDestroy (im); exit (1); } gdImageGd (im, out); fclose (out); gdImageDestroy (im); return 0; } php-4.4.8/ext/gd/libgd/gdtest.c0000644000175000017500000002207007557612321015524 0ustar derickderick#include #ifdef _WIN32 #include int unlink (const char *filename) { return _unlink (filename); } #else #include /* for getpid(), unlink() */ #endif #include "gd.h" void CompareImages (char *msg, gdImagePtr im1, gdImagePtr im2); static int freadWrapper (void *context, char *buf, int len); static int fwriteWrapper (void *context, const char *buffer, int len); int main (int argc, char **argv) { gdImagePtr im, ref, im2, im3; FILE *in, *out; void *iptr; int sz; gdIOCtxPtr ctx; char of[256]; int colRed, colBlu; gdSource imgsrc; gdSink imgsnk; int foreground; int i; if (argc != 2) { fprintf (stderr, "Usage: gdtest filename.png\n"); exit (1); } in = fopen (argv[1], "rb"); if (!in) { fprintf (stderr, "Input file does not exist!\n"); exit (1); } im = gdImageCreateFromPng (in); rewind (in); ref = gdImageCreateFromPng (in); fclose (in); printf ("Reference File has %d Palette entries\n", ref->colorsTotal); CompareImages ("Initial Versions", ref, im); /* */ /* Send to PNG File then Ptr */ /* */ sprintf (of, "%s.png", argv[1]); out = fopen (of, "wb"); gdImagePng (im, out); fclose (out); in = fopen (of, "rb"); if (!in) { fprintf (stderr, "PNG Output file does not exist!\n"); exit (1); } im2 = gdImageCreateFromPng (in); fclose (in); CompareImages ("GD->PNG File->GD", ref, im2); unlink (of); gdImageDestroy (im2); iptr = gdImagePngPtr (im, &sz); ctx = gdNewDynamicCtx (sz, iptr); im2 = gdImageCreateFromPngCtx (ctx); CompareImages ("GD->PNG ptr->GD", ref, im2); gdImageDestroy (im2); ctx->gd_free (ctx); /* */ /* Send to GD2 File then Ptr */ /* */ sprintf (of, "%s.gd2", argv[1]); out = fopen (of, "wb"); gdImageGd2 (im, out, 128, 2); fclose (out); in = fopen (of, "rb"); if (!in) { fprintf (stderr, "GD2 Output file does not exist!\n"); exit (1); } im2 = gdImageCreateFromGd2 (in); fclose (in); CompareImages ("GD->GD2 File->GD", ref, im2); unlink (of); gdImageDestroy (im2); iptr = gdImageGd2Ptr (im, 128, 2, &sz); /*printf("Got ptr %d (size %d)\n",iptr, sz); */ ctx = gdNewDynamicCtx (sz, iptr); /*printf("Got ctx %d\n",ctx); */ im2 = gdImageCreateFromGd2Ctx (ctx); /*printf("Got img2 %d\n",im2); */ CompareImages ("GD->GD2 ptr->GD", ref, im2); gdImageDestroy (im2); ctx->gd_free (ctx); /* */ /* Send to GD File then Ptr */ /* */ sprintf (of, "%s.gd", argv[1]); out = fopen (of, "wb"); gdImageGd (im, out); fclose (out); in = fopen (of, "rb"); if (!in) { fprintf (stderr, "GD Output file does not exist!\n"); exit (1); } im2 = gdImageCreateFromGd (in); fclose (in); CompareImages ("GD->GD File->GD", ref, im2); unlink (of); gdImageDestroy (im2); iptr = gdImageGdPtr (im, &sz); /*printf("Got ptr %d (size %d)\n",iptr, sz); */ ctx = gdNewDynamicCtx (sz, iptr); /*printf("Got ctx %d\n",ctx); */ im2 = gdImageCreateFromGdCtx (ctx); /*printf("Got img2 %d\n",im2); */ CompareImages ("GD->GD ptr->GD", ref, im2); gdImageDestroy (im2); ctx->gd_free (ctx); /* ** Test gdImageCreateFromPngSource' * */ in = fopen (argv[1], "rb"); imgsrc.source = freadWrapper; imgsrc.context = in; im2 = gdImageCreateFromPngSource (&imgsrc); fclose (in); if (im2 == NULL) { printf ("GD Source: ERROR Null returned by gdImageCreateFromPngSource\n"); } else { CompareImages ("GD Source", ref, im2); gdImageDestroy (im2); }; /* ** Test gdImagePngToSink' * */ sprintf (of, "%s.snk", argv[1]); out = fopen (of, "wb"); imgsnk.sink = fwriteWrapper; imgsnk.context = out; gdImagePngToSink (im, &imgsnk); fclose (out); in = fopen (of, "rb"); if (!in) { fprintf (stderr, "GD Sink: ERROR - GD Sink Output file does not exist!\n"); } else { im2 = gdImageCreateFromPng (in); fclose (in); CompareImages ("GD Sink", ref, im2); gdImageDestroy (im2); }; unlink (of); /* */ /* Test Extraction */ /* */ in = fopen ("test/gdtest_200_300_150_100.png", "rb"); if (!in) { fprintf (stderr, "gdtest_200_300_150_100.png does not exist!\n"); exit (1); } im2 = gdImageCreateFromPng (in); fclose (in); in = fopen ("test/gdtest.gd2", "rb"); if (!in) { fprintf (stderr, "gdtest.gd2 does not exist!\n"); exit (1); } im3 = gdImageCreateFromGd2Part (in, 200, 300, 150, 100); fclose (in); CompareImages ("GD2Part (gdtest_200_300_150_100.png, gdtest.gd2(part))", im2, im3); gdImageDestroy (im2); gdImageDestroy (im3); /* */ /* Copy Blend */ /* */ in = fopen ("test/gdtest.png", "rb"); if (!in) { fprintf (stderr, "gdtest.png does not exist!\n"); exit (1); } im2 = gdImageCreateFromPng (in); fclose (in); im3 = gdImageCreate (100, 60); colRed = gdImageColorAllocate (im3, 255, 0, 0); colBlu = gdImageColorAllocate (im3, 0, 0, 255); gdImageFilledRectangle (im3, 0, 0, 49, 30, colRed); gdImageFilledRectangle (im3, 50, 30, 99, 59, colBlu); gdImageCopyMerge (im2, im3, 150, 200, 10, 10, 90, 50, 50); gdImageCopyMerge (im2, im3, 180, 70, 10, 10, 90, 50, 50); gdImageCopyMergeGray (im2, im3, 250, 160, 10, 10, 90, 50, 50); gdImageCopyMergeGray (im2, im3, 80, 70, 10, 10, 90, 50, 50); gdImageDestroy (im3); in = fopen ("test/gdtest_merge.png", "rb"); if (!in) { fprintf (stderr, "gdtest_merge.png does not exist!\n"); exit (1); } im3 = gdImageCreateFromPng (in); fclose (in); printf ("[Merged Image has %d colours]\n", im2->colorsTotal); CompareImages ("Merged (gdtest.png, gdtest_merge.png)", im2, im3); gdImageDestroy (im2); gdImageDestroy (im3); #ifdef HAVE_JPEG out = fopen ("test/gdtest.jpg", "wb"); if (!out) { fprintf (stderr, "Can't create file test/gdtest.jpg.\n"); exit (1); } gdImageJpeg (im, out, -1); fclose (out); in = fopen ("test/gdtest.jpg", "rb"); if (!in) { fprintf (stderr, "Can't open file test/gdtest.jpg.\n"); exit (1); } im2 = gdImageCreateFromJpeg (in); fclose (in); if (!im2) { fprintf (stderr, "gdImageCreateFromJpeg failed.\n"); exit (1); } gdImageDestroy (im2); printf ("Created test/gdtest.jpg successfully. Compare this image\n" "to the input image manually. Some difference must be\n" "expected as JPEG is a lossy file format.\n"); #endif /* HAVE_JPEG */ /* Assume the color closest to black is the foreground color for the B&W wbmp image. */ fprintf (stderr, "NOTE: the WBMP output image will NOT match the original unless the original\n" "is also black and white. This is OK!\n"); foreground = gdImageColorClosest (im, 0, 0, 0); fprintf (stderr, "Foreground index is %d\n", foreground); if (foreground == -1) { fprintf (stderr, "Source image has no colors, skipping wbmp test.\n"); } else { out = fopen ("test/gdtest.wbmp", "wb"); if (!out) { fprintf (stderr, "Can't create file test/gdtest.wbmp.\n"); exit (1); } gdImageWBMP (im, foreground, out); fclose (out); in = fopen ("test/gdtest.wbmp", "rb"); if (!in) { fprintf (stderr, "Can't open file test/gdtest.wbmp.\n"); exit (1); } im2 = gdImageCreateFromWBMP (in); fprintf (stderr, "WBMP has %d colors\n", gdImageColorsTotal (im2)); fprintf (stderr, "WBMP colors are:\n"); for (i = 0; (i < gdImageColorsTotal (im2)); i++) { fprintf (stderr, "%02X%02X%02X\n", gdImageRed (im2, i), gdImageGreen (im2, i), gdImageBlue (im2, i)); } fclose (in); if (!im2) { fprintf (stderr, "gdImageCreateFromWBMP failed.\n"); exit (1); } CompareImages ("WBMP test (gdtest.png, gdtest.wbmp)", ref, im2); out = fopen ("test/gdtest_wbmp_to_png.png", "wb"); if (!out) { fprintf (stderr, "Can't create file test/gdtest_wbmp_to_png.png.\n"); exit (1); } gdImagePng (im2, out); fclose (out); gdImageDestroy (im2); } gdImageDestroy (im); gdImageDestroy (ref); return 0; } void CompareImages (char *msg, gdImagePtr im1, gdImagePtr im2) { int cmpRes; cmpRes = gdImageCompare (im1, im2); if (cmpRes & GD_CMP_IMAGE) { printf ("%%%s: ERROR images differ: BAD\n", msg); } else if (cmpRes != 0) { printf ("%%%s: WARNING images differ: WARNING - Probably OK\n", msg); } else { printf ("%%%s: OK\n", msg); return; } if (cmpRes & (GD_CMP_SIZE_X + GD_CMP_SIZE_Y)) { printf ("-%s: INFO image sizes differ\n", msg); } if (cmpRes & GD_CMP_NUM_COLORS) { printf ("-%s: INFO number of pallette entries differ %d Vs. %d\n", msg, im1->colorsTotal, im2->colorsTotal); } if (cmpRes & GD_CMP_COLOR) { printf ("-%s: INFO actual colours of pixels differ\n", msg); } } static int freadWrapper (void *context, char *buf, int len) { int got = fread (buf, 1, len, (FILE *) context); return got; } static int fwriteWrapper (void *context, const char *buffer, int len) { return fwrite (buffer, 1, len, (FILE *) context); } php-4.4.8/ext/gd/libgd/testac.c0000644000175000017500000001017007455710735015520 0ustar derickderick #include #include "gd.h" /* If palette is true, we convert from truecolor to palette at the end, to test gdImageTrueColorToPalette and see file size/ quality tradeoffs. */ void testDrawing ( gdImagePtr im_in, double scale, int blending, int palette, char *filename); int main (int argc, char *argv[]) { /* Input and output files */ FILE *in; FILE *out; /* Input image */ gdImagePtr im_in = 0; /* Colors */ int lightBlue; if (argc != 2) { fprintf (stderr, "Usage: testac filename.png\n"); exit (1); } /* Load original PNG, which should contain alpha channel information. We will use it in two ways: preserving it literally, for use with compatible browsers, and compositing it ourselves against a background of our choosing (alpha blending). We'll change its size and try creating palette versions of it. */ in = fopen (argv[1], "rb"); if (!in) { fprintf (stderr, "Can't load %s.\n", argv[1]); exit (1); } else { im_in = gdImageCreateFromPng (in); fclose (in); } testDrawing (im_in, 1.0, 0, 0, "noblending-fullsize-truecolor.png"); testDrawing (im_in, 1.0, 1, 0, "blending-fullsize-truecolor.png"); testDrawing (im_in, 0.5, 0, 0, "noblending-halfsize-truecolor.png"); testDrawing (im_in, 0.5, 1, 0, "blending-halfsize-truecolor.png"); testDrawing (im_in, 2.0, 0, 0, "noblending-doublesize-truecolor.png"); testDrawing (im_in, 2.0, 1, 0, "blending-doublesize-truecolor.png"); testDrawing (im_in, 1.0, 0, 1, "noblending-fullsize-palette.png"); testDrawing (im_in, 1.0, 1, 1, "blending-fullsize-palette.png"); testDrawing (im_in, 0.5, 0, 1, "noblending-halfsize-palette.png"); testDrawing (im_in, 0.5, 1, 1, "blending-halfsize-palette.png"); testDrawing (im_in, 2.0, 0, 1, "noblending-doublesize-palette.png"); testDrawing (im_in, 2.0, 1, 1, "blending-doublesize-palette.png"); gdImageDestroy (im_in); return 0; } /* If palette is true, we convert from truecolor to palette at the end, to test gdImageTrueColorToPalette and see file size/ quality tradeoffs. */ void testDrawing ( gdImagePtr im_in, double scale, int blending, int palette, char *filename) { gdImagePtr im_out; FILE *out; /* Create output image. */ im_out = gdImageCreateTrueColor ((int) (gdImageSX (im_in) * scale), (int) (gdImageSY (im_in) * scale)); /* Request alpha blending. This causes future drawing operations to perform alpha channel blending with the background, resulting in an opaque image. Without this call, pixels in the foreground color are copied literally, *including* the alpha channel value, resulting in an output image which is potentially not opaque. This flag can be set and cleared as often as desired. */ gdImageAlphaBlending (im_out, blending); /* Flood with light blue. */ gdImageFill (im_out, (int) (gdImageSX (im_in) * scale / 2), (int) (gdImageSY (im_in) * scale / 2), gdTrueColor (192, 192, 255)); /* Copy the source image. Alpha blending should result in compositing against red. With blending turned off, the browser or viewer will composite against its preferred background, or, if it does not support an alpha channel, we will see the original colors for the pixels that ought to be transparent or semitransparent. */ gdImageCopyResampled (im_out, im_in, 0, 0, 0, 0, (int) (gdImageSX (im_in) * scale), (int) (gdImageSY (im_in) * scale), gdImageSX (im_in), gdImageSY (im_in)); /* Write PNG */ out = fopen (filename, "wb"); /* If this image is the result of alpha channel blending, it will not contain an interesting alpha channel itself. Save a little file size by not saving the alpha channel. Otherwise the file would typically be slightly larger. */ gdImageSaveAlpha (im_out, !blending); /* If requested, convert from truecolor to palette. */ if (palette) { /* Dithering, 256 colors. */ gdImageTrueColorToPalette (im_out, 1, 256); } gdImagePng (im_out, out); fclose (out); gdImageDestroy (im_out); } php-4.4.8/ext/gd/libgd/gd2time.c0000644000175000017500000000232107455710734015566 0ustar derickderick #include #include /* for atoi */ #include /* For time */ #include "gd.h" /* A short program which converts a .png file into a .gd file, for your convenience in creating images on the fly from a basis image that must be loaded quickly. The .gd format is not intended to be a general-purpose format. */ int main (int argc, char **argv) { gdImagePtr im; FILE *in; int x, y, w, h; int c; int i; int t0; if (argc != 7) { fprintf (stderr, "Usage: gd2time filename.gd count x y w h\n"); exit (1); } c = atoi (argv[2]); x = atoi (argv[3]); y = atoi (argv[4]); w = atoi (argv[5]); h = atoi (argv[6]); printf ("Extracting %d times from (%d, %d), size is %dx%d\n", c, x, y, w, h); t0 = time (0); for (i = 0; i < c; i++) { in = fopen (argv[1], "rb"); if (!in) { fprintf (stderr, "Input file does not exist!\n"); exit (1); } im = gdImageCreateFromGd2Part (in, x, y, w, h); fclose (in); if (!im) { fprintf (stderr, "Error reading source file!\n"); exit (1); } gdImageDestroy (im); }; t0 = time (0) - t0; printf ("%d seconds to extract (& destroy) %d times\n", t0, c); return 0; } php-4.4.8/ext/gd/libgd/gdhelpers.c0000644000175000017500000000230707631420004016174 0ustar derickderick#ifdef HAVE_CONFIG_H #include "config.h" #endif #include "gd.h" #include "gdhelpers.h" #include #include /* TBB: gd_strtok_r is not portable; provide an implementation */ #define SEP_TEST (separators[*((unsigned char *) s)]) char * gd_strtok_r (char *s, char *sep, char **state) { char separators[256]; char *start; char *result = 0; memset (separators, 0, sizeof (separators)); while (*sep) { separators[*((unsigned char *) sep)] = 1; sep++; } if (!s) { /* Pick up where we left off */ s = *state; } start = s; /* 1. EOS */ if (!(*s)) { *state = s; return 0; } /* 2. Leading separators, if any */ if (SEP_TEST) { do { s++; } while (SEP_TEST); /* 2a. EOS after separators only */ if (!(*s)) { *state = s; return 0; } } /* 3. A token */ result = s; do { /* 3a. Token at end of string */ if (!(*s)) { *state = s; return result; } s++; } while (!SEP_TEST); /* 4. Terminate token and skip trailing separators */ *s = '\0'; do { s++; } while (SEP_TEST); /* 5. Return token */ *state = s; return result; } php-4.4.8/ext/gd/libgd/gdhelpers.h0000644000175000017500000000251010574526535016215 0ustar derickderick#ifndef GDHELPERS_H #define GDHELPERS_H 1 #include #include "php.h" /* TBB: strtok_r is not universal; provide an implementation of it. */ extern char *gd_strtok_r(char *s, char *sep, char **state); /* These functions wrap memory management. gdFree is in gd.h, where callers can utilize it to correctly free memory allocated by these functions with the right version of free(). */ #define gdCalloc(nmemb, size) ecalloc(nmemb, size) #define gdMalloc(size) emalloc(size) #define gdRealloc(ptr, size) erealloc(ptr, size) #define gdEstrdup(ptr) estrdup(ptr) #define gdFree(ptr) efree(ptr) #define gdPMalloc(ptr) pemalloc(ptr, 1) #define gdPFree(ptr) pefree(ptr, 1) #define gdPEstrdup(ptr) pestrdup(ptr, 1) /* Returns nonzero if multiplying the two quantities will result in integer overflow. Also returns nonzero if either quantity is negative. By Phil Knirsch based on netpbm fixes by Alan Cox. */ int overflow2(int a, int b); #ifdef ZTS #define gdMutexDeclare(x) MUTEX_T x #define gdMutexSetup(x) x = tsrm_mutex_alloc() #define gdMutexShutdown(x) tsrm_mutex_free(x) #define gdMutexLock(x) tsrm_mutex_lock(x) #define gdMutexUnlock(x) tsrm_mutex_unlock(x) #else #define gdMutexDeclare(x) #define gdMutexSetup(x) #define gdMutexShutdown(x) #define gdMutexLock(x) #define gdMutexUnlock(x) #endif #endif /* GDHELPERS_H */ php-4.4.8/ext/gd/libgd/gdkanji.c0000644000175000017500000003016307643610500015634 0ustar derickderick /* gdkanji.c (Kanji code converter) */ /* written by Masahito Yamaga (ma@yama-ga.com) */ #include #include #include #include "gd.h" #include "gdhelpers.h" #include #if defined(HAVE_ICONV_H) || defined(HAVE_ICONV) #include #ifdef HAVE_ERRNO_H #include #endif #endif #if defined(HAVE_ICONV_H) && !defined(HAVE_ICONV) #define HAVE_ICONV 1 #endif #define LIBNAME "any2eucjp()" #if defined(__MSC__) || defined(__BORLANDC__) || defined(__TURBOC__) || defined(_Windows) || defined(MSDOS) #ifndef SJISPRE #define SJISPRE 1 #endif #endif #ifdef TRUE #undef TRUE #endif #ifdef FALSE #undef FALSE #endif #define TRUE 1 #define FALSE 0 #define NEW 1 #define OLD 2 #define ESCI 3 #define NEC 4 #define EUC 5 #define SJIS 6 #define EUCORSJIS 7 #define ASCII 8 #define NEWJISSTR "JIS7" #define OLDJISSTR "jis" #define EUCSTR "eucJP" #define SJISSTR "SJIS" #define ESC 27 #define SS2 142 static void debug (const char *format,...) { #ifdef DEBUG va_list args; va_start (args, format); fprintf (stdout, "%s: ", LIBNAME); vfprintf (stdout, format, args); fprintf (stdout, "\n"); va_end (args); #endif } static void error (const char *format,...) { va_list args; char *tmp; TSRMLS_FETCH(); va_start(args, format); vspprintf(&tmp, 0, format, args); va_end(args); php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s: %s", LIBNAME, tmp); efree(tmp); } /* DetectKanjiCode() derived from DetectCodeType() by Ken Lunde. */ static int DetectKanjiCode (unsigned char *str) { static int whatcode = ASCII; int oldcode = ASCII; int c, i; char *lang = NULL; c = '\1'; i = 0; if (whatcode != EUCORSJIS && whatcode != ASCII) { oldcode = whatcode; whatcode = ASCII; } while ((whatcode == EUCORSJIS || whatcode == ASCII) && c != '\0') { if ((c = str[i++]) != '\0') { if (c == ESC) { c = str[i++]; if (c == '$') { c = str[i++]; if (c == 'B') whatcode = NEW; else if (c == '@') whatcode = OLD; } else if (c == '(') { c = str[i++]; if (c == 'I') whatcode = ESCI; } else if (c == 'K') whatcode = NEC; } else if ((c >= 129 && c <= 141) || (c >= 143 && c <= 159)) whatcode = SJIS; else if (c == SS2) { c = str[i++]; if ((c >= 64 && c <= 126) || (c >= 128 && c <= 160) || (c >= 224 && c <= 252)) whatcode = SJIS; else if (c >= 161 && c <= 223) whatcode = EUCORSJIS; } else if (c >= 161 && c <= 223) { c = str[i++]; if (c >= 240 && c <= 254) whatcode = EUC; else if (c >= 161 && c <= 223) whatcode = EUCORSJIS; else if (c >= 224 && c <= 239) { whatcode = EUCORSJIS; while (c >= 64 && c != '\0' && whatcode == EUCORSJIS) { if (c >= 129) { if (c <= 141 || (c >= 143 && c <= 159)) whatcode = SJIS; else if (c >= 253 && c <= 254) whatcode = EUC; } c = str[i++]; } } else if (c <= 159) whatcode = SJIS; } else if (c >= 240 && c <= 254) whatcode = EUC; else if (c >= 224 && c <= 239) { c = str[i++]; if ((c >= 64 && c <= 126) || (c >= 128 && c <= 160)) whatcode = SJIS; else if (c >= 253 && c <= 254) whatcode = EUC; else if (c >= 161 && c <= 252) whatcode = EUCORSJIS; } } } #ifdef DEBUG if (whatcode == ASCII) debug ("Kanji code not included."); else if (whatcode == EUCORSJIS) debug ("Kanji code not detected."); else debug ("Kanji code detected at %d byte.", i); #endif if (whatcode == EUCORSJIS && oldcode != ASCII) whatcode = oldcode; if (whatcode == EUCORSJIS) { if (getenv ("LC_ALL")) lang = getenv ("LC_ALL"); else if (getenv ("LC_CTYPE")) lang = getenv ("LC_CTYPE"); else if (getenv ("LANG")) lang = getenv ("LANG"); if (lang) { if (strcmp (lang, "ja_JP.SJIS") == 0 || #ifdef hpux strcmp (lang, "japanese") == 0 || #endif strcmp (lang, "ja_JP.mscode") == 0 || strcmp (lang, "ja_JP.PCK") == 0) whatcode = SJIS; else if (strncmp (lang, "ja", 2) == 0) #ifdef SJISPRE whatcode = SJIS; #else whatcode = EUC; #endif } } if (whatcode == EUCORSJIS) #ifdef SJISPRE whatcode = SJIS; #else whatcode = EUC; #endif return whatcode; } /* SJIStoJIS() is sjis2jis() by Ken Lunde. */ static void SJIStoJIS (int *p1, int *p2) { register unsigned char c1 = *p1; register unsigned char c2 = *p2; register int adjust = c2 < 159; register int rowOffset = c1 < 160 ? 112 : 176; register int cellOffset = adjust ? (31 + (c2 > 127)) : 126; *p1 = ((c1 - rowOffset) << 1) - adjust; *p2 -= cellOffset; } /* han2zen() was derived from han2zen() written by Ken Lunde. */ #define IS_DAKU(c) ((c >= 182 && c <= 196) || (c >= 202 && c <= 206) || (c == 179)) #define IS_HANDAKU(c) (c >= 202 && c <= 206) static void han2zen (int *p1, int *p2) { int c = *p1; int daku = FALSE; int handaku = FALSE; int mtable[][2] = { {129, 66}, {129, 117}, {129, 118}, {129, 65}, {129, 69}, {131, 146}, {131, 64}, {131, 66}, {131, 68}, {131, 70}, {131, 72}, {131, 131}, {131, 133}, {131, 135}, {131, 98}, {129, 91}, {131, 65}, {131, 67}, {131, 69}, {131, 71}, {131, 73}, {131, 74}, {131, 76}, {131, 78}, {131, 80}, {131, 82}, {131, 84}, {131, 86}, {131, 88}, {131, 90}, {131, 92}, {131, 94}, {131, 96}, {131, 99}, {131, 101}, {131, 103}, {131, 105}, {131, 106}, {131, 107}, {131, 108}, {131, 109}, {131, 110}, {131, 113}, {131, 116}, {131, 119}, {131, 122}, {131, 125}, {131, 126}, {131, 128}, {131, 129}, {131, 130}, {131, 132}, {131, 134}, {131, 136}, {131, 137}, {131, 138}, {131, 139}, {131, 140}, {131, 141}, {131, 143}, {131, 147}, {129, 74}, {129, 75} }; if (*p2 == 222 && IS_DAKU (*p1)) daku = TRUE; /* Daku-ten */ else if (*p2 == 223 && IS_HANDAKU (*p1)) handaku = TRUE; /* Han-daku-ten */ *p1 = mtable[c - 161][0]; *p2 = mtable[c - 161][1]; if (daku) { if ((*p2 >= 74 && *p2 <= 103) || (*p2 >= 110 && *p2 <= 122)) (*p2)++; else if (*p2 == 131 && *p2 == 69) *p2 = 148; } else if (handaku && *p2 >= 110 && *p2 <= 122) (*p2) += 2; } /* Recast strcpy to handle unsigned chars used below. */ #define ustrcpy(A,B) (strcpy((char*)(A),(const char*)(B))) static void do_convert (unsigned char *to, unsigned char *from, const char *code) { #ifdef HAVE_ICONV iconv_t cd; size_t from_len, to_len; if ((cd = iconv_open (EUCSTR, code)) == (iconv_t) - 1) { error ("iconv_open() error"); #ifdef HAVE_ERRNO_H if (errno == EINVAL) error ("invalid code specification: \"%s\" or \"%s\"", EUCSTR, code); #endif strcpy ((char *) to, (const char *) from); return; } from_len = strlen ((const char *) from) + 1; to_len = BUFSIZ; if ((int) iconv(cd, (char **) &from, &from_len, (char **) &to, &to_len) == -1) { #ifdef HAVE_ERRNO_H if (errno == EINVAL) error ("invalid end of input string"); else if (errno == EILSEQ) error ("invalid code in input string"); else if (errno == E2BIG) error ("output buffer overflow at do_convert()"); else #endif error ("something happen"); strcpy ((char *) to, (const char *) from); return; } if (iconv_close (cd) != 0) { error ("iconv_close() error"); } #else int p1, p2, i, j; int jisx0208 = FALSE; int hankaku = FALSE; j = 0; if (strcmp (code, NEWJISSTR) == 0 || strcmp (code, OLDJISSTR) == 0) { for (i = 0; from[i] != '\0' && j < BUFSIZ; i++) { if (from[i] == ESC) { i++; if (from[i] == '$') { jisx0208 = TRUE; hankaku = FALSE; i++; } else if (from[i] == '(') { jisx0208 = FALSE; i++; if (from[i] == 'I') /* Hankaku Kana */ hankaku = TRUE; else hankaku = FALSE; } } else { if (jisx0208) to[j++] = from[i] + 128; else if (hankaku) { to[j++] = SS2; to[j++] = from[i] + 128; } else to[j++] = from[i]; } } } else if (strcmp (code, SJISSTR) == 0) { for (i = 0; from[i] != '\0' && j < BUFSIZ; i++) { p1 = from[i]; if (p1 < 127) to[j++] = p1; else if ((p1 >= 161) && (p1 <= 223)) { /* Hankaku Kana */ to[j++] = SS2; to[j++] = p1; } else { p2 = from[++i]; SJIStoJIS (&p1, &p2); to[j++] = p1 + 128; to[j++] = p2 + 128; } } } else { error ("invalid code specification: \"%s\"", code); return; } if (j >= BUFSIZ) { error ("output buffer overflow at do_convert()"); ustrcpy (to, from); } else to[j] = '\0'; #endif /* HAVE_ICONV */ } static int do_check_and_conv (unsigned char *to, unsigned char *from) { static unsigned char tmp[BUFSIZ]; int p1, p2, i, j; int kanji = TRUE; switch (DetectKanjiCode (from)) { case NEW: debug ("Kanji code is New JIS."); do_convert (tmp, from, NEWJISSTR); break; case OLD: debug ("Kanji code is Old JIS."); do_convert (tmp, from, OLDJISSTR); break; case ESCI: debug ("This string includes Hankaku-Kana (jisx0201) escape sequence [ESC] + ( + I."); do_convert (tmp, from, NEWJISSTR); break; case NEC: debug ("Kanji code is NEC Kanji."); error ("cannot convert NEC Kanji."); ustrcpy (tmp, from); kanji = FALSE; break; case EUC: debug ("Kanji code is EUC."); ustrcpy (tmp, from); break; case SJIS: debug ("Kanji code is SJIS."); do_convert (tmp, from, SJISSTR); break; case EUCORSJIS: debug ("Kanji code is EUC or SJIS."); ustrcpy (tmp, from); kanji = FALSE; break; case ASCII: debug ("This is ASCII string."); ustrcpy (tmp, from); kanji = FALSE; break; default: debug ("This string includes unknown code."); ustrcpy (tmp, from); kanji = FALSE; break; } /* Hankaku Kana ---> Zenkaku Kana */ if (kanji) { j = 0; for (i = 0; tmp[i] != '\0' && j < BUFSIZ; i++) { if (tmp[i] == SS2) { p1 = tmp[++i]; if (tmp[i + 1] == SS2) { p2 = tmp[i + 2]; if (p2 == 222 || p2 == 223) i += 2; else p2 = 0; } else p2 = 0; han2zen (&p1, &p2); SJIStoJIS (&p1, &p2); to[j++] = p1 + 128; to[j++] = p2 + 128; } else to[j++] = tmp[i]; } if (j >= BUFSIZ) { error ("output buffer overflow at Hankaku --> Zenkaku"); ustrcpy (to, tmp); } else to[j] = '\0'; } else ustrcpy (to, tmp); return kanji; } int any2eucjp (unsigned char *dest, unsigned char *src, unsigned int dest_max) { static unsigned char tmp_dest[BUFSIZ]; int ret; if (strlen ((const char *) src) >= BUFSIZ) { error ("input string too large"); return -1; } if (dest_max > BUFSIZ) { error ("invalid maximum size of destination\nit should be less than %d.", BUFSIZ); return -1; } ret = do_check_and_conv (tmp_dest, src); if (strlen ((const char *) tmp_dest) >= dest_max) { error ("output buffer overflow"); ustrcpy (dest, src); return -1; } ustrcpy (dest, tmp_dest); return ret; } #if 0 unsigned int strwidth (unsigned char *s) { unsigned char *t; unsigned int i; t = (unsigned char *) gdMalloc (BUFSIZ); any2eucjp (t, s, BUFSIZ); i = strlen (t); gdFree (t); return i; } #ifdef DEBUG int main () { unsigned char input[BUFSIZ]; unsigned char *output; unsigned char *str; int c, i = 0; while ((c = fgetc (stdin)) != '\n' && i < BUFSIZ) input[i++] = c; input[i] = '\0'; printf ("input : %d bytes\n", strlen ((const char *) input)); printf ("output: %d bytes\n", strwidth (input)); output = (unsigned char *) gdMalloc (BUFSIZ); any2eucjp (output, input, BUFSIZ); str = output; while (*str != '\0') putchar (*(str++)); putchar ('\n'); gdFree (output); return 0; } #endif #endif php-4.4.8/ext/gd/libgd/gd_arc_f_buggy.c0000644000175000017500000003714607631420004017151 0ustar derickderick/* This is potentially great stuff, but fails against the test program at the end. This would probably be much more efficent than the implementation currently in gd.c if the errors in the output were corrected. TBB */ #if 0 #include "gd.h" #include /* Courtesy of F J Franklin. */ static gdPoint gdArcClosest (int width, int height, int angle); void gdImageFilledEllipse (gdImagePtr im, int cx, int cy, int width, int height, int color) { gdImageFilledArc (im, cx, cy, width, height, 0, 360, color, gdChord); } void gdImageFilledArc (gdImagePtr im, int cx, int cy, int width, int height, int s, int e, int color, int style) { gdPoint pt[7]; gdPoint axis_pt[4]; int angle; int have_s = 0; int have_e = 0; int flip_x = 0; int flip_y = 0; int conquer = 0; int i; int a; int b; int x; int y; long s_sin = 0; long s_cos = 0; long e_sin = 0; long e_cos = 0; long w; /* a * 2 */ long h; /* b * 2 */ long x2; /* x * 2 */ long y2; /* y * 2 */ long lx2; /* x * 2 (line) */ long ly2; /* y * 2 (line) */ long ws; /* (a * 2)^2 */ long hs; /* (b * 2)^2 */ long whs; /* (a * 2)^2 * (b * 2)^2 */ long g; /* decision variable */ long lg; /* decision variable (line) */ width = (width & 1) ? (width + 1) : (width); height = (height & 1) ? (height + 1) : (height); a = width / 2; b = height / 2; axis_pt[0].x = a; axis_pt[0].y = 0; axis_pt[1].x = 0; axis_pt[1].y = b; axis_pt[2].x = -a; axis_pt[2].y = 0; axis_pt[3].x = 0; axis_pt[3].y = -b; if (s == e) return; if ((e - s) >= 360) { s = 0; e = 0; } while (s < 0) s += 360; while (s >= 360) s -= 360; while (e < 0) e += 360; while (e >= 360) e -= 360; if (e <= s) e += 360; /* I'm assuming a chord-rule at the moment. Need to add origin to get a * pie-rule, but will need to set chord-rule before recursion... */ for (i = 0; i < 4; i++) { if ((s < (i + 1) * 90) && (e > (i + 1) * 90)) { gdImageFilledArc (im, cx, cy, width, height, s, (i + 1) * 90, color, gdChord); pt[0] = gdArcClosest (width, height, s); pt[0].x += cx; pt[0].y += cy; pt[1].x = cx + axis_pt[(i + 1) & 3].x; pt[1].y = cy + axis_pt[(i + 1) & 3].y; if (e <= (i + 2) * 90) { gdImageFilledArc (im, cx, cy, width, height, (i + 1) * 90, e, color, gdChord); pt[2] = gdArcClosest (width, height, e); pt[2].x += cx; pt[2].y += cy; if (style == gdChord) { gdImageFilledPolygon (im, pt, 3, color); gdImagePolygon (im, pt, 3, color); } else if (style == gdPie) { pt[3].x = cx; pt[3].y = cy; gdImageFilledPolygon (im, pt, 4, color); gdImagePolygon (im, pt, 4, color); } } else { gdImageFilledArc (im, cx, cy, width, height, (i + 1) * 90, (i + 2) * 90, color, gdChord); pt[2].x = cx + axis_pt[(i + 2) & 3].x; pt[2].y = cy + axis_pt[(i + 2) & 3].y; if (e <= (i + 3) * 90) { gdImageFilledArc (im, cx, cy, width, height, (i + 2) * 90, e, color, gdChord); pt[3] = gdArcClosest (width, height, e); pt[3].x += cx; pt[3].y += cy; if (style == gdChord) { gdImageFilledPolygon (im, pt, 4, color); gdImagePolygon (im, pt, 4, color); } else if (style == gdPie) { pt[4].x = cx; pt[4].y = cy; gdImageFilledPolygon (im, pt, 5, color); gdImagePolygon (im, pt, 5, color); } } else { gdImageFilledArc (im, cx, cy, width, height, (i + 2) * 90, (i + 3) * 90, color, gdChord); pt[3].x = cx + axis_pt[(i + 3) & 3].x; pt[3].y = cy + axis_pt[(i + 3) & 3].y; if (e <= (i + 4) * 90) { gdImageFilledArc (im, cx, cy, width, height, (i + 3) * 90, e, color, gdChord); pt[4] = gdArcClosest (width, height, e); pt[4].x += cx; pt[4].y += cy; if (style == gdChord) { gdImageFilledPolygon (im, pt, 5, color); gdImagePolygon (im, pt, 5, color); } else if (style == gdPie) { pt[5].x = cx; pt[5].y = cy; gdImageFilledPolygon (im, pt, 6, color); gdImagePolygon (im, pt, 6, color); } } else { gdImageFilledArc (im, cx, cy, width, height, (i + 3) * 90, (i + 4) * 90, color, gdChord); pt[4].x = cx + axis_pt[(i + 4) & 3].x; pt[4].y = cy + axis_pt[(i + 4) & 3].y; gdImageFilledArc (im, cx, cy, width, height, (i + 4) * 90, e, color, gdChord); pt[5] = gdArcClosest (width, height, e); pt[5].x += cx; pt[5].y += cy; if (style == gdChord) { gdImageFilledPolygon (im, pt, 6, color); gdImagePolygon (im, pt, 6, color); } else if (style == gdPie) { pt[6].x = cx; pt[6].y = cy; gdImageFilledPolygon (im, pt, 7, color); gdImagePolygon (im, pt, 7, color); } } } } return; } } /* At this point we have only arcs that lies within a quadrant - * map this to first quadrant... */ if ((s >= 90) && (e <= 180)) { angle = s; s = 180 - e; e = 180 - angle; flip_x = 1; } if ((s >= 180) && (e <= 270)) { s = s - 180; e = e - 180; flip_x = 1; flip_y = 1; } if ((s >= 270) && (e <= 360)) { angle = s; s = 360 - e; e = 360 - angle; flip_y = 1; } if (s == 0) { s_sin = 0; s_cos = (long) ((double) 32768); } else { s_sin = (long) ((double) 32768 * sin ((double) s * M_PI / (double) 180)); s_cos = (long) ((double) 32768 * cos ((double) s * M_PI / (double) 180)); } if (e == 0) { e_sin = (long) ((double) 32768); e_cos = 0; } else { e_sin = (long) ((double) 32768 * sin ((double) e * M_PI / (double) 180)); e_cos = (long) ((double) 32768 * cos ((double) e * M_PI / (double) 180)); } w = (long) width; h = (long) height; ws = w * w; hs = h * h; whs = 1; while ((ws > 32768) || (hs > 32768)) { ws = (ws + 1) / 2; /* Unfortunate limitations on integers makes */ hs = (hs + 1) / 2; /* drawing large ellipses problematic... */ whs *= 2; } while ((ws * hs) > (0x04000000L / whs)) { ws = (ws + 1) / 2; hs = (hs + 1) / 2; whs *= 2; } whs *= ws * hs; pt[0].x = w / 2; pt[0].y = 0; pt[2].x = 0; pt[2].y = h / 2; have_s = 0; have_e = 0; if (s == 0) have_s = 1; if (e == 90) have_e = 1; x2 = w; y2 = 0; /* Starting point is exactly on ellipse */ g = x2 - 1; g = g * g * hs + 4 * ws - whs; while ((x2 * hs) > (y2 * ws)) /* Keep |tangent| > 1 */ { y2 += 2; g += ws * 4 * (y2 + 1); if (g > 0) /* Need to drop */ { x2 -= 2; g -= hs * 4 * x2; } if ((have_s == 0) && ((s_sin * x2) <= (y2 * s_cos))) { pt[0].x = (int) (x2 / 2); pt[0].y = (int) (y2 / 2); have_s = 1; } if ((have_e == 0) && ((e_sin * x2) <= (y2 * e_cos))) { pt[2].x = (int) (x2 / 2); pt[2].y = (int) (y2 / 2); have_e = 1; } } pt[1].x = (int) (x2 / 2); pt[1].y = (int) (y2 / 2); x2 = 0; y2 = h; /* Starting point is exactly on ellipse */ g = y2 - 1; g = g * g * ws + 4 * hs - whs; while ((x2 * hs) < (y2 * ws)) { x2 += 2; g += hs * 4 * (x2 + 1); if (g > 0) /* Need to drop */ { y2 -= 2; g -= ws * 4 * y2; } if ((have_s == 0) && ((s_sin * x2) >= (y2 * s_cos))) { pt[0].x = (int) (x2 / 2); pt[0].y = (int) (y2 / 2); have_s = 1; } if ((have_e == 0) && ((e_sin * x2) >= (y2 * e_cos))) { pt[2].x = (int) (x2 / 2); pt[2].y = (int) (y2 / 2); have_e = 1; } } if ((have_s == 0) || (have_e == 0)) return; /* Bizarre case */ if (style == gdPie) { pt[3] = pt[0]; pt[4] = pt[1]; pt[5] = pt[2]; pt[0].x = cx + (flip_x ? (-pt[0].x) : pt[0].x); pt[0].y = cy + (flip_y ? (-pt[0].y) : pt[0].y); pt[1].x = cx; pt[1].y = cy; pt[2].x = cx + (flip_x ? (-pt[2].x) : pt[2].x); pt[2].y = cy + (flip_y ? (-pt[2].y) : pt[2].y); gdImageFilledPolygon (im, pt, 3, color); gdImagePolygon (im, pt, 3, color); pt[0] = pt[3]; pt[1] = pt[4]; pt[2] = pt[5]; } if (((s_cos * hs) > (s_sin * ws)) && ((e_cos * hs) < (e_sin * ws))) { /* the points are on different parts of the curve... * this is too tricky to try to handle, so divide and conquer: */ pt[3] = pt[0]; pt[4] = pt[1]; pt[5] = pt[2]; pt[0].x = cx + (flip_x ? (-pt[0].x) : pt[0].x); pt[0].y = cy + (flip_y ? (-pt[0].y) : pt[0].y); pt[1].x = cx + (flip_x ? (-pt[1].x) : pt[1].x); pt[1].y = cy + (flip_y ? (-pt[1].y) : pt[1].y); pt[2].x = cx + (flip_x ? (-pt[2].x) : pt[2].x); pt[2].y = cy + (flip_y ? (-pt[2].y) : pt[2].y); gdImageFilledPolygon (im, pt, 3, color); gdImagePolygon (im, pt, 3, color); pt[0] = pt[3]; pt[2] = pt[4]; conquer = 1; } if (conquer || (((s_cos * hs) > (s_sin * ws)) && ((e_cos * hs) > (e_sin * ws)))) { /* This is the best bit... */ /* steep line + ellipse */ /* go up & left from pt[0] to pt[2] */ x2 = w; y2 = 0; /* Starting point is exactly on ellipse */ g = x2 - 1; g = g * g * hs + 4 * ws - whs; while ((x2 * hs) > (y2 * ws)) /* Keep |tangent| > 1 */ { if ((s_sin * x2) <= (y2 * s_cos)) break; y2 += 2; g += ws * 4 * (y2 + 1); if (g > 0) /* Need to drop */ { x2 -= 2; g -= hs * 4 * x2; } } lx2 = x2; ly2 = y2; lg = lx2 * (pt[0].y - pt[2].y) - ly2 * (pt[0].x - pt[2].x); lg = (lx2 - 1) * (pt[0].y - pt[2].y) - (ly2 + 2) * (pt[0].x - pt[2].x) - lg; while (y2 < (2 * pt[2].y)) { y2 += 2; g += ws * 4 * (y2 + 1); if (g > 0) /* Need to drop */ { x2 -= 2; g -= hs * 4 * x2; } ly2 += 2; lg -= 2 * (pt[0].x - pt[2].x); if (lg < 0) /* Need to drop */ { lx2 -= 2; lg -= 2 * (pt[0].y - pt[2].y); } y = (int) (y2 / 2); for (x = (int) (lx2 / 2); x <= (int) (x2 / 2); x++) { gdImageSetPixel (im, ((flip_x) ? (cx - x) : (cx + x)), ((flip_y) ? (cy - y) : (cy + y)), color); } } } if (conquer) { pt[0] = pt[4]; pt[2] = pt[5]; } if (conquer || (((s_cos * hs) < (s_sin * ws)) && ((e_cos * hs) < (e_sin * ws)))) { /* This is the best bit... */ /* gradual line + ellipse */ /* go down & right from pt[2] to pt[0] */ x2 = 0; y2 = h; /* Starting point is exactly on ellipse */ g = y2 - 1; g = g * g * ws + 4 * hs - whs; while ((x2 * hs) < (y2 * ws)) { x2 += 2; g += hs * 4 * (x2 + 1); if (g > 0) /* Need to drop */ { y2 -= 2; g -= ws * 4 * y2; } if ((e_sin * x2) >= (y2 * e_cos)) break; } lx2 = x2; ly2 = y2; lg = lx2 * (pt[0].y - pt[2].y) - ly2 * (pt[0].x - pt[2].x); lg = (lx2 + 2) * (pt[0].y - pt[2].y) - (ly2 - 1) * (pt[0].x - pt[2].x) - lg; while (x2 < (2 * pt[0].x)) { x2 += 2; g += hs * 4 * (x2 + 1); if (g > 0) /* Need to drop */ { y2 -= 2; g -= ws * 4 * y2; } lx2 += 2; lg += 2 * (pt[0].y - pt[2].y); if (lg < 0) /* Need to drop */ { ly2 -= 2; lg += 2 * (pt[0].x - pt[2].x); } x = (int) (x2 / 2); for (y = (int) (ly2 / 2); y <= (int) (y2 / 2); y++) { gdImageSetPixel (im, ((flip_x) ? (cx - x) : (cx + x)), ((flip_y) ? (cy - y) : (cy + y)), color); } } } } static gdPoint gdArcClosest (int width, int height, int angle) { gdPoint pt; int flip_x = 0; int flip_y = 0; long a_sin = 0; long a_cos = 0; long w; /* a * 2 */ long h; /* b * 2 */ long x2; /* x * 2 */ long y2; /* y * 2 */ long ws; /* (a * 2)^2 */ long hs; /* (b * 2)^2 */ long whs; /* (a * 2)^2 * (b * 2)^2 */ long g; /* decision variable */ w = (long) ((width & 1) ? (width + 1) : (width)); h = (long) ((height & 1) ? (height + 1) : (height)); while (angle < 0) angle += 360; while (angle >= 360) angle -= 360; if (angle == 0) { pt.x = w / 2; pt.y = 0; return (pt); } if (angle == 90) { pt.x = 0; pt.y = h / 2; return (pt); } if (angle == 180) { pt.x = -w / 2; pt.y = 0; return (pt); } if (angle == 270) { pt.x = 0; pt.y = -h / 2; return (pt); } pt.x = 0; pt.y = 0; if ((angle > 90) && (angle < 180)) { angle = 180 - angle; flip_x = 1; } if ((angle > 180) && (angle < 270)) { angle = angle - 180; flip_x = 1; flip_y = 1; } if ((angle > 270) && (angle < 360)) { angle = 360 - angle; flip_y = 1; } a_sin = (long) ((double) 32768 * sin ((double) angle * M_PI / (double) 180)); a_cos = (long) ((double) 32768 * cos ((double) angle * M_PI / (double) 180)); ws = w * w; hs = h * h; whs = 1; while ((ws > 32768) || (hs > 32768)) { ws = (ws + 1) / 2; /* Unfortunate limitations on integers makes */ hs = (hs + 1) / 2; /* drawing large ellipses problematic... */ whs *= 2; } while ((ws * hs) > (0x04000000L / whs)) { ws = (ws + 1) / 2; hs = (hs + 1) / 2; whs *= 2; } whs *= ws * hs; if ((a_cos * hs) > (a_sin * ws)) { x2 = w; y2 = 0; /* Starting point is exactly on ellipse */ g = x2 - 1; g = g * g * hs + 4 * ws - whs; while ((x2 * hs) > (y2 * ws)) /* Keep |tangent| > 1 */ { y2 += 2; g += ws * 4 * (y2 + 1); if (g > 0) /* Need to drop */ { x2 -= 2; g -= hs * 4 * x2; } if ((a_sin * x2) <= (y2 * a_cos)) { pt.x = (int) (x2 / 2); pt.y = (int) (y2 / 2); break; } } } else { x2 = 0; y2 = h; /* Starting point is exactly on ellipse */ g = y2 - 1; g = g * g * ws + 4 * hs - whs; while ((x2 * hs) < (y2 * ws)) { x2 += 2; g += hs * 4 * (x2 + 1); if (g > 0) /* Need to drop */ { y2 -= 2; g -= ws * 4 * y2; } if ((a_sin * x2) >= (y2 * a_cos)) { pt.x = (int) (x2 / 2); pt.y = (int) (y2 / 2); break; } } } if (flip_x) pt.x = -pt.x; if (flip_y) pt.y = -pt.y; return (pt); } #include "gd.h" #include #include #define WIDTH 500 #define HEIGHT 300 int main (int argc, char *argv[]) { gdImagePtr im = gdImageCreate (WIDTH, HEIGHT); int white = gdImageColorResolve (im, 0xFF, 0xFF, 0xFF), black = gdImageColorResolve (im, 0, 0, 0), red = gdImageColorResolve (im, 0xFF, 0xA0, 0xA0); FILE *out; /* filled arc - circle */ gdImageFilledArc (im, WIDTH / 5, HEIGHT / 4, 200, 200, 45, 90, red, gdPie); gdImageArc (im, WIDTH / 5, HEIGHT / 4, 200, 200, 45, 90, black); /* filled arc - ellipse */ gdImageFilledArc (im, WIDTH / 2, HEIGHT / 4, 200, 150, 45, 90, red, gdPie); gdImageArc (im, WIDTH / 2, HEIGHT / 4, 200, 150, 45, 90, black); /* reference lines */ gdImageLine (im, 0, HEIGHT / 4, WIDTH, HEIGHT / 4, black); gdImageLine (im, WIDTH / 5, 0, WIDTH / 5, HEIGHT, black); gdImageLine (im, WIDTH / 2, 0, WIDTH / 2, HEIGHT, black); gdImageLine (im, WIDTH / 2, HEIGHT / 4, WIDTH / 2 + 300, HEIGHT / 4 + 300, black); gdImageLine (im, WIDTH / 5, HEIGHT / 4, WIDTH / 5 + 300, HEIGHT / 4 + 300, black); /* TBB: Write img to test/arctest.png */ out = fopen ("test/arctest.png", "wb"); if (!out) { php_gd_error("Can't create test/arctest.png\n"); exit (1); } gdImagePng (im, out); fclose (out); php_gd_error("Test image written to test/arctest.png\n"); /* Destroy it */ gdImageDestroy (im); return 0; } #endif php-4.4.8/ext/gd/libgd/gd_gd.c0000644000175000017500000001217410032064414015264 0ustar derickderick #include #include #include #include #include "gd.h" #define TRUE 1 #define FALSE 0 /* Exported functions: */ extern void gdImageGd (gdImagePtr im, FILE * out); /* Use this for commenting out debug-print statements. */ /* Just use the first '#define' to allow all the prints... */ /*#define GD2_DBG(s) (s) */ #define GD2_DBG(s) /* */ /* Shared code to read color tables from gd file. */ /* */ int _gdGetColors (gdIOCtx * in, gdImagePtr im, int gd2xFlag) { int i; if (gd2xFlag) { int trueColorFlag; if (!gdGetByte(&trueColorFlag, in)) { goto fail1; } /* 2.0.12: detect bad truecolor .gd files created by pre-2.0.12. * Beginning in 2.0.12 truecolor is indicated by the initial 2-byte * signature. */ if (trueColorFlag != im->trueColor) { goto fail1; } /* This should have been a word all along */ if (!im->trueColor) { if (!gdGetWord(&im->colorsTotal, in)) { goto fail1; } } /* Int to accommodate truecolor single-color transparency */ if (!gdGetInt(&im->transparent, in)) { goto fail1; } } else { if (!gdGetByte(&im->colorsTotal, in)) { goto fail1; } if (!gdGetWord(&im->transparent, in)) { goto fail1; } if (im->transparent == 257) { im->transparent = (-1); } } GD2_DBG(printf("Pallette had %d colours (T=%d)\n", im->colorsTotal, im->transparent)); if (im->trueColor) { return TRUE; } for (i = 0; i < gdMaxColors; i++) { if (!gdGetByte(&im->red[i], in)) { goto fail1; } if (!gdGetByte(&im->green[i], in)) { goto fail1; } if (!gdGetByte(&im->blue[i], in)) { goto fail1; } if (gd2xFlag) { if (!gdGetByte(&im->alpha[i], in)) { goto fail1; } } } for (i = 0; i < im->colorsTotal; i++) { im->open[i] = 0; } return TRUE; fail1: return FALSE; } /* */ /* Use the common basic header info to make the image object. */ /* */ static gdImagePtr _gdCreateFromFile (gdIOCtx * in, int *sx, int *sy) { gdImagePtr im; int gd2xFlag = 0; int trueColorFlag = 0; if (!gdGetWord(sx, in)) { goto fail1; } if (*sx == 65535 || *sx == 65534) { /* This is a gd 2.0 .gd file */ gd2xFlag = 1; /* 2.0.12: 65534 signals a truecolor .gd file. There is a slight redundancy here but we can live with it. */ if (*sx == 65534) { trueColorFlag = 1; } if (!gdGetWord(sx, in)) { goto fail1; } } if (!gdGetWord(sy, in)) { goto fail1; } GD2_DBG(printf("Image is %dx%d\n", *sx, *sy)); if (trueColorFlag) { im = gdImageCreateTrueColor(*sx, *sy); } else { im = gdImageCreate(*sx, *sy); } if (!_gdGetColors(in, im, gd2xFlag)) { goto fail2; } return im; fail2: gdImageDestroy(im); fail1: return 0; } gdImagePtr gdImageCreateFromGd (FILE * inFile) { gdImagePtr im; gdIOCtx *in; in = gdNewFileCtx(inFile); im = gdImageCreateFromGdCtx(in); in->gd_free(in); return im; } gdImagePtr gdImageCreateFromGdPtr (int size, void *data) { gdImagePtr im; gdIOCtx *in = gdNewDynamicCtxEx(size, data, 0); im = gdImageCreateFromGdCtx(in); in->gd_free(in); return im; } gdImagePtr gdImageCreateFromGdCtx (gdIOCtxPtr in) { int sx, sy; int x, y; gdImagePtr im; /* Read the header */ im = _gdCreateFromFile(in, &sx, &sy); if (im == NULL) { goto fail1; } /* Then the data... */ /* 2.0.12: support truecolor properly in .gd as well as in .gd2. Problem reported by Andreas Pfaller. */ if (im->trueColor) { for (y = 0; y < sy; y++) { for (x = 0; x < sx; x++) { int pix; if (!gdGetInt(&pix, in)) { goto fail2; } im->tpixels[y][x] = pix; } } } else { for (y = 0; y < sy; y++) { for (x = 0; x < sx; x++) { int ch; ch = gdGetC(in); if (ch == EOF) { goto fail2; } /* ROW-MAJOR IN GD 1.3 */ im->pixels[y][x] = ch; } } } return im; fail2: gdImageDestroy (im); fail1: return 0; } void _gdPutColors (gdImagePtr im, gdIOCtx * out) { int i; gdPutC(im->trueColor, out); if (!im->trueColor) { gdPutWord(im->colorsTotal, out); } gdPutInt(im->transparent, out); if (!im->trueColor) { for (i = 0; i < gdMaxColors; i++) { gdPutC((unsigned char) im->red[i], out); gdPutC((unsigned char) im->green[i], out); gdPutC((unsigned char) im->blue[i], out); gdPutC((unsigned char) im->alpha[i], out); } } } static void _gdPutHeader (gdImagePtr im, gdIOCtx * out) { /* 65535 indicates this is a gd 2.x .gd file. * 2.0.12: 65534 indicates truecolor. */ if (im->trueColor) { gdPutWord(65534, out); } else { gdPutWord(65535, out); } gdPutWord(im->sx, out); gdPutWord(im->sy, out); _gdPutColors(im, out); } static void _gdImageGd (gdImagePtr im, gdIOCtx * out) { int x, y; _gdPutHeader(im, out); for (y = 0; y < im->sy; y++) { for (x = 0; x < im->sx; x++) { /* ROW-MAJOR IN GD 1.3 */ if (im->trueColor) { gdPutInt(im->tpixels[y][x], out); } else { gdPutC((unsigned char) im->pixels[y][x], out); } } } } void gdImageGd (gdImagePtr im, FILE * outFile) { gdIOCtx *out = gdNewFileCtx(outFile); _gdImageGd(im, out); out->gd_free(out); } void *gdImageGdPtr (gdImagePtr im, int *size) { void *rv; gdIOCtx *out = gdNewDynamicCtx(2048, NULL); _gdImageGd(im, out); rv = gdDPExtractData(out, size); out->gd_free(out); return rv; } php-4.4.8/ext/gd/libgd/gd_io.c0000644000175000017500000000546007772662637015335 0ustar derickderick /* * io.c * * Implements the simple I/O 'helper' routines. * * Not really essential, but these routines were used extensively in GD, * so they were moved here. They also make IOCtx calls look better... * * Written (or, at least, moved) 1999, Philip Warner. * */ #include #include #include #include "gd.h" /* Use this for commenting out debug-print statements. */ /* Just use the first '#define' to allow all the prints... */ /*#define IO_DBG(s) (s) */ #define IO_DBG(s) /* * Write out a word to the I/O context pointer */ void Putword (int w, gdIOCtx * ctx) { unsigned char buf[2]; buf[0] = w & 0xff; buf[1] = (w / 256) & 0xff; (ctx->putBuf) (ctx, (char *) buf, 2); } void Putchar (int c, gdIOCtx * ctx) { (ctx->putC) (ctx, c & 0xff); } void gdPutC (const unsigned char c, gdIOCtx * ctx) { (ctx->putC) (ctx, c); } void gdPutWord (int w, gdIOCtx * ctx) { IO_DBG (printf ("Putting word...\n")); (ctx->putC) (ctx, (unsigned char) (w >> 8)); (ctx->putC) (ctx, (unsigned char) (w & 0xFF)); IO_DBG (printf ("put.\n")); } void gdPutInt (int w, gdIOCtx * ctx) { IO_DBG (printf ("Putting int...\n")); (ctx->putC) (ctx, (unsigned char) (w >> 24)); (ctx->putC) (ctx, (unsigned char) ((w >> 16) & 0xFF)); (ctx->putC) (ctx, (unsigned char) ((w >> 8) & 0xFF)); (ctx->putC) (ctx, (unsigned char) (w & 0xFF)); IO_DBG (printf ("put.\n")); } int gdGetC (gdIOCtx * ctx) { return ((ctx->getC) (ctx)); } int gdGetByte (int *result, gdIOCtx * ctx) { int r; r = (ctx->getC) (ctx); if (r == EOF) { return 0; } *result = r; return 1; } int gdGetWord (int *result, gdIOCtx * ctx) { int r; r = (ctx->getC) (ctx); if (r == EOF) { return 0; } *result = r << 8; r = (ctx->getC) (ctx); if (r == EOF) { return 0; } *result += r; return 1; } int gdGetInt (int *result, gdIOCtx * ctx) { int r; r = (ctx->getC) (ctx); if (r == EOF) { return 0; } *result = r << 24; r = (ctx->getC) (ctx); if (r == EOF) { return 0; } *result += r << 16; r = (ctx->getC) (ctx); if (r == EOF) { return 0; } *result += r << 8; r = (ctx->getC) (ctx); if (r == EOF) { return 0; } *result += r; return 1; } int gdPutBuf (const void *buf, int size, gdIOCtx * ctx) { IO_DBG (printf ("Putting buf...\n")); return (ctx->putBuf) (ctx, buf, size); IO_DBG (printf ("put.\n")); } int gdGetBuf (void *buf, int size, gdIOCtx * ctx) { return (ctx->getBuf) (ctx, buf, size); } int gdSeek (gdIOCtx * ctx, const int pos) { IO_DBG (printf ("Seeking...\n")); return ((ctx->seek) (ctx, pos)); IO_DBG (printf ("Done.\n")); } long gdTell (gdIOCtx * ctx) { IO_DBG (printf ("Telling...\n")); return ((ctx->tell) (ctx)); IO_DBG (printf ("told.\n")); } php-4.4.8/ext/gd/libgd/gd_io.h0000644000175000017500000000170507643610500015313 0ustar derickderick#ifndef GD_IO_H #define GD_IO_H 1 #include #ifdef VMS #define Putchar gdPutchar #endif typedef struct gdIOCtx { int (*getC)(struct gdIOCtx*); int (*getBuf)(struct gdIOCtx*, void*, int); void (*putC)(struct gdIOCtx*, int); int (*putBuf)(struct gdIOCtx*, const void*, int); int (*seek)(struct gdIOCtx*, const int); long (*tell)(struct gdIOCtx*); void (*gd_free)(struct gdIOCtx*); } gdIOCtx; typedef struct gdIOCtx *gdIOCtxPtr; void Putword(int w, gdIOCtx *ctx); void Putchar(int c, gdIOCtx *ctx); void gdPutC(const unsigned char c, gdIOCtx *ctx); int gdPutBuf(const void *, int, gdIOCtx*); void gdPutWord(int w, gdIOCtx *ctx); void gdPutInt(int w, gdIOCtx *ctx); int gdGetC(gdIOCtx *ctx); int gdGetBuf(void *, int, gdIOCtx*); int gdGetByte(int *result, gdIOCtx *ctx); int gdGetWord(int *result, gdIOCtx *ctx); int gdGetInt(int *result, gdIOCtx *ctx); int gdSeek(gdIOCtx *ctx, const int); long gdTell(gdIOCtx *ctx); #endif php-4.4.8/ext/gd/libgd/gd_ss.c0000644000175000017500000000214407631420004015315 0ustar derickderick#include #include #include #include #include "gd.h" #define TRUE 1 #define FALSE 0 /* Exported functions: */ extern void gdImagePngToSink (gdImagePtr im, gdSinkPtr out); extern gdImagePtr gdImageCreateFromPngSource (gdSourcePtr inSource); /* Use this for commenting out debug-print statements. */ /* Just use the first '#define' to allow all the prints... */ /*#define GD_SS_DBG(s) (s) */ #define GD_SS_DBG(s) #ifdef HAVE_LIBPNG void gdImagePngToSink (gdImagePtr im, gdSinkPtr outSink) { gdIOCtx *out = gdNewSSCtx (NULL, outSink); gdImagePngCtx (im, out); out->gd_free (out); } gdImagePtr gdImageCreateFromPngSource (gdSourcePtr inSource) { gdIOCtx *in = gdNewSSCtx (inSource, NULL); gdImagePtr im; im = gdImageCreateFromPngCtx (in); in->gd_free (in); return im; } #else /* no HAVE_LIBPNG */ void gdImagePngToSink (gdImagePtr im, gdSinkPtr outSink) { php_gd_error("PNG support is not available\n"); } gdImagePtr gdImageCreateFromPngSource (gdSourcePtr inSource) { php_gd_error("PNG support is not available\n"); return NULL; } #endif /* HAVE_LIBPNG */ php-4.4.8/ext/gd/libgd/gdxpm.c0000644000175000017500000000633407667231171015360 0ustar derickderick /* add ability to load xpm files to gd, requires the xpm library. Caolan.McNamara@ul.ie http://www.csn.ul.ie/~caolan */ #include #include #include #include "gd.h" #include "gdhelpers.h" #ifdef HAVE_XPM #include gdImagePtr gdImageCreateFromXpm (char *filename) { XpmInfo info; XpmImage image; int i, j, k, number; char buf[5]; gdImagePtr im = 0; char *apixel; int *pointer; int red = 0, green = 0, blue = 0; int *colors; int ret; ret = XpmReadFileToXpmImage (filename, &image, &info); if (ret != XpmSuccess) return 0; if (!(im = gdImageCreate (image.width, image.height))) return 0; number = image.ncolors; colors = (int *) safe_emalloc(number, sizeof(int), 0); for (i = 0; i < number; i++) { switch (strlen (image.colorTable[i].c_color)) { case 4: buf[1] = '\0'; buf[0] = image.colorTable[i].c_color[1]; red = strtol (buf, NULL, 16); buf[0] = image.colorTable[i].c_color[3]; green = strtol (buf, NULL, 16); buf[0] = image.colorTable[i].c_color[5]; blue = strtol (buf, NULL, 16); break; case 7: buf[2] = '\0'; buf[0] = image.colorTable[i].c_color[1]; buf[1] = image.colorTable[i].c_color[2]; red = strtol (buf, NULL, 16); buf[0] = image.colorTable[i].c_color[3]; buf[1] = image.colorTable[i].c_color[4]; green = strtol (buf, NULL, 16); buf[0] = image.colorTable[i].c_color[5]; buf[1] = image.colorTable[i].c_color[6]; blue = strtol (buf, NULL, 16); break; case 10: buf[3] = '\0'; buf[0] = image.colorTable[i].c_color[1]; buf[1] = image.colorTable[i].c_color[2]; buf[2] = image.colorTable[i].c_color[3]; red = strtol (buf, NULL, 16); red /= 64; buf[0] = image.colorTable[i].c_color[4]; buf[1] = image.colorTable[i].c_color[5]; buf[2] = image.colorTable[i].c_color[6]; green = strtol (buf, NULL, 16); green /= 64; buf[0] = image.colorTable[i].c_color[7]; buf[1] = image.colorTable[i].c_color[8]; buf[2] = image.colorTable[i].c_color[9]; blue = strtol (buf, NULL, 16); blue /= 64; break; case 13: buf[4] = '\0'; buf[0] = image.colorTable[i].c_color[1]; buf[1] = image.colorTable[i].c_color[2]; buf[2] = image.colorTable[i].c_color[3]; buf[3] = image.colorTable[i].c_color[4]; red = strtol (buf, NULL, 16); red /= 256; buf[0] = image.colorTable[i].c_color[5]; buf[1] = image.colorTable[i].c_color[6]; buf[2] = image.colorTable[i].c_color[7]; buf[3] = image.colorTable[i].c_color[8]; green = strtol (buf, NULL, 16); green /= 256; buf[0] = image.colorTable[i].c_color[9]; buf[1] = image.colorTable[i].c_color[10]; buf[2] = image.colorTable[i].c_color[11]; buf[3] = image.colorTable[i].c_color[12]; blue = strtol (buf, NULL, 16); blue /= 256; break; } colors[i] = gdImageColorResolve (im, red, green, blue); if (colors[i] == -1) php_gd_error("ARRRGH\n"); } apixel = (char *) gdMalloc (image.cpp + 1); apixel[image.cpp] = '\0'; pointer = (int *) image.data; for (i = 0; i < image.height; i++) { for (j = 0; j < image.width; j++) { k = *pointer++; gdImageSetPixel (im, j, i, colors[k]); } } gdFree (apixel); gdFree (colors); return (im); } #endif php-4.4.8/ext/gd/libgd/gdft.c0000644000175000017500000007656010574524673015200 0ustar derickderick /********************************************/ /* gd interface to freetype library */ /* */ /* John Ellson ellson@graphviz.org */ /********************************************/ #include #include #include #include #include "gd.h" #include "gdhelpers.h" #ifndef MSWIN32 #include #else #include #define R_OK 04 /* Needed in Windows */ #endif #ifdef WIN32 #define access _access #ifndef R_OK #define R_OK 2 #endif #endif /* number of antialised colors for indexed bitmaps */ /* overwrite Windows GDI define in case of windows build */ #ifdef NUMCOLORS #undef NUMCOLORS #endif #define NUMCOLORS 8 char * gdImageStringTTF (gdImage * im, int *brect, int fg, char *fontlist, double ptsize, double angle, int x, int y, char *string) { /* 2.0.6: valid return */ return gdImageStringFT (im, brect, fg, fontlist, ptsize, angle, x, y, string); } #ifndef HAVE_LIBFREETYPE char * gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsize, double angle, int x, int y, char *string, gdFTStringExtraPtr strex) { return "libgd was not built with FreeType font support\n"; } char * gdImageStringFT (gdImage * im, int *brect, int fg, char *fontlist, double ptsize, double angle, int x, int y, char *string) { return "libgd was not built with FreeType font support\n"; } #else #include "gdcache.h" #include #include FT_FREETYPE_H #include FT_GLYPH_H /* number of fonts cached before least recently used is replaced */ #define FONTCACHESIZE 6 /* number of antialias color lookups cached */ #define TWEENCOLORCACHESIZE 32 /* * Line separation as a factor of font height. * No space between if LINESPACE = 1.00 * Line separation will be rounded up to next pixel row. */ #define LINESPACE 1.05 /* * The character (space) used to separate alternate fonts in the * fontlist parameter to gdImageStringFT. 2.0.18: space was a oor choice for this. */ #define LISTSEPARATOR ";" /* * DEFAULT_FONTPATH and PATHSEPARATOR are host type dependent and * are normally set by configure in config.h. These are just * some last resort values that might match some Un*x system * if building this version of gd separate from graphviz. */ #ifndef DEFAULT_FONTPATH #if defined(__APPLE__) || (defined(__MWERKS__) && defined(macintosh)) #define DEFAULT_FONTPATH "/usr/share/fonts/truetype:/System/Library/Fonts:/Library/Fonts" #else #define DEFAULT_FONTPATH "/usr/share/fonts/truetype" #endif #endif #ifndef PATHSEPARATOR #define PATHSEPARATOR ":" #endif #ifndef TRUE #define FALSE 0 #define TRUE !FALSE #endif #ifndef MAX #define MAX(a,b) ((a)>(b)?(a):(b)) #endif #ifndef MIN #define MIN(a,b) ((a)<(b)?(a):(b)) #endif typedef struct { char *fontlist; /* key */ FT_Library *library; FT_Face face; FT_Bool have_char_map_unicode, have_char_map_big5, have_char_map_sjis, have_char_map_apple_roman; gdCache_head_t *glyphCache; } font_t; typedef struct { char *fontlist; /* key */ FT_Library *library; } fontkey_t; typedef struct { int pixel; /* key */ int bgcolor; /* key */ int fgcolor; /* key *//* -ve means no antialias */ gdImagePtr im; /* key */ int tweencolor; } tweencolor_t; typedef struct { int pixel; /* key */ int bgcolor; /* key */ int fgcolor; /* key *//* -ve means no antialias */ gdImagePtr im; /* key */ } tweencolorkey_t; /******************************************************************** * gdTcl_UtfToUniChar is borrowed from Tcl ... */ /* * tclUtf.c -- * * Routines for manipulating UTF-8 strings. * * Copyright (c) 1997-1998 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * * SCCS: @(#) tclUtf.c 1.25 98/01/28 18:02:43 */ /* *--------------------------------------------------------------------------- * * gdTcl_UtfToUniChar -- * * Extract the Tcl_UniChar represented by the UTF-8 string. Bad * UTF-8 sequences are converted to valid Tcl_UniChars and processing * continues. Equivalent to Plan 9 chartorune(). * * The caller must ensure that the source buffer is long enough that * this routine does not run off the end and dereference non-existent * memory looking for trail bytes. If the source buffer is known to * be '\0' terminated, this cannot happen. Otherwise, the caller * should call Tcl_UtfCharComplete() before calling this routine to * ensure that enough bytes remain in the string. * * Results: * *chPtr is filled with the Tcl_UniChar, and the return value is the * number of bytes from the UTF-8 string that were consumed. * * Side effects: * None. * *--------------------------------------------------------------------------- */ #ifdef JISX0208 #include "jisx0208.h" #endif extern int any2eucjp (char *, char *, unsigned int); /* Persistent font cache until explicitly cleared */ /* Fonts can be used across multiple images */ /* 2.0.16: thread safety (the font cache is shared) */ gdMutexDeclare(gdFontCacheMutex); static gdCache_head_t *fontCache = NULL; static FT_Library library; #define Tcl_UniChar int #define TCL_UTF_MAX 3 static int gdTcl_UtfToUniChar (char *str, Tcl_UniChar * chPtr) /* str is the UTF8 next character pointer */ /* chPtr is the int for the result */ { int byte; /* HTML4.0 entities in decimal form, e.g. Å */ byte = *((unsigned char *) str); if (byte == '&') { int i, n = 0; byte = *((unsigned char *) (str + 1)); if (byte == '#') { for (i = 2; i < 8; i++) { byte = *((unsigned char *) (str + i)); if (byte >= '0' && byte <= '9') { n = (n * 10) + (byte - '0'); } else break; } if (byte == ';') { *chPtr = (Tcl_UniChar) n; return ++i; } } } /* * Unroll 1 to 3 byte UTF-8 sequences, use loop to handle longer ones. */ byte = *((unsigned char *) str); #ifdef JISX0208 if (0xA1 <= byte && byte <= 0xFE) { int ku, ten; ku = (byte & 0x7F) - 0x20; ten = (str[1] & 0x7F) - 0x20; if ((ku < 1 || ku > 92) || (ten < 1 || ten > 94)) { *chPtr = (Tcl_UniChar) byte; return 1; } *chPtr = (Tcl_UniChar) UnicodeTbl[ku - 1][ten - 1]; return 2; } else #endif /* JISX0208 */ if (byte < 0xC0) { /* * Handles properly formed UTF-8 characters between * 0x01 and 0x7F. Also treats \0 and naked trail * bytes 0x80 to 0xBF as valid characters representing * themselves. */ *chPtr = (Tcl_UniChar) byte; return 1; } else if (byte < 0xE0) { if ((str[1] & 0xC0) == 0x80) { /* * Two-byte-character lead-byte followed * by a trail-byte. */ *chPtr = (Tcl_UniChar) (((byte & 0x1F) << 6) | (str[1] & 0x3F)); return 2; } /* * A two-byte-character lead-byte not followed by trail-byte * represents itself. */ *chPtr = (Tcl_UniChar) byte; return 1; } else if (byte < 0xF0) { if (((str[1] & 0xC0) == 0x80) && ((str[2] & 0xC0) == 0x80)) { /* * Three-byte-character lead byte followed by * two trail bytes. */ *chPtr = (Tcl_UniChar) (((byte & 0x0F) << 12) | ((str[1] & 0x3F) << 6) | (str[2] & 0x3F)); return 3; } /* * A three-byte-character lead-byte not followed by * two trail-bytes represents itself. */ *chPtr = (Tcl_UniChar) byte; return 1; } #if TCL_UTF_MAX > 3 else { int ch, total, trail; total = totalBytes[byte]; trail = total - 1; if (trail > 0) { ch = byte & (0x3F >> trail); do { str++; if ((*str & 0xC0) != 0x80) { *chPtr = byte; return 1; } ch <<= 6; ch |= (*str & 0x3F); trail--; } while (trail > 0); *chPtr = ch; return total; } } #endif *chPtr = (Tcl_UniChar) byte; return 1; } /********************************************************************/ /* font cache functions */ static int fontTest (void *element, void *key) { font_t *a = (font_t *) element; fontkey_t *b = (fontkey_t *) key; return (strcmp (a->fontlist, b->fontlist) == 0); } static void *fontFetch (char **error, void *key) { font_t *a; fontkey_t *b = (fontkey_t *) key; int n; int font_found = 0; unsigned short platform, encoding; char *fontsearchpath, *fontlist; char fullname[MAXPATHLEN], cur_dir[MAXPATHLEN]; char *name, *path=NULL, *dir; char *strtok_ptr; FT_Error err; FT_CharMap found = 0; FT_CharMap charmap; a = (font_t *) gdPMalloc(sizeof(font_t)); a->fontlist = gdPEstrdup(b->fontlist); a->library = b->library; /* * Search the pathlist for any of a list of font names. */ fontsearchpath = getenv ("GDFONTPATH"); if (!fontsearchpath) { fontsearchpath = DEFAULT_FONTPATH; } fontlist = gdEstrdup(a->fontlist); /* * Must use gd_strtok_r else pointer corrupted by strtok in nested loop. */ for (name = gd_strtok_r (fontlist, LISTSEPARATOR, &strtok_ptr); name; name = gd_strtok_r (0, LISTSEPARATOR, &strtok_ptr)) { /* make a fresh copy each time - strtok corrupts it. */ path = gdEstrdup (fontsearchpath); /* if name is an absolute filename then test directly */ if (*name == '/' || (name[0] != 0 && name[1] == ':' && (name[2] == '/' || name[2] == '\\'))) { snprintf(fullname, sizeof(fullname) - 1, "%s", name); if (access(fullname, R_OK) == 0) { font_found++; break; } } for (dir = strtok (path, PATHSEPARATOR); dir; dir = strtok (0, PATHSEPARATOR)) { if (!strcmp(dir, ".")) { TSRMLS_FETCH(); #if HAVE_GETCWD dir = VCWD_GETCWD(cur_dir, MAXPATHLEN); #elif HAVE_GETWD dir = VCWD_GETWD(cur_dir); #endif if (!dir) { continue; } } #define GD_CHECK_FONT_PATH(ext) \ snprintf(fullname, sizeof(fullname) - 1, "%s/%s%s", dir, name, ext); \ if (access(fullname, R_OK) == 0) { \ font_found++; \ break; \ } \ GD_CHECK_FONT_PATH(""); GD_CHECK_FONT_PATH(".ttf"); GD_CHECK_FONT_PATH(".pfa"); GD_CHECK_FONT_PATH(".pfb"); GD_CHECK_FONT_PATH(".dfont"); } gdFree(path); path = NULL; if (font_found) { break; } } if (path) { gdFree(path); } gdFree(fontlist); if (!font_found) { gdPFree(a->fontlist); gdPFree(a); *error = "Could not find/open font"; return NULL; } err = FT_New_Face (*b->library, fullname, 0, &a->face); if (err) { gdPFree(a->fontlist); gdPFree(a); *error = "Could not read font"; return NULL; } /* FIXME - This mapping stuff is imcomplete - where is the spec? */ /* EAM - It's worse than that. It's pointless to match character encodings here. * As currently written, the stored a->face->charmap only matches one of * the actual charmaps and we cannot know at this stage if it is the right * one. We should just skip all this stuff, and check in gdImageStringFTEx * if some particular charmap is preferred and if so whether it is held in * one of the a->face->charmaps[0..num_charmaps]. * And why is it so bad not to find any recognized charmap? The user may * still know what mapping to use, even if we do not. In that case we can * just use the map in a->face->charmaps[num_charmaps] and be done with it. */ a->have_char_map_unicode = 0; a->have_char_map_big5 = 0; a->have_char_map_sjis = 0; a->have_char_map_apple_roman = 0; for (n = 0; n < a->face->num_charmaps; n++) { charmap = a->face->charmaps[n]; platform = charmap->platform_id; encoding = charmap->encoding_id; /* EAM DEBUG - Newer versions of libfree2 make it easier by defining encodings */ #if (defined(FREETYPE_MAJOR) && ((FREETYPE_MAJOR == 2 && ((FREETYPE_MINOR == 1 && FREETYPE_PATCH >= 3) || FREETYPE_MINOR > 1) || FREETYPE_MAJOR > 2))) if (charmap->encoding == FT_ENCODING_MS_SYMBOL || charmap->encoding == FT_ENCODING_ADOBE_CUSTOM || charmap->encoding == FT_ENCODING_ADOBE_STANDARD) { a->have_char_map_unicode = 1; found = charmap; a->face->charmap = charmap; return (void *)a; } #endif /* Freetype 2.1.3 or better */ /* EAM DEBUG */ if ((platform == 3 && encoding == 1) /* Windows Unicode */ || (platform == 3 && encoding == 0) /* Windows Symbol */ || (platform == 2 && encoding == 1) /* ISO Unicode */ || (platform == 0)) { /* Apple Unicode */ a->have_char_map_unicode = 1; found = charmap; } else if (platform == 3 && encoding == 4) { /* Windows Big5 */ a->have_char_map_big5 = 1; found = charmap; } else if (platform == 3 && encoding == 2) { /* Windows Sjis */ a->have_char_map_sjis = 1; found = charmap; } else if ((platform == 1 && encoding == 0) /* Apple Roman */ || (platform == 2 && encoding == 0)) { /* ISO ASCII */ a->have_char_map_apple_roman = 1; found = charmap; } } if (!found) { gdPFree(a->fontlist); gdPFree(a); *error = "Unable to find a CharMap that I can handle"; return NULL; } /* 2.0.5: we should actually return this */ a->face->charmap = found; return (void *) a; } static void fontRelease (void *element) { font_t *a = (font_t *) element; FT_Done_Face (a->face); gdPFree(a->fontlist); gdPFree((char *) element); } /********************************************************************/ /* tweencolor cache functions */ static int tweenColorTest (void *element, void *key) { tweencolor_t *a = (tweencolor_t *) element; tweencolorkey_t *b = (tweencolorkey_t *) key; return (a->pixel == b->pixel && a->bgcolor == b->bgcolor && a->fgcolor == b->fgcolor && a->im == b->im); } /* * Computes a color in im's color table that is part way between * the background and foreground colors proportional to the gray * pixel value in the range 0-NUMCOLORS. The fg and bg colors must already * be in the color table for palette images. For truecolor images the * returned value simply has an alpha component and gdImageAlphaBlend * does the work so that text can be alpha blended across a complex * background (TBB; and for real in 2.0.2). */ static void * tweenColorFetch (char **error, void *key) { tweencolor_t *a; tweencolorkey_t *b = (tweencolorkey_t *) key; int pixel, npixel, bg, fg; gdImagePtr im; a = (tweencolor_t *) gdMalloc (sizeof (tweencolor_t)); pixel = a->pixel = b->pixel; bg = a->bgcolor = b->bgcolor; fg = a->fgcolor = b->fgcolor; im = b->im; /* if fg is specified by a negative color idx, then don't antialias */ if (fg < 0) { if ((pixel + pixel) >= NUMCOLORS) a->tweencolor = -fg; else a->tweencolor = bg; } else { npixel = NUMCOLORS - pixel; if (im->trueColor) { /* 2.0.1: use gdImageSetPixel to do the alpha blending work, or to just store the alpha level. All we have to do here is incorporate our knowledge of the percentage of this pixel that is really "lit" by pushing the alpha value up toward transparency in edge regions. */ a->tweencolor = gdTrueColorAlpha ( gdTrueColorGetRed (fg), gdTrueColorGetGreen (fg), gdTrueColorGetBlue (fg), gdAlphaMax - (gdTrueColorGetAlpha (fg) * pixel / NUMCOLORS)); } else { a->tweencolor = gdImageColorResolve (im, (pixel * im->red[fg] + npixel * im->red[bg]) / NUMCOLORS, (pixel * im->green[fg] + npixel * im->green[bg]) / NUMCOLORS, (pixel * im->blue[fg] + npixel * im->blue[bg]) / NUMCOLORS); } } return (void *) a; } static void tweenColorRelease (void *element) { gdFree ((char *) element); } /* draw_bitmap - transfers glyph bitmap to GD image */ static char * gdft_draw_bitmap (gdCache_head_t *tc_cache, gdImage * im, int fg, FT_Bitmap bitmap, int pen_x, int pen_y) { unsigned char *pixel = NULL; int *tpixel = NULL; int x, y, row, col, pc, pcr; tweencolor_t *tc_elem; tweencolorkey_t tc_key; /* copy to image, mapping colors */ tc_key.fgcolor = fg; tc_key.im = im; /* Truecolor version; does not require the cache */ if (im->trueColor) { for (row = 0; row < bitmap.rows; row++) { pc = row * bitmap.pitch; pcr = pc; y = pen_y + row; /* clip if out of bounds */ /* 2.0.16: clipping rectangle, not image bounds */ if ((y > im->cy2) || (y < im->cy1)) continue; for (col = 0; col < bitmap.width; col++, pc++) { int level; if (bitmap.pixel_mode == ft_pixel_mode_grays) { /* * Scale to 128 levels of alpha for gd use. * alpha 0 is opacity, so be sure to invert at the end */ level = (bitmap.buffer[pc] * gdAlphaMax / (bitmap.num_grays - 1)); } else if (bitmap.pixel_mode == ft_pixel_mode_mono) { /* 2.0.5: mode_mono fix from Giuliano Pochini */ level = ((bitmap.buffer[(col>>3)+pcr]) & (1<<(~col&0x07))) ? gdAlphaTransparent : gdAlphaOpaque; } else { return "Unsupported ft_pixel_mode"; } if ((fg >= 0) && (im->trueColor)) { /* Consider alpha in the foreground color itself to be an upper bound on how opaque things get, when truecolor is available. Without truecolor this results in far too many color indexes. */ level = level * (gdAlphaMax - gdTrueColorGetAlpha(fg)) / gdAlphaMax; } level = gdAlphaMax - level; x = pen_x + col; /* clip if out of bounds */ /* 2.0.16: clip to clipping rectangle, Matt McNabb */ if ((x > im->cx2) || (x < im->cx1)) continue; /* get pixel location in gd buffer */ tpixel = &im->tpixels[y][x]; if (fg < 0) { if (level < (gdAlphaMax / 2)) { *tpixel = -fg; } } else { if (im->alphaBlendingFlag) { *tpixel = gdAlphaBlend(*tpixel, (level << 24) + (fg & 0xFFFFFF)); } else { *tpixel = (level << 24) + (fg & 0xFFFFFF); } } } } return (char *) NULL; } /* Non-truecolor case, restored to its more or less original form */ for (row = 0; row < bitmap.rows; row++) { int pcr; pc = row * bitmap.pitch; pcr = pc; if(bitmap.pixel_mode==ft_pixel_mode_mono) pc *= 8; /* pc is measured in bits for monochrome images */ y = pen_y + row; /* clip if out of bounds */ if (y >= im->sy || y < 0) continue; for (col = 0; col < bitmap.width; col++, pc++) { if (bitmap.pixel_mode == ft_pixel_mode_grays) { /* * Round to NUMCOLORS levels of antialiasing for * index color images since only 256 colors are * available. */ tc_key.pixel = ((bitmap.buffer[pc] * NUMCOLORS) + bitmap.num_grays / 2) / (bitmap.num_grays - 1); } else if (bitmap.pixel_mode == ft_pixel_mode_mono) { tc_key.pixel = ((bitmap.buffer[pc / 8] << (pc % 8)) & 128) ? NUMCOLORS : 0; /* 2.0.5: mode_mono fix from Giuliano Pochini */ tc_key.pixel = ((bitmap.buffer[(col>>3)+pcr]) & (1<<(~col&0x07))) ? NUMCOLORS : 0; } else { return "Unsupported ft_pixel_mode"; } if (tc_key.pixel > 0) /* if not background */ { x = pen_x + col; /* clip if out of bounds */ if (x >= im->sx || x < 0) continue; /* get pixel location in gd buffer */ pixel = &im->pixels[y][x]; if (tc_key.pixel == NUMCOLORS) { /* use fg color directly. gd 2.0.2: watch out for negative indexes (thanks to David Marwood). */ *pixel = (fg < 0) ? -fg : fg; } else { /* find antialised color */ tc_key.bgcolor = *pixel; gdMutexLock(gdFontCacheMutex); tc_elem = (tweencolor_t *) gdCacheGet (tc_cache, &tc_key); *pixel = tc_elem->tweencolor; gdMutexUnlock(gdFontCacheMutex); } } } } return (char *) NULL; } static int gdroundupdown (FT_F26Dot6 v1, int updown) { return (!updown) ? (v1 < 0 ? ((v1 - 63) >> 6) : v1 >> 6) : (v1 > 0 ? ((v1 + 63) >> 6) : v1 >> 6); } void gdFontCacheShutdown() { if (fontCache) { gdMutexLock(gdFontCacheMutex); gdCacheDelete(fontCache); fontCache = NULL; gdMutexUnlock(gdFontCacheMutex); gdMutexShutdown(gdFontCacheMutex); FT_Done_FreeType(library); } } void gdFreeFontCache() { gdFontCacheShutdown(); } int gdFontCacheSetup(void) { if (fontCache) { /* Already set up */ return 0; } gdMutexSetup(gdFontCacheMutex); if (FT_Init_FreeType(&library)) { gdMutexShutdown(gdFontCacheMutex); return -1; } fontCache = gdCacheCreate (FONTCACHESIZE, fontTest, fontFetch, fontRelease); return 0; } /********************************************************************/ /* gdImageStringFT - render a utf8 string onto a gd image */ char * gdImageStringFT (gdImage * im, int *brect, int fg, char *fontlist, double ptsize, double angle, int x, int y, char *string) { return gdImageStringFTEx(im, brect, fg, fontlist, ptsize, angle, x, y, string, 0); } char * gdImageStringFTEx (gdImage * im, int *brect, int fg, char *fontlist, double ptsize, double angle, int x, int y, char *string, gdFTStringExtraPtr strex) { FT_BBox bbox, glyph_bbox; FT_Matrix matrix; FT_Vector pen, delta, penf; FT_Face face; FT_Glyph image; FT_GlyphSlot slot; FT_Bool use_kerning; FT_UInt glyph_index, previous; double sin_a = sin (angle); double cos_a = cos (angle); int len, i = 0, ch; int x1 = 0, y1 = 0; font_t *font; fontkey_t fontkey; char *next; char *tmpstr = NULL; int render = (im && (im->trueColor || (fg <= 255 && fg >= -255))); FT_BitmapGlyph bm; /* 2.0.13: Bob Ostermann: don't force autohint, that's just for testing freetype and doesn't look as good */ int render_mode = FT_LOAD_DEFAULT; int m, mfound; /* Now tuneable thanks to Wez Furlong */ double linespace = LINESPACE; /* 2.0.6: put this declaration with the other declarations! */ /* * make a new tweenColorCache on every call * because caching colormappings between calls * is not safe. If the im-pointer points to a * brand new image, the cache gives out bogus * colorindexes. -- 27.06.2001 */ gdCache_head_t *tc_cache; /* Tuneable horizontal and vertical resolution in dots per inch */ int hdpi, vdpi; if (strex && ((strex->flags & gdFTEX_LINESPACE) == gdFTEX_LINESPACE)) { linespace = strex->linespacing; } tc_cache = gdCacheCreate(TWEENCOLORCACHESIZE, tweenColorTest, tweenColorFetch, tweenColorRelease); /***** initialize font library and font cache on first call ******/ if (!fontCache) { if (gdFontCacheSetup() != 0) { gdCacheDelete(tc_cache); return "Failure to initialize font library"; } } /*****/ gdMutexLock(gdFontCacheMutex); /* get the font (via font cache) */ fontkey.fontlist = fontlist; fontkey.library = &library; font = (font_t *) gdCacheGet (fontCache, &fontkey); if (!font) { gdCacheDelete(tc_cache); gdMutexUnlock(gdFontCacheMutex); return fontCache->error; } face = font->face; /* shortcut */ slot = face->glyph; /* shortcut */ /* * Added hdpi and vdpi to support images at non-screen resolutions, i.e. 300 dpi TIFF, * or 100h x 50v dpi FAX format. 2.0.23. * 2004/02/27 Mark Shackelford, mark.shackelford@acs-inc.com */ hdpi = GD_RESOLUTION; vdpi = GD_RESOLUTION; if (strex && (strex->flags & gdFTEX_RESOLUTION)) { hdpi = strex->hdpi; vdpi = strex->vdpi; } if (FT_Set_Char_Size(face, 0, (FT_F26Dot6) (ptsize * 64), hdpi, vdpi)) { gdCacheDelete(tc_cache); gdMutexUnlock(gdFontCacheMutex); return "Could not set character size"; } matrix.xx = (FT_Fixed) (cos_a * (1 << 16)); matrix.yx = (FT_Fixed) (sin_a * (1 << 16)); matrix.xy = -matrix.yx; matrix.yy = matrix.xx; penf.x = penf.y = 0; /* running position of non-rotated string */ pen.x = pen.y = 0; /* running position of rotated string */ bbox.xMin = bbox.xMax = bbox.yMin = bbox.yMax = 0; use_kerning = FT_HAS_KERNING (face); previous = 0; if (fg < 0) { render_mode |= FT_LOAD_MONOCHROME; } /* 2.0.12: allow explicit specification of the preferred map; * but we still fall back if it is not available. */ m = gdFTEX_Unicode; if (strex && (strex->flags & gdFTEX_CHARMAP)) { m = strex->charmap; } /* Try all three types of maps, but start with the specified one */ mfound = 0; for (i = 0; i < 3; i++) { switch (m) { case gdFTEX_Unicode: if (font->have_char_map_unicode) { mfound = 1; } break; case gdFTEX_Shift_JIS: if (font->have_char_map_sjis) { mfound = 1; } break; case gdFTEX_Big5: /* This was the 'else' case, we can't really 'detect' it */ mfound = 1; break; } if (mfound) { break; } m++; m %= 3; } if (!mfound) { /* No character set found! */ gdMutexUnlock(gdFontCacheMutex); return "No character set found"; } #ifndef JISX0208 if (font->have_char_map_sjis) { #endif tmpstr = (char *) gdMalloc(BUFSIZ); any2eucjp(tmpstr, string, BUFSIZ); next = tmpstr; #ifndef JISX0208 } else { next = string; } #endif while (*next) { ch = *next; /* carriage returns */ if (ch == '\r') { penf.x = 0; x1 = (int)(penf.x * cos_a - penf.y * sin_a + 32) / 64; y1 = (int)(penf.x * sin_a + penf.y * cos_a + 32) / 64; pen.x = pen.y = 0; previous = 0; /* clear kerning flag */ next++; continue; } /* newlines */ if (ch == '\n') { /* 2.0.13: reset penf.x. Christopher J. Grayce */ penf.x = 0; penf.y -= (long)(face->size->metrics.height * linespace); penf.y = (penf.y - 32) & -64; /* round to next pixel row */ x1 = (int)(penf.x * cos_a - penf.y * sin_a + 32) / 64; y1 = (int)(penf.x * sin_a + penf.y * cos_a + 32) / 64; pen.x = pen.y = 0; previous = 0; /* clear kerning flag */ next++; continue; } /* EAM DEBUG */ #if (defined(FREETYPE_MAJOR) && ((FREETYPE_MAJOR == 2 && ((FREETYPE_MINOR == 1 && FREETYPE_PATCH >= 3) || FREETYPE_MINOR > 1) || FREETYPE_MAJOR > 2))) if (font->face->charmap->encoding == FT_ENCODING_MS_SYMBOL && strcmp(font->face->family_name, "Symbol") == 0) { /* I do not know the significance of the constant 0xf000. * It was determined by inspection of the character codes * stored in Microsoft font symbol. */ /* Convert to the Symbol glyph range only for a Symbol family member */ len = gdTcl_UtfToUniChar (next, &ch); ch |= 0xf000; next += len; } else #endif /* Freetype 2.1 or better */ /* EAM DEBUG */ switch (m) { case gdFTEX_Unicode: if (font->have_char_map_unicode) { /* use UTF-8 mapping from ASCII */ len = gdTcl_UtfToUniChar(next, &ch); next += len; } break; case gdFTEX_Shift_JIS: if (font->have_char_map_sjis) { unsigned char c; int jiscode; c = *next; if (0xA1 <= c && c <= 0xFE) { next++; jiscode = 0x100 * (c & 0x7F) + ((*next) & 0x7F); ch = (jiscode >> 8) & 0xFF; jiscode &= 0xFF; if (ch & 1) { jiscode += 0x40 - 0x21; } else { jiscode += 0x9E - 0x21; } if (jiscode >= 0x7F) { jiscode++; } ch = (ch - 0x21) / 2 + 0x81; if (ch >= 0xA0) { ch += 0x40; } ch = (ch << 8) + jiscode; } else { ch = c & 0xFF; /* don't extend sign */ } if (*next) next++; } break; case gdFTEX_Big5: { /* * Big 5 mapping: * use "JIS-8 half-width katakana" coding from 8-bit characters. Ref: * ftp://ftp.ora.com/pub/examples/nutshell/ujip/doc/japan.inf-032092.sjs */ ch = (*next) & 0xFF; /* don't extend sign */ next++; if (ch >= 161 /* first code of JIS-8 pair */ && *next) { /* don't advance past '\0' */ /* TBB: Fix from Kwok Wah On: & 255 needed */ ch = (ch * 256) + ((*next) & 255); next++; } } break; } /* set rotation transform */ FT_Set_Transform(face, &matrix, NULL); /* Convert character code to glyph index */ glyph_index = FT_Get_Char_Index(face, ch); /* retrieve kerning distance and move pen position */ if (use_kerning && previous && glyph_index) { FT_Get_Kerning(face, previous, glyph_index, ft_kerning_default, &delta); pen.x += delta.x; penf.x += delta.x; } /* load glyph image into the slot (erase previous one) */ if (FT_Load_Glyph(face, glyph_index, render_mode)) { if (tmpstr) { gdFree(tmpstr); } gdCacheDelete(tc_cache); gdMutexUnlock(gdFontCacheMutex); return "Problem loading glyph"; } /* transform glyph image */ FT_Get_Glyph(slot, &image); if (brect) { /* only if need brect */ FT_Glyph_Get_CBox(image, ft_glyph_bbox_gridfit, &glyph_bbox); glyph_bbox.xMin += penf.x; glyph_bbox.yMin += penf.y; glyph_bbox.xMax += penf.x; glyph_bbox.yMax += penf.y; if (ch == ' ') { /* special case for trailing space */ glyph_bbox.xMax += slot->metrics.horiAdvance; } if (!i) { /* if first character, init BB corner values */ bbox.xMin = glyph_bbox.xMin; bbox.yMin = glyph_bbox.yMin; bbox.xMax = glyph_bbox.xMax; bbox.yMax = glyph_bbox.yMax; } else { if (bbox.xMin > glyph_bbox.xMin) { bbox.xMin = glyph_bbox.xMin; } if (bbox.yMin > glyph_bbox.yMin) { bbox.yMin = glyph_bbox.yMin; } if (bbox.xMax < glyph_bbox.xMax) { bbox.xMax = glyph_bbox.xMax; } if (bbox.yMax < glyph_bbox.yMax) { bbox.yMax = glyph_bbox.yMax; } } i++; } if (render) { if (image->format != ft_glyph_format_bitmap && FT_Glyph_To_Bitmap(&image, ft_render_mode_normal, 0, 1)) { if (tmpstr) { gdFree(tmpstr); } gdCacheDelete(tc_cache); gdMutexUnlock(gdFontCacheMutex); return "Problem rendering glyph"; } /* now, draw to our target surface */ bm = (FT_BitmapGlyph) image; gdft_draw_bitmap(tc_cache, im, fg, bm->bitmap, x + x1 + ((pen.x + 31) >> 6) + bm->left, y - y1 + ((pen.y + 31) >> 6) - bm->top); } /* record current glyph index for kerning */ previous = glyph_index; /* increment pen position */ pen.x += image->advance.x >> 10; pen.y -= image->advance.y >> 10; penf.x += slot->metrics.horiAdvance; FT_Done_Glyph(image); } if (brect) { /* only if need brect */ /* For perfect rounding, must get sin(a + pi/4) and sin(a - pi/4). */ double d1 = sin (angle + 0.78539816339744830962); double d2 = sin (angle - 0.78539816339744830962); /* rotate bounding rectangle */ brect[0] = (int) (bbox.xMin * cos_a - bbox.yMin * sin_a); brect[1] = (int) (bbox.xMin * sin_a + bbox.yMin * cos_a); brect[2] = (int) (bbox.xMax * cos_a - bbox.yMin * sin_a); brect[3] = (int) (bbox.xMax * sin_a + bbox.yMin * cos_a); brect[4] = (int) (bbox.xMax * cos_a - bbox.yMax * sin_a); brect[5] = (int) (bbox.xMax * sin_a + bbox.yMax * cos_a); brect[6] = (int) (bbox.xMin * cos_a - bbox.yMax * sin_a); brect[7] = (int) (bbox.xMin * sin_a + bbox.yMax * cos_a); /* scale, round and offset brect */ brect[0] = x + gdroundupdown(brect[0], d2 > 0); brect[1] = y - gdroundupdown(brect[1], d1 < 0); brect[2] = x + gdroundupdown(brect[2], d1 > 0); brect[3] = y - gdroundupdown(brect[3], d2 > 0); brect[4] = x + gdroundupdown(brect[4], d2 < 0); brect[5] = y - gdroundupdown(brect[5], d1 > 0); brect[6] = x + gdroundupdown(brect[6], d1 < 0); brect[7] = y - gdroundupdown(brect[7], d2 < 0); } if (tmpstr) { gdFree(tmpstr); } gdCacheDelete(tc_cache); gdMutexUnlock(gdFontCacheMutex); return (char *) NULL; } #endif /* HAVE_LIBFREETYPE */ php-4.4.8/ext/gd/libgd/gd_io_dp.c0000644000175000017500000001740510032064414015766 0ustar derickderick/* * io_dp.c * * Implements the dynamic pointer interface. * * Based on GD.pm code by Lincoln Stein for interfacing to libgd. * Added support for reading as well as support for 'tell' and 'seek'. * * As will all I/O modules, most functions are for local use only (called * via function pointers in the I/O context). * * gdDPExtractData is the exception to this: it will return the pointer to * the internal data, and reset the internal storage. * * Written/Modified 1999, Philip Warner. * */ #include #include #include #include "gd.h" #include "gdhelpers.h" #define TRUE 1 #define FALSE 0 /* this is used for creating images in main memory */ typedef struct dpStruct { void *data; int logicalSize; int realSize; int dataGood; int pos; int freeOK; } dynamicPtr; typedef struct dpIOCtx { gdIOCtx ctx; dynamicPtr *dp; } dpIOCtx; typedef struct dpIOCtx *dpIOCtxPtr; /* these functions operate on in-memory dynamic pointers */ static int allocDynamic (dynamicPtr * dp, int initialSize, void *data); static int appendDynamic (dynamicPtr * dp, const void *src, int size); static int gdReallocDynamic (dynamicPtr * dp, int required); static int trimDynamic (dynamicPtr * dp); static void gdFreeDynamicCtx (struct gdIOCtx *ctx); static dynamicPtr *newDynamic (int initialSize, void *data, int freeOKFlag); static int dynamicPutbuf (struct gdIOCtx *, const void *, int); static void dynamicPutchar (struct gdIOCtx *, int a); static int dynamicGetbuf (gdIOCtxPtr ctx, void *buf, int len); static int dynamicGetchar (gdIOCtxPtr ctx); static int dynamicSeek (struct gdIOCtx *, const int); static long dynamicTell (struct gdIOCtx *); /* return data as a dynamic pointer */ gdIOCtx * gdNewDynamicCtx (int initialSize, void *data) { return gdNewDynamicCtxEx(initialSize, data, 1); } gdIOCtx * gdNewDynamicCtxEx (int initialSize, void *data, int freeOKFlag) { dpIOCtx *ctx; dynamicPtr *dp; ctx = (dpIOCtx *) gdMalloc (sizeof (dpIOCtx)); if (ctx == NULL) { return NULL; } dp = newDynamic (initialSize, data, freeOKFlag); if (!dp) { gdFree (ctx); return NULL; }; ctx->dp = dp; ctx->ctx.getC = dynamicGetchar; ctx->ctx.putC = dynamicPutchar; ctx->ctx.getBuf = dynamicGetbuf; ctx->ctx.putBuf = dynamicPutbuf; ctx->ctx.seek = dynamicSeek; ctx->ctx.tell = dynamicTell; ctx->ctx.gd_free = gdFreeDynamicCtx; return (gdIOCtx *) ctx; } void * gdDPExtractData (struct gdIOCtx *ctx, int *size) { dynamicPtr *dp; dpIOCtx *dctx; void *data; dctx = (dpIOCtx *) ctx; dp = dctx->dp; /* clean up the data block and return it */ if (dp->dataGood) { trimDynamic (dp); *size = dp->logicalSize; data = dp->data; } else { *size = 0; data = NULL; if (dp->data != NULL && dp->freeOK) { gdFree (dp->data); } } dp->data = NULL; dp->realSize = 0; dp->logicalSize = 0; return data; } static void gdFreeDynamicCtx (struct gdIOCtx *ctx) { dynamicPtr *dp; dpIOCtx *dctx; dctx = (dpIOCtx *) ctx; dp = dctx->dp; gdFree (ctx); dp->realSize = 0; dp->logicalSize = 0; gdFree (dp); } static long dynamicTell (struct gdIOCtx *ctx) { dpIOCtx *dctx; dctx = (dpIOCtx *) ctx; return (dctx->dp->pos); } static int dynamicSeek (struct gdIOCtx *ctx, const int pos) { int bytesNeeded; dynamicPtr *dp; dpIOCtx *dctx; dctx = (dpIOCtx *) ctx; dp = dctx->dp; if (!dp->dataGood) return FALSE; bytesNeeded = pos; if (bytesNeeded > dp->realSize) { /* 2.0.21 */ if (!dp->freeOK) { return FALSE; } if (!gdReallocDynamic (dp, dp->realSize * 2)) { dp->dataGood = FALSE; return FALSE; } } /* if we get here, we can be sure that we have enough bytes to copy safely */ /* Extend the logical size if we seek beyond EOF. */ if (pos > dp->logicalSize) { dp->logicalSize = pos; }; dp->pos = pos; return TRUE; } /* return data as a dynamic pointer */ static dynamicPtr * newDynamic (int initialSize, void *data, int freeOKFlag) { dynamicPtr *dp; dp = (dynamicPtr *) gdMalloc (sizeof (dynamicPtr)); if (dp == NULL) { return NULL; } if (!allocDynamic (dp, initialSize, data)) return NULL; dp->pos = 0; dp->freeOK = freeOKFlag; return dp; } static int dynamicPutbuf (struct gdIOCtx *ctx, const void *buf, int size) { dpIOCtx *dctx; dctx = (dpIOCtx *) ctx; appendDynamic (dctx->dp, buf, size); if (dctx->dp->dataGood) { return size; } else { return -1; }; } static void dynamicPutchar (struct gdIOCtx *ctx, int a) { unsigned char b; dpIOCtxPtr dctx; b = a; dctx = (dpIOCtxPtr) ctx; appendDynamic (dctx->dp, &b, 1); } static int dynamicGetbuf (gdIOCtxPtr ctx, void *buf, int len) { int rlen, remain; dpIOCtxPtr dctx; dynamicPtr *dp; dctx = (dpIOCtxPtr) ctx; dp = dctx->dp; remain = dp->logicalSize - dp->pos; if (remain >= len) { rlen = len; } else { if (remain == 0) { return EOF; } rlen = remain; } memcpy (buf, (void *) ((char *) dp->data + dp->pos), rlen); dp->pos += rlen; return rlen; } static int dynamicGetchar (gdIOCtxPtr ctx) { unsigned char b; int rv; rv = dynamicGetbuf (ctx, &b, 1); if (rv != 1) { return EOF; } else { return b; /* (b & 0xff); */ } } /* ********************************************************************* * InitDynamic - Return a dynamically resizable void* * * ********************************************************************* */ static int allocDynamic (dynamicPtr * dp, int initialSize, void *data) { if (data == NULL) { dp->logicalSize = 0; dp->dataGood = FALSE; dp->data = gdMalloc (initialSize); } else { dp->logicalSize = initialSize; dp->dataGood = TRUE; dp->data = data; } if (dp->data != NULL) { dp->realSize = initialSize; dp->dataGood = TRUE; dp->pos = 0; return TRUE; } else { dp->realSize = 0; return FALSE; } } /* append bytes to the end of a dynamic pointer */ static int appendDynamic (dynamicPtr * dp, const void *src, int size) { int bytesNeeded; char *tmp; if (!dp->dataGood) return FALSE; /* bytesNeeded = dp->logicalSize + size; */ bytesNeeded = dp->pos + size; if (bytesNeeded > dp->realSize) { /* 2.0.21 */ if (!dp->freeOK) { return FALSE; } if (!gdReallocDynamic (dp, bytesNeeded * 2)) { dp->dataGood = FALSE; return FALSE; } } /* if we get here, we can be sure that we have enough bytes to copy safely */ /*printf("Mem OK Size: %d, Pos: %d\n", dp->realSize, dp->pos); */ tmp = (char *) dp->data; memcpy ((void *) (tmp + (dp->pos)), src, size); dp->pos += size; if (dp->pos > dp->logicalSize) { dp->logicalSize = dp->pos; }; return TRUE; } /* grow (or shrink) dynamic pointer */ static int gdReallocDynamic (dynamicPtr * dp, int required) { void *newPtr; /* First try gdRealloc(). If that doesn't work, make a new memory block and copy. */ if ((newPtr = gdRealloc (dp->data, required))) { dp->realSize = required; dp->data = newPtr; return TRUE; } /* create a new pointer */ newPtr = gdMalloc (required); if (!newPtr) { dp->dataGood = FALSE; return FALSE; } /* copy the old data into it */ memcpy (newPtr, dp->data, dp->logicalSize); gdFree (dp->data); dp->data = newPtr; dp->realSize = required; return TRUE; } /* trim pointer so that its real and logical sizes match */ static int trimDynamic (dynamicPtr * dp) { /* 2.0.21: we don't reallocate memory we don't own */ if (!dp->freeOK) { return FALSE; } return gdReallocDynamic (dp, dp->logicalSize); } php-4.4.8/ext/gd/libgd/gd_io_ss.c0000644000175000017500000000554007557612321016023 0ustar derickderick /* * io_ss.c * * Implements the Source/Sink interface. * * As will all I/O modules, most functions are for local use only (called * via function pointers in the I/O context). * * The Source/Sink model is the primary 'user' interface for alternate data * sources; the IOCtx interface is intended (at least in version 1.5) to be * used internally until it settles down a bit. * * This module just layers the Source/Sink interface on top of the IOCtx; no * support is provided for tell/seek, so GD2 writing is not possible, and * retrieving parts of GD2 files is also not possible. * * A new SS context does not need to be created with both a Source and a Sink. * * Written/Modified 1999, Philip Warner. * */ #include #include #include #include "gd.h" #include "gdhelpers.h" /* this is used for creating images in main memory */ typedef struct ssIOCtx { gdIOCtx ctx; gdSourcePtr src; gdSinkPtr snk; } ssIOCtx; typedef struct ssIOCtx *ssIOCtxPtr; gdIOCtx *gdNewSSCtx (gdSourcePtr src, gdSinkPtr snk); static int sourceGetbuf (gdIOCtx *, void *, int); static int sourceGetchar (gdIOCtx * ctx); static int sinkPutbuf (gdIOCtx * ctx, const void *buf, int size); static void sinkPutchar (gdIOCtx * ctx, int a); static void gdFreeSsCtx (gdIOCtx * ctx); /* return data as a dynamic pointer */ gdIOCtx * gdNewSSCtx (gdSourcePtr src, gdSinkPtr snk) { ssIOCtxPtr ctx; ctx = (ssIOCtxPtr) gdMalloc (sizeof (ssIOCtx)); if (ctx == NULL) { return NULL; } ctx->src = src; ctx->snk = snk; ctx->ctx.getC = sourceGetchar; ctx->ctx.getBuf = sourceGetbuf; ctx->ctx.putC = sinkPutchar; ctx->ctx.putBuf = sinkPutbuf; ctx->ctx.tell = NULL; ctx->ctx.seek = NULL; ctx->ctx.gd_free = gdFreeSsCtx; return (gdIOCtx *) ctx; } static void gdFreeSsCtx (gdIOCtx * ctx) { gdFree (ctx); } static int sourceGetbuf (gdIOCtx * ctx, void *buf, int size) { ssIOCtx *lctx; int res; lctx = (ssIOCtx *) ctx; res = ((lctx->src->source) (lctx->src->context, buf, size)); /* ** Translate the return values from the Source object: ** 0 is EOF, -1 is error */ if (res == 0) { return EOF; } else if (res < 0) { return 0; } else { return res; }; } static int sourceGetchar (gdIOCtx * ctx) { int res; unsigned char buf; res = sourceGetbuf (ctx, &buf, 1); if (res == 1) { return buf; } else { return EOF; }; } static int sinkPutbuf (gdIOCtx * ctx, const void *buf, int size) { ssIOCtxPtr lctx; int res; lctx = (ssIOCtx *) ctx; res = (lctx->snk->sink) (lctx->snk->context, buf, size); if (res <= 0) { return 0; } else { return res; }; } static void sinkPutchar (gdIOCtx * ctx, int a) { unsigned char b; b = a; sinkPutbuf (ctx, &b, 1); } php-4.4.8/ext/gd/libgd/jisx0208.h0000644000175000017500000021326607455710735015544 0ustar derickderick#ifndef JISX0208_H #define JISX0208_H /* This file was derived from "src/VF_Ftype.c" in VFlib2-2.24.2 by Dr. Kakugawa */ /* JIS -> Unicode mapping table */ static unsigned short UnicodeTbl[][94] = { { /* category 01 */ 0x0000, 0x3001, 0x3002, 0xFF0C, 0xFF0E, 0x30FB, 0xFF1A, 0xFF1B, 0xFF1F, 0xFF01, 0x309B, 0x309C, 0x00B4, 0xFF40, 0x00A8, 0xFF3E, 0xFFE3, 0xFF3F, 0x30FD, 0x30FE, 0x309D, 0x309E, 0x3003, 0x4EDD, 0x3005, 0x3006, 0x3007, 0x30FC, 0x2015, 0x2010, 0xFF0F, 0xFF3C, 0xFF5E, 0x2225, 0xFF5C, 0x2026, 0x2025, 0x2018, 0x2019, 0x201C, 0x201D, 0xFF08, 0xFF09, 0x3014, 0x3015, 0xFF3B, 0xFF3D, 0xFF5B, 0xFF5D, 0x3008, 0x3009, 0x300A, 0x300B, 0x300C, 0x300D, 0x300E, 0x300F, 0x3010, 0x3011, 0xFF0B, 0xFF0D, 0x00B1, 0x00D7, 0x00F7, 0xFF1D, 0x2260, 0xFF1C, 0xFF1E, 0x2266, 0x2267, 0x221E, 0x2234, 0x2642, 0x2640, 0x00B0, 0x2032, 0x2033, 0x2103, 0xFFE5, 0xFF04, 0xFFE0, 0xFFE1, 0xFF05, 0xFF03, 0xFF06, 0xFF0A, 0xFF20, 0x00A7, 0x2606, 0x2605, 0x25CB, 0x25CF, 0x25CE, 0x25C7}, { /* category 02 */ 0x25C6, 0x25A1, 0x25A0, 0x25B3, 0x25B2, 0x25BD, 0x25BC, 0x203B, 0x3012, 0x2192, 0x2190, 0x2191, 0x2193, 0x3013, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2208, 0x220B, 0x2286, 0x2287, 0x2282, 0x2283, 0x222A, 0x2229, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2227, 0x2228, 0xFFE2, 0x21D2, 0x21D4, 0x2200, 0x2203, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2220, 0x22A5, 0x2312, 0x2202, 0x2207, 0x2261, 0x2252, 0x226A, 0x226B, 0x221A, 0x223D, 0x221D, 0x2235, 0x222B, 0x222C, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x212B, 0x2030, 0x266F, 0x266D, 0x266A, 0x2020, 0x2021, /**/ 0x00B6, 0x0000, 0x0000, 0x0000, 0x0000, 0x25EF}, { /* category 03 */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFF10, 0xFF11, 0xFF12, 0xFF13, 0xFF14, 0xFF15, 0xFF16, 0xFF17, 0xFF18, 0xFF19, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFF21, 0xFF22, 0xFF23, 0xFF24, 0xFF25, 0xFF26, 0xFF27, 0xFF28, 0xFF29, 0xFF2A, 0xFF2B, 0xFF2C, 0xFF2D, 0xFF2E, 0xFF2F, 0xFF30, 0xFF31, 0xFF32, 0xFF33, 0xFF34, 0xFF35, 0xFF36, 0xFF37, 0xFF38, 0xFF39, 0xFF3A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFF41, 0xFF42, 0xFF43, 0xFF44, 0xFF45, 0xFF46, 0xFF47, 0xFF48, 0xFF49, 0xFF4A, 0xFF4B, 0xFF4C, 0xFF4D, 0xFF4E, 0xFF4F, 0xFF50, 0xFF51, 0xFF52, 0xFF53, 0xFF54, 0xFF55, 0xFF56, 0xFF57, 0xFF58, 0xFF59, 0xFF5A, 0x0000, 0x0000, 0x0000, 0x0000}, { /* category 04 */ 0x3041, 0x3042, 0x3043, 0x3044, 0x3045, 0x3046, 0x3047, 0x3048, 0x3049, 0x304A, 0x304B, 0x304C, 0x304D, 0x304E, 0x304F, 0x3050, 0x3051, 0x3052, 0x3053, 0x3054, 0x3055, 0x3056, 0x3057, 0x3058, 0x3059, 0x305A, 0x305B, 0x305C, 0x305D, 0x305E, 0x305F, 0x3060, 0x3061, 0x3062, 0x3063, 0x3064, 0x3065, 0x3066, 0x3067, 0x3068, 0x3069, 0x306A, 0x306B, 0x306C, 0x306D, 0x306E, 0x306F, 0x3070, 0x3071, 0x3072, 0x3073, 0x3074, 0x3075, 0x3076, 0x3077, 0x3078, 0x3079, 0x307A, 0x307B, 0x307C, 0x307D, 0x307E, 0x307F, 0x3080, 0x3081, 0x3082, 0x3083, 0x3084, 0x3085, 0x3086, 0x3087, 0x3088, 0x3089, 0x308A, 0x308B, 0x308C, 0x308D, 0x308E, 0x308F, 0x3090, 0x3091, 0x3092, 0x3093, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}, { /* category 05 */ 0x30A1, 0x30A2, 0x30A3, 0x30A4, 0x30A5, 0x30A6, 0x30A7, 0x30A8, 0x30A9, 0x30AA, 0x30AB, 0x30AC, 0x30AD, 0x30AE, 0x30AF, 0x30B0, 0x30B1, 0x30B2, 0x30B3, 0x30B4, 0x30B5, 0x30B6, 0x30B7, 0x30B8, 0x30B9, 0x30BA, 0x30BB, 0x30BC, 0x30BD, 0x30BE, 0x30BF, 0x30C0, 0x30C1, 0x30C2, 0x30C3, 0x30C4, 0x30C5, 0x30C6, 0x30C7, 0x30C8, 0x30C9, 0x30CA, 0x30CB, 0x30CC, 0x30CD, 0x30CE, 0x30CF, 0x30D0, 0x30D1, 0x30D2, 0x30D3, 0x30D4, 0x30D5, 0x30D6, 0x30D7, 0x30D8, 0x30D9, 0x30DA, 0x30DB, 0x30DC, 0x30DD, 0x30DE, 0x30DF, 0x30E0, 0x30E1, 0x30E2, 0x30E3, 0x30E4, 0x30E5, 0x30E6, 0x30E7, 0x30E8, 0x30E9, 0x30EA, 0x30EB, 0x30EC, 0x30ED, 0x30EE, 0x30EF, 0x30F0, 0x30F1, 0x30F2, 0x30F3, 0x30F4, 0x30F5, 0x30F6, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}, { /* category 06 */ 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, 0x0398, 0x0399, 0x039A, 0x039B, 0x039C, 0x039D, 0x039E, 0x039F, 0x03A0, 0x03A1, 0x03A3, 0x03A4, 0x03A5, 0x03A6, 0x03A7, 0x03A8, 0x03A9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7, 0x03B8, 0x03B9, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF, 0x03C0, 0x03C1, 0x03C3, 0x03C4, 0x03C5, 0x03C6, 0x03C7, 0x03C8, 0x03C9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}, { /* category 07 */ 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0401, 0x0416, 0x0417, 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, 0x041F, 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, 0x0428, 0x0429, 0x042A, 0x042B, 0x042C, 0x042D, 0x042E, 0x042F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0451, 0x0436, 0x0437, 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F, 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, 0x0448, 0x0449, 0x044A, 0x044B, 0x044C, 0x044D, 0x044E, 0x044F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}, { /* category 08 */ 0x2500, 0x2502, 0x250C, 0x2510, 0x2518, 0x2514, 0x251C, 0x252C, 0x2524, 0x2534, 0x253C, 0x2501, 0x2503, 0x250F, 0x2513, 0x251B, 0x2517, 0x2523, 0x2533, 0x252B, 0x253B, 0x254B, 0x2520, 0x252F, 0x2528, 0x2537, 0x253F, 0x251D, 0x2530, 0x2525, 0x2538, 0x2542, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}, { /* category 09 */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}, { /* category 10 */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}, { /* category 11 */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}, { /* category 12 */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}, { /* category 13 */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}, { /* category 14 */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}, { /* category 15 */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}, { /* category 16 */ 0x4E9C, 0x5516, 0x5A03, 0x963F, 0x54C0, 0x611B, 0x6328, 0x59F6, 0x9022, 0x8475, 0x831C, 0x7A50, 0x60AA, 0x63E1, 0x6E25, 0x65ED, 0x8466, 0x82A6, 0x9BF5, 0x6893, 0x5727, 0x65A1, 0x6271, 0x5B9B, 0x59D0, 0x867B, 0x98F4, 0x7D62, 0x7DBE, 0x9B8E, 0x6216, 0x7C9F, 0x88B7, 0x5B89, 0x5EB5, 0x6309, 0x6697, 0x6848, 0x95C7, 0x978D, 0x674F, 0x4EE5, 0x4F0A, 0x4F4D, 0x4F9D, 0x5049, 0x56F2, 0x5937, 0x59D4, 0x5A01, 0x5C09, 0x60DF, 0x610F, 0x6170, 0x6613, 0x6905, 0x70BA, 0x754F, 0x7570, 0x79FB, 0x7DAD, 0x7DEF, 0x80C3, 0x840E, 0x8863, 0x8B02, 0x9055, 0x907A, 0x533B, 0x4E95, 0x4EA5, 0x57DF, 0x80B2, 0x90C1, 0x78EF, 0x4E00, 0x58F1, 0x6EA2, 0x9038, 0x7A32, 0x8328, 0x828B, 0x9C2F, 0x5141, 0x5370, 0x54BD, 0x54E1, 0x56E0, 0x59FB, 0x5F15, 0x98F2, 0x6DEB, 0x80E4, 0x852D}, { /* category 17 */ 0x9662, 0x9670, 0x96A0, 0x97FB, 0x540B, 0x53F3, 0x5B87, 0x70CF, 0x7FBD, 0x8FC2, 0x96E8, 0x536F, 0x9D5C, 0x7ABA, 0x4E11, 0x7893, 0x81FC, 0x6E26, 0x5618, 0x5504, 0x6B1D, 0x851A, 0x9C3B, 0x59E5, 0x53A9, 0x6D66, 0x74DC, 0x958F, 0x5642, 0x4E91, 0x904B, 0x96F2, 0x834F, 0x990C, 0x53E1, 0x55B6, 0x5B30, 0x5F71, 0x6620, 0x66F3, 0x6804, 0x6C38, 0x6CF3, 0x6D29, 0x745B, 0x76C8, 0x7A4E, 0x9834, 0x82F1, 0x885B, 0x8A60, 0x92ED, 0x6DB2, 0x75AB, 0x76CA, 0x99C5, 0x60A6, 0x8B01, 0x8D8A, 0x95B2, 0x698E, 0x53AD, 0x5186, 0x5712, 0x5830, 0x5944, 0x5BB4, 0x5EF6, 0x6028, 0x63A9, 0x63F4, 0x6CBF, 0x6F14, 0x708E, 0x7114, 0x7159, 0x71D5, 0x733F, 0x7E01, 0x8276, 0x82D1, 0x8597, 0x9060, 0x925B, 0x9D1B, 0x5869, 0x65BC, 0x6C5A, 0x7525, 0x51F9, 0x592E, 0x5965, 0x5F80, 0x5FDC}, { /* category 18 */ 0x62BC, 0x65FA, 0x6A2A, 0x6B27, 0x6BB4, 0x738B, 0x7FC1, 0x8956, 0x9D2C, 0x9D0E, 0x9EC4, 0x5CA1, 0x6C96, 0x837B, 0x5104, 0x5C4B, 0x61B6, 0x81C6, 0x6876, 0x7261, 0x4E59, 0x4FFA, 0x5378, 0x6069, 0x6E29, 0x7A4F, 0x97F3, 0x4E0B, 0x5316, 0x4EEE, 0x4F55, 0x4F3D, 0x4FA1, 0x4F73, 0x52A0, 0x53EF, 0x5609, 0x590F, 0x5AC1, 0x5BB6, 0x5BE1, 0x79D1, 0x6687, 0x679C, 0x67B6, 0x6B4C, 0x6CB3, 0x706B, 0x73C2, 0x798D, 0x79BE, 0x7A3C, 0x7B87, 0x82B1, 0x82DB, 0x8304, 0x8377, 0x83EF, 0x83D3, 0x8766, 0x8AB2, 0x5629, 0x8CA8, 0x8FE6, 0x904E, 0x971E, 0x868A, 0x4FC4, 0x5CE8, 0x6211, 0x7259, 0x753B, 0x81E5, 0x82BD, 0x86FE, 0x8CC0, 0x96C5, 0x9913, 0x99D5, 0x4ECB, 0x4F1A, 0x89E3, 0x56DE, 0x584A, 0x58CA, 0x5EFB, 0x5FEB, 0x602A, 0x6094, 0x6062, 0x61D0, 0x6212, 0x62D0, 0x6539}, { /* category 19 */ 0x9B41, 0x6666, 0x68B0, 0x6D77, 0x7070, 0x754C, 0x7686, 0x7D75, 0x82A5, 0x87F9, 0x958B, 0x968E, 0x8C9D, 0x51F1, 0x52BE, 0x5916, 0x54B3, 0x5BB3, 0x5D16, 0x6168, 0x6982, 0x6DAF, 0x788D, 0x84CB, 0x8857, 0x8A72, 0x93A7, 0x9AB8, 0x6D6C, 0x99A8, 0x86D9, 0x57A3, 0x67FF, 0x86CE, 0x920E, 0x5283, 0x5687, 0x5404, 0x5ED3, 0x62E1, 0x64B9, 0x683C, 0x6838, 0x6BBB, 0x7372, 0x78BA, 0x7A6B, 0x899A, 0x89D2, 0x8D6B, 0x8F03, 0x90ED, 0x95A3, 0x9694, 0x9769, 0x5B66, 0x5CB3, 0x697D, 0x984D, 0x984E, 0x639B, 0x7B20, 0x6A2B, 0x6A7F, 0x68B6, 0x9C0D, 0x6F5F, 0x5272, 0x559D, 0x6070, 0x62EC, 0x6D3B, 0x6E07, 0x6ED1, 0x845B, 0x8910, 0x8F44, 0x4E14, 0x9C39, 0x53F6, 0x691B, 0x6A3A, 0x9784, 0x682A, 0x515C, 0x7AC3, 0x84B2, 0x91DC, 0x938C, 0x565B, 0x9D28, 0x6822, 0x8305, 0x8431}, { /* category 20 */ 0x7CA5, 0x5208, 0x82C5, 0x74E6, 0x4E7E, 0x4F83, 0x51A0, 0x5BD2, 0x520A, 0x52D8, 0x52E7, 0x5DFB, 0x559A, 0x582A, 0x59E6, 0x5B8C, 0x5B98, 0x5BDB, 0x5E72, 0x5E79, 0x60A3, 0x611F, 0x6163, 0x61BE, 0x63DB, 0x6562, 0x67D1, 0x6853, 0x68FA, 0x6B3E, 0x6B53, 0x6C57, 0x6F22, 0x6F97, 0x6F45, 0x74B0, 0x7518, 0x76E3, 0x770B, 0x7AFF, 0x7BA1, 0x7C21, 0x7DE9, 0x7F36, 0x7FF0, 0x809D, 0x8266, 0x839E, 0x89B3, 0x8ACC, 0x8CAB, 0x9084, 0x9451, 0x9593, 0x9591, 0x95A2, 0x9665, 0x97D3, 0x9928, 0x8218, 0x4E38, 0x542B, 0x5CB8, 0x5DCC, 0x73A9, 0x764C, 0x773C, 0x5CA9, 0x7FEB, 0x8D0B, 0x96C1, 0x9811, 0x9854, 0x9858, 0x4F01, 0x4F0E, 0x5371, 0x559C, 0x5668, 0x57FA, 0x5947, 0x5B09, 0x5BC4, 0x5C90, 0x5E0C, 0x5E7E, 0x5FCC, 0x63EE, 0x673A, 0x65D7, 0x65E2, 0x671F, 0x68CB, 0x68C4}, { /* category 21 */ 0x6A5F, 0x5E30, 0x6BC5, 0x6C17, 0x6C7D, 0x757F, 0x7948, 0x5B63, 0x7A00, 0x7D00, 0x5FBD, 0x898F, 0x8A18, 0x8CB4, 0x8D77, 0x8ECC, 0x8F1D, 0x98E2, 0x9A0E, 0x9B3C, 0x4E80, 0x507D, 0x5100, 0x5993, 0x5B9C, 0x622F, 0x6280, 0x64EC, 0x6B3A, 0x72A0, 0x7591, 0x7947, 0x7FA9, 0x87FB, 0x8ABC, 0x8B70, 0x63AC, 0x83CA, 0x97A0, 0x5409, 0x5403, 0x55AB, 0x6854, 0x6A58, 0x8A70, 0x7827, 0x6775, 0x9ECD, 0x5374, 0x5BA2, 0x811A, 0x8650, 0x9006, 0x4E18, 0x4E45, 0x4EC7, 0x4F11, 0x53CA, 0x5438, 0x5BAE, 0x5F13, 0x6025, 0x6551, 0x673D, 0x6C42, 0x6C72, 0x6CE3, 0x7078, 0x7403, 0x7A76, 0x7AAE, 0x7B08, 0x7D1A, 0x7CFE, 0x7D66, 0x65E7, 0x725B, 0x53BB, 0x5C45, 0x5DE8, 0x62D2, 0x62E0, 0x6319, 0x6E20, 0x865A, 0x8A31, 0x8DDD, 0x92F8, 0x6F01, 0x79A6, 0x9B5A, 0x4EA8, 0x4EAB, 0x4EAC}, { /* category 22 */ 0x4F9B, 0x4FA0, 0x50D1, 0x5147, 0x7AF6, 0x5171, 0x51F6, 0x5354, 0x5321, 0x537F, 0x53EB, 0x55AC, 0x5883, 0x5CE1, 0x5F37, 0x5F4A, 0x602F, 0x6050, 0x606D, 0x631F, 0x6559, 0x6A4B, 0x6CC1, 0x72C2, 0x72ED, 0x77EF, 0x80F8, 0x8105, 0x8208, 0x854E, 0x90F7, 0x93E1, 0x97FF, 0x9957, 0x9A5A, 0x4EF0, 0x51DD, 0x5C2D, 0x6681, 0x696D, 0x5C40, 0x66F2, 0x6975, 0x7389, 0x6850, 0x7C81, 0x50C5, 0x52E4, 0x5747, 0x5DFE, 0x9326, 0x65A4, 0x6B23, 0x6B3D, 0x7434, 0x7981, 0x79BD, 0x7B4B, 0x7DCA, 0x82B9, 0x83CC, 0x887F, 0x895F, 0x8B39, 0x8FD1, 0x91D1, 0x541F, 0x9280, 0x4E5D, 0x5036, 0x53E5, 0x533A, 0x72D7, 0x7396, 0x77E9, 0x82E6, 0x8EAF, 0x99C6, 0x99C8, 0x99D2, 0x5177, 0x611A, 0x865E, 0x55B0, 0x7A7A, 0x5076, 0x5BD3, 0x9047, 0x9685, 0x4E32, 0x6ADB, 0x91E7, 0x5C51, 0x5C48}, { /* category 23 */ 0x6398, 0x7A9F, 0x6C93, 0x9774, 0x8F61, 0x7AAA, 0x718A, 0x9688, 0x7C82, 0x6817, 0x7E70, 0x6851, 0x936C, 0x52F2, 0x541B, 0x85AB, 0x8A13, 0x7FA4, 0x8ECD, 0x90E1, 0x5366, 0x8888, 0x7941, 0x4FC2, 0x50BE, 0x5211, 0x5144, 0x5553, 0x572D, 0x73EA, 0x578B, 0x5951, 0x5F62, 0x5F84, 0x6075, 0x6176, 0x6167, 0x61A9, 0x63B2, 0x643A, 0x656C, 0x666F, 0x6842, 0x6E13, 0x7566, 0x7A3D, 0x7CFB, 0x7D4C, 0x7D99, 0x7E4B, 0x7F6B, 0x830E, 0x834A, 0x86CD, 0x8A08, 0x8A63, 0x8B66, 0x8EFD, 0x981A, 0x9D8F, 0x82B8, 0x8FCE, 0x9BE8, 0x5287, 0x621F, 0x6483, 0x6FC0, 0x9699, 0x6841, 0x5091, 0x6B20, 0x6C7A, 0x6F54, 0x7A74, 0x7D50, 0x8840, 0x8A23, 0x6708, 0x4EF6, 0x5039, 0x5026, 0x5065, 0x517C, 0x5238, 0x5263, 0x55A7, 0x570F, 0x5805, 0x5ACC, 0x5EFA, 0x61B2, 0x61F8, 0x62F3, 0x6372}, { /* category 24 */ 0x691C, 0x6A29, 0x727D, 0x72AC, 0x732E, 0x7814, 0x786F, 0x7D79, 0x770C, 0x80A9, 0x898B, 0x8B19, 0x8CE2, 0x8ED2, 0x9063, 0x9375, 0x967A, 0x9855, 0x9A13, 0x9E78, 0x5143, 0x539F, 0x53B3, 0x5E7B, 0x5F26, 0x6E1B, 0x6E90, 0x7384, 0x73FE, 0x7D43, 0x8237, 0x8A00, 0x8AFA, 0x9650, 0x4E4E, 0x500B, 0x53E4, 0x547C, 0x56FA, 0x59D1, 0x5B64, 0x5DF1, 0x5EAB, 0x5F27, 0x6238, 0x6545, 0x67AF, 0x6E56, 0x72D0, 0x7CCA, 0x88B4, 0x80A1, 0x80E1, 0x83F0, 0x864E, 0x8A87, 0x8DE8, 0x9237, 0x96C7, 0x9867, 0x9F13, 0x4E94, 0x4E92, 0x4F0D, 0x5348, 0x5449, 0x543E, 0x5A2F, 0x5F8C, 0x5FA1, 0x609F, 0x68A7, 0x6A8E, 0x745A, 0x7881, 0x8A9E, 0x8AA4, 0x8B77, 0x9190, 0x4E5E, 0x9BC9, 0x4EA4, 0x4F7C, 0x4FAF, 0x5019, 0x5016, 0x5149, 0x516C, 0x529F, 0x52B9, 0x52FE, 0x539A, 0x53E3, 0x5411}, { /* category 25 */ 0x540E, 0x5589, 0x5751, 0x57A2, 0x597D, 0x5B54, 0x5B5D, 0x5B8F, 0x5DE5, 0x5DE7, 0x5DF7, 0x5E78, 0x5E83, 0x5E9A, 0x5EB7, 0x5F18, 0x6052, 0x614C, 0x6297, 0x62D8, 0x63A7, 0x653B, 0x6602, 0x6643, 0x66F4, 0x676D, 0x6821, 0x6897, 0x69CB, 0x6C5F, 0x6D2A, 0x6D69, 0x6E2F, 0x6E9D, 0x7532, 0x7687, 0x786C, 0x7A3F, 0x7CE0, 0x7D05, 0x7D18, 0x7D5E, 0x7DB1, 0x8015, 0x8003, 0x80AF, 0x80B1, 0x8154, 0x818F, 0x822A, 0x8352, 0x884C, 0x8861, 0x8B1B, 0x8CA2, 0x8CFC, 0x90CA, 0x9175, 0x9271, 0x783F, 0x92FC, 0x95A4, 0x964D, 0x9805, 0x9999, 0x9AD8, 0x9D3B, 0x525B, 0x52AB, 0x53F7, 0x5408, 0x58D5, 0x62F7, 0x6FE0, 0x8C6A, 0x8F5F, 0x9EB9, 0x514B, 0x523B, 0x544A, 0x56FD, 0x7A40, 0x9177, 0x9D60, 0x9ED2, 0x7344, 0x6F09, 0x8170, 0x7511, 0x5FFD, 0x60DA, 0x9AA8, 0x72DB, 0x8FBC}, { /* category 26 */ 0x6B64, 0x9803, 0x4ECA, 0x56F0, 0x5764, 0x58BE, 0x5A5A, 0x6068, 0x61C7, 0x660F, 0x6606, 0x6839, 0x68B1, 0x6DF7, 0x75D5, 0x7D3A, 0x826E, 0x9B42, 0x4E9B, 0x4F50, 0x53C9, 0x5506, 0x5D6F, 0x5DE6, 0x5DEE, 0x67FB, 0x6C99, 0x7473, 0x7802, 0x8A50, 0x9396, 0x88DF, 0x5750, 0x5EA7, 0x632B, 0x50B5, 0x50AC, 0x518D, 0x6700, 0x54C9, 0x585E, 0x59BB, 0x5BB0, 0x5F69, 0x624D, 0x63A1, 0x683D, 0x6B73, 0x6E08, 0x707D, 0x91C7, 0x7280, 0x7815, 0x7826, 0x796D, 0x658E, 0x7D30, 0x83DC, 0x88C1, 0x8F09, 0x969B, 0x5264, 0x5728, 0x6750, 0x7F6A, 0x8CA1, 0x51B4, 0x5742, 0x962A, 0x583A, 0x698A, 0x80B4, 0x54B2, 0x5D0E, 0x57FC, 0x7895, 0x9DFA, 0x4F5C, 0x524A, 0x548B, 0x643E, 0x6628, 0x6714, 0x67F5, 0x7A84, 0x7B56, 0x7D22, 0x932F, 0x685C, 0x9BAD, 0x7B39, 0x5319, 0x518A, 0x5237}, { /* category 27 */ 0x5BDF, 0x62F6, 0x64AE, 0x64E6, 0x672D, 0x6BBA, 0x85A9, 0x96D1, 0x7690, 0x9BD6, 0x634C, 0x9306, 0x9BAB, 0x76BF, 0x6652, 0x4E09, 0x5098, 0x53C2, 0x5C71, 0x60E8, 0x6492, 0x6563, 0x685F, 0x71E6, 0x73CA, 0x7523, 0x7B97, 0x7E82, 0x8695, 0x8B83, 0x8CDB, 0x9178, 0x9910, 0x65AC, 0x66AB, 0x6B8B, 0x4ED5, 0x4ED4, 0x4F3A, 0x4F7F, 0x523A, 0x53F8, 0x53F2, 0x55E3, 0x56DB, 0x58EB, 0x59CB, 0x59C9, 0x59FF, 0x5B50, 0x5C4D, 0x5E02, 0x5E2B, 0x5FD7, 0x601D, 0x6307, 0x652F, 0x5B5C, 0x65AF, 0x65BD, 0x65E8, 0x679D, 0x6B62, 0x6B7B, 0x6C0F, 0x7345, 0x7949, 0x79C1, 0x7CF8, 0x7D19, 0x7D2B, 0x80A2, 0x8102, 0x81F3, 0x8996, 0x8A5E, 0x8A69, 0x8A66, 0x8A8C, 0x8AEE, 0x8CC7, 0x8CDC, 0x96CC, 0x98FC, 0x6B6F, 0x4E8B, 0x4F3C, 0x4F8D, 0x5150, 0x5B57, 0x5BFA, 0x6148, 0x6301, 0x6642}, { /* category 28 */ 0x6B21, 0x6ECB, 0x6CBB, 0x723E, 0x74BD, 0x75D4, 0x78C1, 0x793A, 0x800C, 0x8033, 0x81EA, 0x8494, 0x8F9E, 0x6C50, 0x9E7F, 0x5F0F, 0x8B58, 0x9D2B, 0x7AFA, 0x8EF8, 0x5B8D, 0x96EB, 0x4E03, 0x53F1, 0x57F7, 0x5931, 0x5AC9, 0x5BA4, 0x6089, 0x6E7F, 0x6F06, 0x75BE, 0x8CEA, 0x5B9F, 0x8500, 0x7BE0, 0x5072, 0x67F4, 0x829D, 0x5C61, 0x854A, 0x7E1E, 0x820E, 0x5199, 0x5C04, 0x6368, 0x8D66, 0x659C, 0x716E, 0x793E, 0x7D17, 0x8005, 0x8B1D, 0x8ECA, 0x906E, 0x86C7, 0x90AA, 0x501F, 0x52FA, 0x5C3A, 0x6753, 0x707C, 0x7235, 0x914C, 0x91C8, 0x932B, 0x82E5, 0x5BC2, 0x5F31, 0x60F9, 0x4E3B, 0x53D6, 0x5B88, 0x624B, 0x6731, 0x6B8A, 0x72E9, 0x73E0, 0x7A2E, 0x816B, 0x8DA3, 0x9152, 0x9996, 0x5112, 0x53D7, 0x546A, 0x5BFF, 0x6388, 0x6A39, 0x7DAC, 0x9700, 0x56DA, 0x53CE, 0x5468}, { /* category 29 */ 0x5B97, 0x5C31, 0x5DDE, 0x4FEE, 0x6101, 0x62FE, 0x6D32, 0x79C0, 0x79CB, 0x7D42, 0x7E4D, 0x7FD2, 0x81ED, 0x821F, 0x8490, 0x8846, 0x8972, 0x8B90, 0x8E74, 0x8F2F, 0x9031, 0x914B, 0x916C, 0x96C6, 0x919C, 0x4EC0, 0x4F4F, 0x5145, 0x5341, 0x5F93, 0x620E, 0x67D4, 0x6C41, 0x6E0B, 0x7363, 0x7E26, 0x91CD, 0x9283, 0x53D4, 0x5919, 0x5BBF, 0x6DD1, 0x795D, 0x7E2E, 0x7C9B, 0x587E, 0x719F, 0x51FA, 0x8853, 0x8FF0, 0x4FCA, 0x5CFB, 0x6625, 0x77AC, 0x7AE3, 0x821C, 0x99FF, 0x51C6, 0x5FAA, 0x65EC, 0x696F, 0x6B89, 0x6DF3, 0x6E96, 0x6F64, 0x76FE, 0x7D14, 0x5DE1, 0x9075, 0x9187, 0x9806, 0x51E6, 0x521D, 0x6240, 0x6691, 0x66D9, 0x6E1A, 0x5EB6, 0x7DD2, 0x7F72, 0x66F8, 0x85AF, 0x85F7, 0x8AF8, 0x52A9, 0x53D9, 0x5973, 0x5E8F, 0x5F90, 0x6055, 0x92E4, 0x9664, 0x50B7, 0x511F}, { /* category 30 */ 0x52DD, 0x5320, 0x5347, 0x53EC, 0x54E8, 0x5546, 0x5531, 0x5617, 0x5968, 0x59BE, 0x5A3C, 0x5BB5, 0x5C06, 0x5C0F, 0x5C11, 0x5C1A, 0x5E84, 0x5E8A, 0x5EE0, 0x5F70, 0x627F, 0x6284, 0x62DB, 0x638C, 0x6377, 0x6607, 0x660C, 0x662D, 0x6676, 0x677E, 0x68A2, 0x6A1F, 0x6A35, 0x6CBC, 0x6D88, 0x6E09, 0x6E58, 0x713C, 0x7126, 0x7167, 0x75C7, 0x7701, 0x785D, 0x7901, 0x7965, 0x79F0, 0x7AE0, 0x7B11, 0x7CA7, 0x7D39, 0x8096, 0x83D6, 0x848B, 0x8549, 0x885D, 0x88F3, 0x8A1F, 0x8A3C, 0x8A54, 0x8A73, 0x8C61, 0x8CDE, 0x91A4, 0x9266, 0x937E, 0x9418, 0x969C, 0x9798, 0x4E0A, 0x4E08, 0x4E1E, 0x4E57, 0x5197, 0x5270, 0x57CE, 0x5834, 0x58CC, 0x5B22, 0x5E38, 0x60C5, 0x64FE, 0x6761, 0x6756, 0x6D44, 0x72B6, 0x7573, 0x7A63, 0x84B8, 0x8B72, 0x91B8, 0x9320, 0x5631, 0x57F4, 0x98FE}, { /* category 31 */ 0x62ED, 0x690D, 0x6B96, 0x71ED, 0x7E54, 0x8077, 0x8272, 0x89E6, 0x98DF, 0x8755, 0x8FB1, 0x5C3B, 0x4F38, 0x4FE1, 0x4FB5, 0x5507, 0x5A20, 0x5BDD, 0x5BE9, 0x5FC3, 0x614E, 0x632F, 0x65B0, 0x664B, 0x68EE, 0x699B, 0x6D78, 0x6DF1, 0x7533, 0x75B9, 0x771F, 0x795E, 0x79E6, 0x7D33, 0x81E3, 0x82AF, 0x85AA, 0x89AA, 0x8A3A, 0x8EAB, 0x8F9B, 0x9032, 0x91DD, 0x9707, 0x4EBA, 0x4EC1, 0x5203, 0x5875, 0x58EC, 0x5C0B, 0x751A, 0x5C3D, 0x814E, 0x8A0A, 0x8FC5, 0x9663, 0x976D, 0x7B25, 0x8ACF, 0x9808, 0x9162, 0x56F3, 0x53A8, 0x9017, 0x5439, 0x5782, 0x5E25, 0x63A8, 0x6C34, 0x708A, 0x7761, 0x7C8B, 0x7FE0, 0x8870, 0x9042, 0x9154, 0x9310, 0x9318, 0x968F, 0x745E, 0x9AC4, 0x5D07, 0x5D69, 0x6570, 0x67A2, 0x8DA8, 0x96DB, 0x636E, 0x6749, 0x6919, 0x83C5, 0x9817, 0x96C0, 0x88FE}, { /* category 32 */ 0x6F84, 0x647A, 0x5BF8, 0x4E16, 0x702C, 0x755D, 0x662F, 0x51C4, 0x5236, 0x52E2, 0x59D3, 0x5F81, 0x6027, 0x6210, 0x653F, 0x6574, 0x661F, 0x6674, 0x68F2, 0x6816, 0x6B63, 0x6E05, 0x7272, 0x751F, 0x76DB, 0x7CBE, 0x8056, 0x58F0, 0x88FD, 0x897F, 0x8AA0, 0x8A93, 0x8ACB, 0x901D, 0x9192, 0x9752, 0x9759, 0x6589, 0x7A0E, 0x8106, 0x96BB, 0x5E2D, 0x60DC, 0x621A, 0x65A5, 0x6614, 0x6790, 0x77F3, 0x7A4D, 0x7C4D, 0x7E3E, 0x810A, 0x8CAC, 0x8D64, 0x8DE1, 0x8E5F, 0x78A9, 0x5207, 0x62D9, 0x63A5, 0x6442, 0x6298, 0x8A2D, 0x7A83, 0x7BC0, 0x8AAC, 0x96EA, 0x7D76, 0x820C, 0x8749, 0x4ED9, 0x5148, 0x5343, 0x5360, 0x5BA3, 0x5C02, 0x5C16, 0x5DDD, 0x6226, 0x6247, 0x64B0, 0x6813, 0x6834, 0x6CC9, 0x6D45, 0x6D17, 0x67D3, 0x6F5C, 0x714E, 0x717D, 0x65CB, 0x7A7F, 0x7BAD, 0x7DDA}, { /* category 33 */ 0x7E4A, 0x7FA8, 0x817A, 0x821B, 0x8239, 0x85A6, 0x8A6E, 0x8CCE, 0x8DF5, 0x9078, 0x9077, 0x92AD, 0x9291, 0x9583, 0x9BAE, 0x524D, 0x5584, 0x6F38, 0x7136, 0x5168, 0x7985, 0x7E55, 0x81B3, 0x7CCE, 0x564C, 0x5851, 0x5CA8, 0x63AA, 0x66FE, 0x66FD, 0x695A, 0x72D9, 0x758F, 0x758E, 0x790E, 0x7956, 0x79DF, 0x7C97, 0x7D20, 0x7D44, 0x8607, 0x8A34, 0x963B, 0x9061, 0x9F20, 0x50E7, 0x5275, 0x53CC, 0x53E2, 0x5009, 0x55AA, 0x58EE, 0x594F, 0x723D, 0x5B8B, 0x5C64, 0x531D, 0x60E3, 0x60F3, 0x635C, 0x6383, 0x633F, 0x63BB, 0x64CD, 0x65E9, 0x66F9, 0x5DE3, 0x69CD, 0x69FD, 0x6F15, 0x71E5, 0x4E89, 0x75E9, 0x76F8, 0x7A93, 0x7CDF, 0x7DCF, 0x7D9C, 0x8061, 0x8349, 0x8358, 0x846C, 0x84BC, 0x85FB, 0x88C5, 0x8D70, 0x9001, 0x906D, 0x9397, 0x971C, 0x9A12, 0x50CF, 0x5897, 0x618E}, { /* category 34 */ 0x81D3, 0x8535, 0x8D08, 0x9020, 0x4FC3, 0x5074, 0x5247, 0x5373, 0x606F, 0x6349, 0x675F, 0x6E2C, 0x8DB3, 0x901F, 0x4FD7, 0x5C5E, 0x8CCA, 0x65CF, 0x7D9A, 0x5352, 0x8896, 0x5176, 0x63C3, 0x5B58, 0x5B6B, 0x5C0A, 0x640D, 0x6751, 0x905C, 0x4ED6, 0x591A, 0x592A, 0x6C70, 0x8A51, 0x553E, 0x5815, 0x59A5, 0x60F0, 0x6253, 0x67C1, 0x8235, 0x6955, 0x9640, 0x99C4, 0x9A28, 0x4F53, 0x5806, 0x5BFE, 0x8010, 0x5CB1, 0x5E2F, 0x5F85, 0x6020, 0x614B, 0x6234, 0x66FF, 0x6CF0, 0x6EDE, 0x80CE, 0x817F, 0x82D4, 0x888B, 0x8CB8, 0x9000, 0x902E, 0x968A, 0x9EDB, 0x9BDB, 0x4EE3, 0x53F0, 0x5927, 0x7B2C, 0x918D, 0x984C, 0x9DF9, 0x6EDD, 0x7027, 0x5353, 0x5544, 0x5B85, 0x6258, 0x629E, 0x62D3, 0x6CA2, 0x6FEF, 0x7422, 0x8A17, 0x9438, 0x6FC1, 0x8AFE, 0x8338, 0x51E7, 0x86F8, 0x53EA}, { /* category 35 */ 0x53E9, 0x4F46, 0x9054, 0x8FB0, 0x596A, 0x8131, 0x5DFD, 0x7AEA, 0x8FBF, 0x68DA, 0x8C37, 0x72F8, 0x9C48, 0x6A3D, 0x8AB0, 0x4E39, 0x5358, 0x5606, 0x5766, 0x62C5, 0x63A2, 0x65E6, 0x6B4E, 0x6DE1, 0x6E5B, 0x70AD, 0x77ED, 0x7AEF, 0x7BAA, 0x7DBB, 0x803D, 0x80C6, 0x86CB, 0x8A95, 0x935B, 0x56E3, 0x58C7, 0x5F3E, 0x65AD, 0x6696, 0x6A80, 0x6BB5, 0x7537, 0x8AC7, 0x5024, 0x77E5, 0x5730, 0x5F1B, 0x6065, 0x667A, 0x6C60, 0x75F4, 0x7A1A, 0x7F6E, 0x81F4, 0x8718, 0x9045, 0x99B3, 0x7BC9, 0x755C, 0x7AF9, 0x7B51, 0x84C4, 0x9010, 0x79E9, 0x7A92, 0x8336, 0x5AE1, 0x7740, 0x4E2D, 0x4EF2, 0x5B99, 0x5FE0, 0x62BD, 0x663C, 0x67F1, 0x6CE8, 0x866B, 0x8877, 0x8A3B, 0x914E, 0x92F3, 0x99D0, 0x6A17, 0x7026, 0x732A, 0x82E7, 0x8457, 0x8CAF, 0x4E01, 0x5146, 0x51CB, 0x558B, 0x5BF5}, { /* category 36 */ 0x5E16, 0x5E33, 0x5E81, 0x5F14, 0x5F35, 0x5F6B, 0x5FB4, 0x61F2, 0x6311, 0x66A2, 0x671D, 0x6F6E, 0x7252, 0x753A, 0x773A, 0x8074, 0x8139, 0x8178, 0x8776, 0x8ABF, 0x8ADC, 0x8D85, 0x8DF3, 0x929A, 0x9577, 0x9802, 0x9CE5, 0x52C5, 0x6357, 0x76F4, 0x6715, 0x6C88, 0x73CD, 0x8CC3, 0x93AE, 0x9673, 0x6D25, 0x589C, 0x690E, 0x69CC, 0x8FFD, 0x939A, 0x75DB, 0x901A, 0x585A, 0x6802, 0x63B4, 0x69FB, 0x4F43, 0x6F2C, 0x67D8, 0x8FBB, 0x8526, 0x7DB4, 0x9354, 0x693F, 0x6F70, 0x576A, 0x58F7, 0x5B2C, 0x7D2C, 0x722A, 0x540A, 0x91E3, 0x9DB4, 0x4EAD, 0x4F4E, 0x505C, 0x5075, 0x5243, 0x8C9E, 0x5448, 0x5824, 0x5B9A, 0x5E1D, 0x5E95, 0x5EAD, 0x5EF7, 0x5F1F, 0x608C, 0x62B5, 0x633A, 0x63D0, 0x68AF, 0x6C40, 0x7887, 0x798E, 0x7A0B, 0x7DE0, 0x8247, 0x8A02, 0x8AE6, 0x8E44, 0x9013}, { /* category 37 */ 0x90B8, 0x912D, 0x91D8, 0x9F0E, 0x6CE5, 0x6458, 0x64E2, 0x6575, 0x6EF4, 0x7684, 0x7B1B, 0x9069, 0x93D1, 0x6EBA, 0x54F2, 0x5FB9, 0x64A4, 0x8F4D, 0x8FED, 0x9244, 0x5178, 0x586B, 0x5929, 0x5C55, 0x5E97, 0x6DFB, 0x7E8F, 0x751C, 0x8CBC, 0x8EE2, 0x985B, 0x70B9, 0x4F1D, 0x6BBF, 0x6FB1, 0x7530, 0x96FB, 0x514E, 0x5410, 0x5835, 0x5857, 0x59AC, 0x5C60, 0x5F92, 0x6597, 0x675C, 0x6E21, 0x767B, 0x83DF, 0x8CED, 0x9014, 0x90FD, 0x934D, 0x7825, 0x783A, 0x52AA, 0x5EA6, 0x571F, 0x5974, 0x6012, 0x5012, 0x515A, 0x51AC, 0x51CD, 0x5200, 0x5510, 0x5854, 0x5858, 0x5957, 0x5B95, 0x5CF6, 0x5D8B, 0x60BC, 0x6295, 0x642D, 0x6771, 0x6843, 0x68BC, 0x68DF, 0x76D7, 0x6DD8, 0x6E6F, 0x6D9B, 0x706F, 0x71C8, 0x5F53, 0x75D8, 0x7977, 0x7B49, 0x7B54, 0x7B52, 0x7CD6, 0x7D71, 0x5230}, { /* category 38 */ 0x8463, 0x8569, 0x85E4, 0x8A0E, 0x8B04, 0x8C46, 0x8E0F, 0x9003, 0x900F, 0x9419, 0x9676, 0x982D, 0x9A30, 0x95D8, 0x50CD, 0x52D5, 0x540C, 0x5802, 0x5C0E, 0x61A7, 0x649E, 0x6D1E, 0x77B3, 0x7AE5, 0x80F4, 0x8404, 0x9053, 0x9285, 0x5CE0, 0x9D07, 0x533F, 0x5F97, 0x5FB3, 0x6D9C, 0x7279, 0x7763, 0x79BF, 0x7BE4, 0x6BD2, 0x72EC, 0x8AAD, 0x6803, 0x6A61, 0x51F8, 0x7A81, 0x6934, 0x5C4A, 0x9CF6, 0x82EB, 0x5BC5, 0x9149, 0x701E, 0x5678, 0x5C6F, 0x60C7, 0x6566, 0x6C8C, 0x8C5A, 0x9041, 0x9813, 0x5451, 0x66C7, 0x920D, 0x5948, 0x90A3, 0x5185, 0x4E4D, 0x51EA, 0x8599, 0x8B0E, 0x7058, 0x637A, 0x934B, 0x6962, 0x99B4, 0x7E04, 0x7577, 0x5357, 0x6960, 0x8EDF, 0x96E3, 0x6C5D, 0x4E8C, 0x5C3C, 0x5F10, 0x8FE9, 0x5302, 0x8CD1, 0x8089, 0x8679, 0x5EFF, 0x65E5, 0x4E73, 0x5165}, { /* category 39 */ 0x5982, 0x5C3F, 0x97EE, 0x4EFB, 0x598A, 0x5FCD, 0x8A8D, 0x6FE1, 0x79B0, 0x7962, 0x5BE7, 0x8471, 0x732B, 0x71B1, 0x5E74, 0x5FF5, 0x637B, 0x649A, 0x71C3, 0x7C98, 0x4E43, 0x5EFC, 0x4E4B, 0x57DC, 0x56A2, 0x60A9, 0x6FC3, 0x7D0D, 0x80FD, 0x8133, 0x81BF, 0x8FB2, 0x8997, 0x86A4, 0x5DF4, 0x628A, 0x64AD, 0x8987, 0x6777, 0x6CE2, 0x6D3E, 0x7436, 0x7834, 0x5A46, 0x7F75, 0x82AD, 0x99AC, 0x4FF3, 0x5EC3, 0x62DD, 0x6392, 0x6557, 0x676F, 0x76C3, 0x724C, 0x80CC, 0x80BA, 0x8F29, 0x914D, 0x500D, 0x57F9, 0x5A92, 0x6885, 0x6973, 0x7164, 0x72FD, 0x8CB7, 0x58F2, 0x8CE0, 0x966A, 0x9019, 0x877F, 0x79E4, 0x77E7, 0x8429, 0x4F2F, 0x5265, 0x535A, 0x62CD, 0x67CF, 0x6CCA, 0x767D, 0x7B94, 0x7C95, 0x8236, 0x8584, 0x8FEB, 0x66DD, 0x6F20, 0x7206, 0x7E1B, 0x83AB, 0x99C1, 0x9EA6}, { /* category 40 */ 0x51FD, 0x7BB1, 0x7872, 0x7BB8, 0x8087, 0x7B48, 0x6AE8, 0x5E61, 0x808C, 0x7551, 0x7560, 0x516B, 0x9262, 0x6E8C, 0x767A, 0x9197, 0x9AEA, 0x4F10, 0x7F70, 0x629C, 0x7B4F, 0x95A5, 0x9CE9, 0x567A, 0x5859, 0x86E4, 0x96BC, 0x4F34, 0x5224, 0x534A, 0x53CD, 0x53DB, 0x5E06, 0x642C, 0x6591, 0x677F, 0x6C3E, 0x6C4E, 0x7248, 0x72AF, 0x73ED, 0x7554, 0x7E41, 0x822C, 0x85E9, 0x8CA9, 0x7BC4, 0x91C6, 0x7169, 0x9812, 0x98EF, 0x633D, 0x6669, 0x756A, 0x76E4, 0x78D0, 0x8543, 0x86EE, 0x532A, 0x5351, 0x5426, 0x5983, 0x5E87, 0x5F7C, 0x60B2, 0x6249, 0x6279, 0x62AB, 0x6590, 0x6BD4, 0x6CCC, 0x75B2, 0x76AE, 0x7891, 0x79D8, 0x7DCB, 0x7F77, 0x80A5, 0x88AB, 0x8AB9, 0x8CBB, 0x907F, 0x975E, 0x98DB, 0x6A0B, 0x7C38, 0x5099, 0x5C3E, 0x5FAE, 0x6787, 0x6BD8, 0x7435, 0x7709, 0x7F8E}, { /* category 41 */ 0x9F3B, 0x67CA, 0x7A17, 0x5339, 0x758B, 0x9AED, 0x5F66, 0x819D, 0x83F1, 0x8098, 0x5F3C, 0x5FC5, 0x7562, 0x7B46, 0x903C, 0x6867, 0x59EB, 0x5A9B, 0x7D10, 0x767E, 0x8B2C, 0x4FF5, 0x5F6A, 0x6A19, 0x6C37, 0x6F02, 0x74E2, 0x7968, 0x8868, 0x8A55, 0x8C79, 0x5EDF, 0x63CF, 0x75C5, 0x79D2, 0x82D7, 0x9328, 0x92F2, 0x849C, 0x86ED, 0x9C2D, 0x54C1, 0x5F6C, 0x658C, 0x6D5C, 0x7015, 0x8CA7, 0x8CD3, 0x983B, 0x654F, 0x74F6, 0x4E0D, 0x4ED8, 0x57E0, 0x592B, 0x5A66, 0x5BCC, 0x51A8, 0x5E03, 0x5E9C, 0x6016, 0x6276, 0x6577, 0x65A7, 0x666E, 0x6D6E, 0x7236, 0x7B26, 0x8150, 0x819A, 0x8299, 0x8B5C, 0x8CA0, 0x8CE6, 0x8D74, 0x961C, 0x9644, 0x4FAE, 0x64AB, 0x6B66, 0x821E, 0x8461, 0x856A, 0x90E8, 0x5C01, 0x6953, 0x98A8, 0x847A, 0x8557, 0x4F0F, 0x526F, 0x5FA9, 0x5E45, 0x670D}, { /* category 42 */ 0x798F, 0x8179, 0x8907, 0x8986, 0x6DF5, 0x5F17, 0x6255, 0x6CB8, 0x4ECF, 0x7269, 0x9B92, 0x5206, 0x543B, 0x5674, 0x58B3, 0x61A4, 0x626E, 0x711A, 0x596E, 0x7C89, 0x7CDE, 0x7D1B, 0x96F0, 0x6587, 0x805E, 0x4E19, 0x4F75, 0x5175, 0x5840, 0x5E63, 0x5E73, 0x5F0A, 0x67C4, 0x4E26, 0x853D, 0x9589, 0x965B, 0x7C73, 0x9801, 0x50FB, 0x58C1, 0x7656, 0x78A7, 0x5225, 0x77A5, 0x8511, 0x7B86, 0x504F, 0x5909, 0x7247, 0x7BC7, 0x7DE8, 0x8FBA, 0x8FD4, 0x904D, 0x4FBF, 0x52C9, 0x5A29, 0x5F01, 0x97AD, 0x4FDD, 0x8217, 0x92EA, 0x5703, 0x6355, 0x6B69, 0x752B, 0x88DC, 0x8F14, 0x7A42, 0x52DF, 0x5893, 0x6155, 0x620A, 0x66AE, 0x6BCD, 0x7C3F, 0x83E9, 0x5023, 0x4FF8, 0x5305, 0x5446, 0x5831, 0x5949, 0x5B9D, 0x5CF0, 0x5CEF, 0x5D29, 0x5E96, 0x62B1, 0x6367, 0x653E, 0x65B9, 0x670B}, { /* category 43 */ 0x6CD5, 0x6CE1, 0x70F9, 0x7832, 0x7E2B, 0x80DE, 0x82B3, 0x840C, 0x84EC, 0x8702, 0x8912, 0x8A2A, 0x8C4A, 0x90A6, 0x92D2, 0x98FD, 0x9CF3, 0x9D6C, 0x4E4F, 0x4EA1, 0x508D, 0x5256, 0x574A, 0x59A8, 0x5E3D, 0x5FD8, 0x5FD9, 0x623F, 0x66B4, 0x671B, 0x67D0, 0x68D2, 0x5192, 0x7D21, 0x80AA, 0x81A8, 0x8B00, 0x8C8C, 0x8CBF, 0x927E, 0x9632, 0x5420, 0x982C, 0x5317, 0x50D5, 0x535C, 0x58A8, 0x64B2, 0x6734, 0x7267, 0x7766, 0x7A46, 0x91E6, 0x52C3, 0x6CA1, 0x6B86, 0x5800, 0x5E4C, 0x5954, 0x672C, 0x7FFB, 0x51E1, 0x76C6, 0x6469, 0x78E8, 0x9B54, 0x9EBB, 0x57CB, 0x59B9, 0x6627, 0x679A, 0x6BCE, 0x54E9, 0x69D9, 0x5E55, 0x819C, 0x6795, 0x9BAA, 0x67FE, 0x9C52, 0x685D, 0x4EA6, 0x4FE3, 0x53C8, 0x62B9, 0x672B, 0x6CAB, 0x8FC4, 0x4FAD, 0x7E6D, 0x9EBF, 0x4E07, 0x6162, 0x6E80}, { /* category 44 */ 0x6F2B, 0x8513, 0x5473, 0x672A, 0x9B45, 0x5DF3, 0x7B95, 0x5CAC, 0x5BC6, 0x871C, 0x6E4A, 0x84D1, 0x7A14, 0x8108, 0x5999, 0x7C8D, 0x6C11, 0x7720, 0x52D9, 0x5922, 0x7121, 0x725F, 0x77DB, 0x9727, 0x9D61, 0x690B, 0x5A7F, 0x5A18, 0x51A5, 0x540D, 0x547D, 0x660E, 0x76DF, 0x8FF7, 0x9298, 0x9CF4, 0x59EA, 0x725D, 0x6EC5, 0x514D, 0x68C9, 0x7DBF, 0x7DEC, 0x9762, 0x9EBA, 0x6478, 0x6A21, 0x8302, 0x5984, 0x5B5F, 0x6BDB, 0x731B, 0x76F2, 0x7DB2, 0x8017, 0x8499, 0x5132, 0x6728, 0x9ED9, 0x76EE, 0x6762, 0x52FF, 0x9905, 0x5C24, 0x623B, 0x7C7E, 0x8CB0, 0x554F, 0x60B6, 0x7D0B, 0x9580, 0x5301, 0x4E5F, 0x51B6, 0x591C, 0x723A, 0x8036, 0x91CE, 0x5F25, 0x77E2, 0x5384, 0x5F79, 0x7D04, 0x85AC, 0x8A33, 0x8E8D, 0x9756, 0x67F3, 0x85AE, 0x9453, 0x6109, 0x6108, 0x6CB9, 0x7652}, { /* category 45 */ 0x8AED, 0x8F38, 0x552F, 0x4F51, 0x512A, 0x52C7, 0x53CB, 0x5BA5, 0x5E7D, 0x60A0, 0x6182, 0x63D6, 0x6709, 0x67DA, 0x6E67, 0x6D8C, 0x7336, 0x7337, 0x7531, 0x7950, 0x88D5, 0x8A98, 0x904A, 0x9091, 0x90F5, 0x96C4, 0x878D, 0x5915, 0x4E88, 0x4F59, 0x4E0E, 0x8A89, 0x8F3F, 0x9810, 0x50AD, 0x5E7C, 0x5996, 0x5BB9, 0x5EB8, 0x63DA, 0x63FA, 0x64C1, 0x66DC, 0x694A, 0x69D8, 0x6D0B, 0x6EB6, 0x7194, 0x7528, 0x7AAF, 0x7F8A, 0x8000, 0x8449, 0x84C9, 0x8981, 0x8B21, 0x8E0A, 0x9065, 0x967D, 0x990A, 0x617E, 0x6291, 0x6B32, 0x6C83, 0x6D74, 0x7FCC, 0x7FFC, 0x6DC0, 0x7F85, 0x87BA, 0x88F8, 0x6765, 0x83B1, 0x983C, 0x96F7, 0x6D1B, 0x7D61, 0x843D, 0x916A, 0x4E71, 0x5375, 0x5D50, 0x6B04, 0x6FEB, 0x85CD, 0x862D, 0x89A7, 0x5229, 0x540F, 0x5C65, 0x674E, 0x68A8, 0x7406, 0x7483}, { /* category 46 */ 0x75E2, 0x88CF, 0x88E1, 0x91CC, 0x96E2, 0x9678, 0x5F8B, 0x7387, 0x7ACB, 0x844E, 0x63A0, 0x7565, 0x5289, 0x6D41, 0x6E9C, 0x7409, 0x7559, 0x786B, 0x7C92, 0x9686, 0x7ADC, 0x9F8D, 0x4FB6, 0x616E, 0x65C5, 0x865C, 0x4E86, 0x4EAE, 0x50DA, 0x4E21, 0x51CC, 0x5BEE, 0x6599, 0x6881, 0x6DBC, 0x731F, 0x7642, 0x77AD, 0x7A1C, 0x7CE7, 0x826F, 0x8AD2, 0x907C, 0x91CF, 0x9675, 0x9818, 0x529B, 0x7DD1, 0x502B, 0x5398, 0x6797, 0x6DCB, 0x71D0, 0x7433, 0x81E8, 0x8F2A, 0x96A3, 0x9C57, 0x9E9F, 0x7460, 0x5841, 0x6D99, 0x7D2F, 0x985E, 0x4EE4, 0x4F36, 0x4F8B, 0x51B7, 0x52B1, 0x5DBA, 0x601C, 0x73B2, 0x793C, 0x82D3, 0x9234, 0x96B7, 0x96F6, 0x970A, 0x9E97, 0x9F62, 0x66A6, 0x6B74, 0x5217, 0x52A3, 0x70C8, 0x88C2, 0x5EC9, 0x604B, 0x6190, 0x6F23, 0x7149, 0x7C3E, 0x7DF4, 0x806F}, { /* category 47 */ 0x84EE, 0x9023, 0x932C, 0x5442, 0x9B6F, 0x6AD3, 0x7089, 0x8CC2, 0x8DEF, 0x9732, 0x52B4, 0x5A41, 0x5ECA, 0x5F04, 0x6717, 0x697C, 0x6994, 0x6D6A, 0x6F0F, 0x7262, 0x72FC, 0x7BED, 0x8001, 0x807E, 0x874B, 0x90CE, 0x516D, 0x9E93, 0x7984, 0x808B, 0x9332, 0x8AD6, 0x502D, 0x548C, 0x8A71, 0x6B6A, 0x8CC4, 0x8107, 0x60D1, 0x67A0, 0x9DF2, 0x4E99, 0x4E98, 0x9C10, 0x8A6B, 0x85C1, 0x8568, 0x6900, 0x6E7E, 0x7897, 0x8155, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}, { /* category 48 */ 0x5F0C, 0x4E10, 0x4E15, 0x4E2A, 0x4E31, 0x4E36, 0x4E3C, 0x4E3F, 0x4E42, 0x4E56, 0x4E58, 0x4E82, 0x4E85, 0x8C6B, 0x4E8A, 0x8212, 0x5F0D, 0x4E8E, 0x4E9E, 0x4E9F, 0x4EA0, 0x4EA2, 0x4EB0, 0x4EB3, 0x4EB6, 0x4ECE, 0x4ECD, 0x4EC4, 0x4EC6, 0x4EC2, 0x4ED7, 0x4EDE, 0x4EED, 0x4EDF, 0x4EF7, 0x4F09, 0x4F5A, 0x4F30, 0x4F5B, 0x4F5D, 0x4F57, 0x4F47, 0x4F76, 0x4F88, 0x4F8F, 0x4F98, 0x4F7B, 0x4F69, 0x4F70, 0x4F91, 0x4F6F, 0x4F86, 0x4F96, 0x5118, 0x4FD4, 0x4FDF, 0x4FCE, 0x4FD8, 0x4FDB, 0x4FD1, 0x4FDA, 0x4FD0, 0x4FE4, 0x4FE5, 0x501A, 0x5028, 0x5014, 0x502A, 0x5025, 0x5005, 0x4F1C, 0x4FF6, 0x5021, 0x5029, 0x502C, 0x4FFE, 0x4FEF, 0x5011, 0x5006, 0x5043, 0x5047, 0x6703, 0x5055, 0x5050, 0x5048, 0x505A, 0x5056, 0x506C, 0x5078, 0x5080, 0x509A, 0x5085, 0x50B4, 0x50B2}, { /* category 49 */ 0x50C9, 0x50CA, 0x50B3, 0x50C2, 0x50D6, 0x50DE, 0x50E5, 0x50ED, 0x50E3, 0x50EE, 0x50F9, 0x50F5, 0x5109, 0x5101, 0x5102, 0x5116, 0x5115, 0x5114, 0x511A, 0x5121, 0x513A, 0x5137, 0x513C, 0x513B, 0x513F, 0x5140, 0x5152, 0x514C, 0x5154, 0x5162, 0x7AF8, 0x5169, 0x516A, 0x516E, 0x5180, 0x5182, 0x56D8, 0x518C, 0x5189, 0x518F, 0x5191, 0x5193, 0x5195, 0x5196, 0x51A4, 0x51A6, 0x51A2, 0x51A9, 0x51AA, 0x51AB, 0x51B3, 0x51B1, 0x51B2, 0x51B0, 0x51B5, 0x51BD, 0x51C5, 0x51C9, 0x51DB, 0x51E0, 0x8655, 0x51E9, 0x51ED, 0x51F0, 0x51F5, 0x51FE, 0x5204, 0x520B, 0x5214, 0x520E, 0x5227, 0x522A, 0x522E, 0x5233, 0x5239, 0x524F, 0x5244, 0x524B, 0x524C, 0x525E, 0x5254, 0x526A, 0x5274, 0x5269, 0x5273, 0x527F, 0x527D, 0x528D, 0x5294, 0x5292, 0x5271, 0x5288, 0x5291, 0x8FA8}, { /* category 50 */ 0x8FA7, 0x52AC, 0x52AD, 0x52BC, 0x52B5, 0x52C1, 0x52CD, 0x52D7, 0x52DE, 0x52E3, 0x52E6, 0x98ED, 0x52E0, 0x52F3, 0x52F5, 0x52F8, 0x52F9, 0x5306, 0x5308, 0x7538, 0x530D, 0x5310, 0x530F, 0x5315, 0x531A, 0x5323, 0x532F, 0x5331, 0x5333, 0x5338, 0x5340, 0x5346, 0x5345, 0x4E17, 0x5349, 0x534D, 0x51D6, 0x535E, 0x5369, 0x536E, 0x5918, 0x537B, 0x5377, 0x5382, 0x5396, 0x53A0, 0x53A6, 0x53A5, 0x53AE, 0x53B0, 0x53B6, 0x53C3, 0x7C12, 0x96D9, 0x53DF, 0x66FC, 0x71EE, 0x53EE, 0x53E8, 0x53ED, 0x53FA, 0x5401, 0x543D, 0x5440, 0x542C, 0x542D, 0x543C, 0x542E, 0x5436, 0x5429, 0x541D, 0x544E, 0x548F, 0x5475, 0x548E, 0x545F, 0x5471, 0x5477, 0x5470, 0x5492, 0x547B, 0x5480, 0x5476, 0x5484, 0x5490, 0x5486, 0x54C7, 0x54A2, 0x54B8, 0x54A5, 0x54AC, 0x54C4, 0x54C8, 0x54A8}, { /* category 51 */ 0x54AB, 0x54C2, 0x54A4, 0x54BE, 0x54BC, 0x54D8, 0x54E5, 0x54E6, 0x550F, 0x5514, 0x54FD, 0x54EE, 0x54ED, 0x54FA, 0x54E2, 0x5539, 0x5540, 0x5563, 0x554C, 0x552E, 0x555C, 0x5545, 0x5556, 0x5557, 0x5538, 0x5533, 0x555D, 0x5599, 0x5580, 0x54AF, 0x558A, 0x559F, 0x557B, 0x557E, 0x5598, 0x559E, 0x55AE, 0x557C, 0x5583, 0x55A9, 0x5587, 0x55A8, 0x55DA, 0x55C5, 0x55DF, 0x55C4, 0x55DC, 0x55E4, 0x55D4, 0x5614, 0x55F7, 0x5616, 0x55FE, 0x55FD, 0x561B, 0x55F9, 0x564E, 0x5650, 0x71DF, 0x5634, 0x5636, 0x5632, 0x5638, 0x566B, 0x5664, 0x562F, 0x566C, 0x566A, 0x5686, 0x5680, 0x568A, 0x56A0, 0x5694, 0x568F, 0x56A5, 0x56AE, 0x56B6, 0x56B4, 0x56C2, 0x56BC, 0x56C1, 0x56C3, 0x56C0, 0x56C8, 0x56CE, 0x56D1, 0x56D3, 0x56D7, 0x56EE, 0x56F9, 0x5700, 0x56FF, 0x5704, 0x5709}, { /* category 52 */ 0x5708, 0x570B, 0x570D, 0x5713, 0x5718, 0x5716, 0x55C7, 0x571C, 0x5726, 0x5737, 0x5738, 0x574E, 0x573B, 0x5740, 0x574F, 0x5769, 0x57C0, 0x5788, 0x5761, 0x577F, 0x5789, 0x5793, 0x57A0, 0x57B3, 0x57A4, 0x57AA, 0x57B0, 0x57C3, 0x57C6, 0x57D4, 0x57D2, 0x57D3, 0x580A, 0x57D6, 0x57E3, 0x580B, 0x5819, 0x581D, 0x5872, 0x5821, 0x5862, 0x584B, 0x5870, 0x6BC0, 0x5852, 0x583D, 0x5879, 0x5885, 0x58B9, 0x589F, 0x58AB, 0x58BA, 0x58DE, 0x58BB, 0x58B8, 0x58AE, 0x58C5, 0x58D3, 0x58D1, 0x58D7, 0x58D9, 0x58D8, 0x58E5, 0x58DC, 0x58E4, 0x58DF, 0x58EF, 0x58FA, 0x58F9, 0x58FB, 0x58FC, 0x58FD, 0x5902, 0x590A, 0x5910, 0x591B, 0x68A6, 0x5925, 0x592C, 0x592D, 0x5932, 0x5938, 0x593E, 0x7AD2, 0x5955, 0x5950, 0x594E, 0x595A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0x605F, 0x604A, 0x6046, 0x604D, 0x6063, 0x6043, 0x6064, 0x6042, 0x606C, 0x606B, 0x6059, 0x6081, 0x608D, 0x60E7, 0x6083, 0x609A}, { /* category 56 */ 0x6084, 0x609B, 0x6096, 0x6097, 0x6092, 0x60A7, 0x608B, 0x60E1, 0x60B8, 0x60E0, 0x60D3, 0x60B4, 0x5FF0, 0x60BD, 0x60C6, 0x60B5, 0x60D8, 0x614D, 0x6115, 0x6106, 0x60F6, 0x60F7, 0x6100, 0x60F4, 0x60FA, 0x6103, 0x6121, 0x60FB, 0x60F1, 0x610D, 0x610E, 0x6147, 0x613E, 0x6128, 0x6127, 0x614A, 0x613F, 0x613C, 0x612C, 0x6134, 0x613D, 0x6142, 0x6144, 0x6173, 0x6177, 0x6158, 0x6159, 0x615A, 0x616B, 0x6174, 0x616F, 0x6165, 0x6171, 0x615F, 0x615D, 0x6153, 0x6175, 0x6199, 0x6196, 0x6187, 0x61AC, 0x6194, 0x619A, 0x618A, 0x6191, 0x61AB, 0x61AE, 0x61CC, 0x61CA, 0x61C9, 0x61F7, 0x61C8, 0x61C3, 0x61C6, 0x61BA, 0x61CB, 0x7F79, 0x61CD, 0x61E6, 0x61E3, 0x61F6, 0x61FA, 0x61F4, 0x61FF, 0x61FD, 0x61FC, 0x61FE, 0x6200, 0x6208, 0x6209, 0x620D, 0x620C, 0x6214, 0x621B}, { /* category 57 */ 0x621E, 0x6221, 0x622A, 0x622E, 0x6230, 0x6232, 0x6233, 0x6241, 0x624E, 0x625E, 0x6263, 0x625B, 0x6260, 0x6268, 0x627C, 0x6282, 0x6289, 0x627E, 0x6292, 0x6293, 0x6296, 0x62D4, 0x6283, 0x6294, 0x62D7, 0x62D1, 0x62BB, 0x62CF, 0x62FF, 0x62C6, 0x64D4, 0x62C8, 0x62DC, 0x62CC, 0x62CA, 0x62C2, 0x62C7, 0x629B, 0x62C9, 0x630C, 0x62EE, 0x62F1, 0x6327, 0x6302, 0x6308, 0x62EF, 0x62F5, 0x6350, 0x633E, 0x634D, 0x641C, 0x634F, 0x6396, 0x638E, 0x6380, 0x63AB, 0x6376, 0x63A3, 0x638F, 0x6389, 0x639F, 0x63B5, 0x636B, 0x6369, 0x63BE, 0x63E9, 0x63C0, 0x63C6, 0x63E3, 0x63C9, 0x63D2, 0x63F6, 0x63C4, 0x6416, 0x6434, 0x6406, 0x6413, 0x6426, 0x6436, 0x651D, 0x6417, 0x6428, 0x640F, 0x6467, 0x646F, 0x6476, 0x644E, 0x652A, 0x6495, 0x6493, 0x64A5, 0x64A9, 0x6488, 0x64BC}, { /* category 58 */ 0x64DA, 0x64D2, 0x64C5, 0x64C7, 0x64BB, 0x64D8, 0x64C2, 0x64F1, 0x64E7, 0x8209, 0x64E0, 0x64E1, 0x62AC, 0x64E3, 0x64EF, 0x652C, 0x64F6, 0x64F4, 0x64F2, 0x64FA, 0x6500, 0x64FD, 0x6518, 0x651C, 0x6505, 0x6524, 0x6523, 0x652B, 0x6534, 0x6535, 0x6537, 0x6536, 0x6538, 0x754B, 0x6548, 0x6556, 0x6555, 0x654D, 0x6558, 0x655E, 0x655D, 0x6572, 0x6578, 0x6582, 0x6583, 0x8B8A, 0x659B, 0x659F, 0x65AB, 0x65B7, 0x65C3, 0x65C6, 0x65C1, 0x65C4, 0x65CC, 0x65D2, 0x65DB, 0x65D9, 0x65E0, 0x65E1, 0x65F1, 0x6772, 0x660A, 0x6603, 0x65FB, 0x6773, 0x6635, 0x6636, 0x6634, 0x661C, 0x664F, 0x6644, 0x6649, 0x6641, 0x665E, 0x665D, 0x6664, 0x6667, 0x6668, 0x665F, 0x6662, 0x6670, 0x6683, 0x6688, 0x668E, 0x6689, 0x6684, 0x6698, 0x669D, 0x66C1, 0x66B9, 0x66C9, 0x66BE, 0x66BC}, { /* category 59 */ 0x66C4, 0x66B8, 0x66D6, 0x66DA, 0x66E0, 0x663F, 0x66E6, 0x66E9, 0x66F0, 0x66F5, 0x66F7, 0x670F, 0x6716, 0x671E, 0x6726, 0x6727, 0x9738, 0x672E, 0x673F, 0x6736, 0x6741, 0x6738, 0x6737, 0x6746, 0x675E, 0x6760, 0x6759, 0x6763, 0x6764, 0x6789, 0x6770, 0x67A9, 0x677C, 0x676A, 0x678C, 0x678B, 0x67A6, 0x67A1, 0x6785, 0x67B7, 0x67EF, 0x67B4, 0x67EC, 0x67B3, 0x67E9, 0x67B8, 0x67E4, 0x67DE, 0x67DD, 0x67E2, 0x67EE, 0x67B9, 0x67CE, 0x67C6, 0x67E7, 0x6A9C, 0x681E, 0x6846, 0x6829, 0x6840, 0x684D, 0x6832, 0x684E, 0x68B3, 0x682B, 0x6859, 0x6863, 0x6877, 0x687F, 0x689F, 0x688F, 0x68AD, 0x6894, 0x689D, 0x689B, 0x6883, 0x6AAE, 0x68B9, 0x6874, 0x68B5, 0x68A0, 0x68BA, 0x690F, 0x688D, 0x687E, 0x6901, 0x68CA, 0x6908, 0x68D8, 0x6922, 0x6926, 0x68E1, 0x690C, 0x68CD}, { /* category 60 */ 0x68D4, 0x68E7, 0x68D5, 0x6936, 0x6912, 0x6904, 0x68D7, 0x68E3, 0x6925, 0x68F9, 0x68E0, 0x68EF, 0x6928, 0x692A, 0x691A, 0x6923, 0x6921, 0x68C6, 0x6979, 0x6977, 0x695C, 0x6978, 0x696B, 0x6954, 0x697E, 0x696E, 0x6939, 0x6974, 0x693D, 0x6959, 0x6930, 0x6961, 0x695E, 0x695D, 0x6981, 0x696A, 0x69B2, 0x69AE, 0x69D0, 0x69BF, 0x69C1, 0x69D3, 0x69BE, 0x69CE, 0x5BE8, 0x69CA, 0x69DD, 0x69BB, 0x69C3, 0x69A7, 0x6A2E, 0x6991, 0x69A0, 0x699C, 0x6995, 0x69B4, 0x69DE, 0x69E8, 0x6A02, 0x6A1B, 0x69FF, 0x6B0A, 0x69F9, 0x69F2, 0x69E7, 0x6A05, 0x69B1, 0x6A1E, 0x69ED, 0x6A14, 0x69EB, 0x6A0A, 0x6A12, 0x6AC1, 0x6A23, 0x6A13, 0x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 0x7109, 0x70FD, 0x711C, 0x7119, 0x7165, 0x7155, 0x7188, 0x7166, 0x7162, 0x714C, 0x7156, 0x716C, 0x718F, 0x71FB, 0x7184, 0x7195, 0x71A8, 0x71AC, 0x71D7, 0x71B9, 0x71BE, 0x71D2, 0x71C9, 0x71D4, 0x71CE, 0x71E0, 0x71EC, 0x71E7, 0x71F5, 0x71FC}, { /* category 64 */ 0x71F9, 0x71FF, 0x720D, 0x7210, 0x721B, 0x7228, 0x722D, 0x722C, 0x7230, 0x7232, 0x723B, 0x723C, 0x723F, 0x7240, 0x7246, 0x724B, 0x7258, 0x7274, 0x727E, 0x7282, 0x7281, 0x7287, 0x7292, 0x7296, 0x72A2, 0x72A7, 0x72B9, 0x72B2, 0x72C3, 0x72C6, 0x72C4, 0x72CE, 0x72D2, 0x72E2, 0x72E0, 0x72E1, 0x72F9, 0x72F7, 0x500F, 0x7317, 0x730A, 0x731C, 0x7316, 0x731D, 0x7334, 0x732F, 0x7329, 0x7325, 0x733E, 0x734E, 0x734F, 0x9ED8, 0x7357, 0x736A, 0x7368, 0x7370, 0x7378, 0x7375, 0x737B, 0x737A, 0x73C8, 0x73B3, 0x73CE, 0x73BB, 0x73C0, 0x73E5, 0x73EE, 0x73DE, 0x74A2, 0x7405, 0x746F, 0x7425, 0x73F8, 0x7432, 0x743A, 0x7455, 0x743F, 0x745F, 0x7459, 0x7441, 0x745C, 0x7469, 0x7470, 0x7463, 0x746A, 0x7476, 0x747E, 0x748B, 0x749E, 0x74A7, 0x74CA, 0x74CF, 0x74D4, 0x73F1}, { /* category 65 */ 0x74E0, 0x74E3, 0x74E7, 0x74E9, 0x74EE, 0x74F2, 0x74F0, 0x74F1, 0x74F8, 0x74F7, 0x7504, 0x7503, 0x7505, 0x750C, 0x750E, 0x750D, 0x7515, 0x7513, 0x751E, 0x7526, 0x752C, 0x753C, 0x7544, 0x754D, 0x754A, 0x7549, 0x755B, 0x7546, 0x755A, 0x7569, 0x7564, 0x7567, 0x756B, 0x756D, 0x7578, 0x7576, 0x7586, 0x7587, 0x7574, 0x758A, 0x7589, 0x7582, 0x7594, 0x759A, 0x759D, 0x75A5, 0x75A3, 0x75C2, 0x75B3, 0x75C3, 0x75B5, 0x75BD, 0x75B8, 0x75BC, 0x75B1, 0x75CD, 0x75CA, 0x75D2, 0x75D9, 0x75E3, 0x75DE, 0x75FE, 0x75FF, 0x75FC, 0x7601, 0x75F0, 0x75FA, 0x75F2, 0x75F3, 0x760B, 0x760D, 0x7609, 0x761F, 0x7627, 0x7620, 0x7621, 0x7622, 0x7624, 0x7634, 0x7630, 0x763B, 0x7647, 0x7648, 0x7646, 0x765C, 0x7658, 0x7661, 0x7662, 0x7668, 0x7669, 0x766A, 0x7667, 0x766C, 0x7670}, { /* category 66 */ 0x7672, 0x7676, 0x7678, 0x767C, 0x7680, 0x7683, 0x7688, 0x768B, 0x768E, 0x7696, 0x7693, 0x7699, 0x769A, 0x76B0, 0x76B4, 0x76B8, 0x76B9, 0x76BA, 0x76C2, 0x76CD, 0x76D6, 0x76D2, 0x76DE, 0x76E1, 0x76E5, 0x76E7, 0x76EA, 0x862F, 0x76FB, 0x7708, 0x7707, 0x7704, 0x7729, 0x7724, 0x771E, 0x7725, 0x7726, 0x771B, 0x7737, 0x7738, 0x7747, 0x775A, 0x7768, 0x776B, 0x775B, 0x7765, 0x777F, 0x777E, 0x7779, 0x778E, 0x778B, 0x7791, 0x77A0, 0x779E, 0x77B0, 0x77B6, 0x77B9, 0x77BF, 0x77BC, 0x77BD, 0x77BB, 0x77C7, 0x77CD, 0x77D7, 0x77DA, 0x77DC, 0x77E3, 0x77EE, 0x77FC, 0x780C, 0x7812, 0x7926, 0x7820, 0x792A, 0x7845, 0x788E, 0x7874, 0x7886, 0x787C, 0x789A, 0x788C, 0x78A3, 0x78B5, 0x78AA, 0x78AF, 0x78D1, 0x78C6, 0x78CB, 0x78D4, 0x78BE, 0x78BC, 0x78C5, 0x78CA, 0x78EC}, { /* category 67 */ 0x78E7, 0x78DA, 0x78FD, 0x78F4, 0x7907, 0x7912, 0x7911, 0x7919, 0x792C, 0x792B, 0x7940, 0x7960, 0x7957, 0x795F, 0x795A, 0x7955, 0x7953, 0x797A, 0x797F, 0x798A, 0x799D, 0x79A7, 0x9F4B, 0x79AA, 0x79AE, 0x79B3, 0x79B9, 0x79BA, 0x79C9, 0x79D5, 0x79E7, 0x79EC, 0x79E1, 0x79E3, 0x7A08, 0x7A0D, 0x7A18, 0x7A19, 0x7A20, 0x7A1F, 0x7980, 0x7A31, 0x7A3B, 0x7A3E, 0x7A37, 0x7A43, 0x7A57, 0x7A49, 0x7A61, 0x7A62, 0x7A69, 0x9F9D, 0x7A70, 0x7A79, 0x7A7D, 0x7A88, 0x7A97, 0x7A95, 0x7A98, 0x7A96, 0x7AA9, 0x7AC8, 0x7AB0, 0x7AB6, 0x7AC5, 0x7AC4, 0x7ABF, 0x9083, 0x7AC7, 0x7ACA, 0x7ACD, 0x7ACF, 0x7AD5, 0x7AD3, 0x7AD9, 0x7ADA, 0x7ADD, 0x7AE1, 0x7AE2, 0x7AE6, 0x7AED, 0x7AF0, 0x7B02, 0x7B0F, 0x7B0A, 0x7B06, 0x7B33, 0x7B18, 0x7B19, 0x7B1E, 0x7B35, 0x7B28, 0x7B36, 0x7B50}, { /* category 68 */ 0x7B7A, 0x7B04, 0x7B4D, 0x7B0B, 0x7B4C, 0x7B45, 0x7B75, 0x7B65, 0x7B74, 0x7B67, 0x7B70, 0x7B71, 0x7B6C, 0x7B6E, 0x7B9D, 0x7B98, 0x7B9F, 0x7B8D, 0x7B9C, 0x7B9A, 0x7B8B, 0x7B92, 0x7B8F, 0x7B5D, 0x7B99, 0x7BCB, 0x7BC1, 0x7BCC, 0x7BCF, 0x7BB4, 0x7BC6, 0x7BDD, 0x7BE9, 0x7C11, 0x7C14, 0x7BE6, 0x7BE5, 0x7C60, 0x7C00, 0x7C07, 0x7C13, 0x7BF3, 0x7BF7, 0x7C17, 0x7C0D, 0x7BF6, 0x7C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, 0x7E93, 0x7E94, 0x7E96, 0x7E8E, 0x7E9B, 0x7E9C, 0x7F38, 0x7F3A}, { /* category 70 */ 0x7F45, 0x7F4C, 0x7F4D, 0x7F4E, 0x7F50, 0x7F51, 0x7F55, 0x7F54, 0x7F58, 0x7F5F, 0x7F60, 0x7F68, 0x7F69, 0x7F67, 0x7F78, 0x7F82, 0x7F86, 0x7F83, 0x7F88, 0x7F87, 0x7F8C, 0x7F94, 0x7F9E, 0x7F9D, 0x7F9A, 0x7FA3, 0x7FAF, 0x7FB2, 0x7FB9, 0x7FAE, 0x7FB6, 0x7FB8, 0x8B71, 0x7FC5, 0x7FC6, 0x7FCA, 0x7FD5, 0x7FD4, 0x7FE1, 0x7FE6, 0x7FE9, 0x7FF3, 0x7FF9, 0x98DC, 0x8006, 0x8004, 0x800B, 0x8012, 0x8018, 0x8019, 0x801C, 0x8021, 0x8028, 0x803F, 0x803B, 0x804A, 0x8046, 0x8052, 0x8058, 0x805A, 0x805F, 0x8062, 0x8068, 0x8073, 0x8072, 0x8070, 0x8076, 0x8079, 0x807D, 0x807F, 0x8084, 0x8086, 0x8085, 0x809B, 0x8093, 0x809A, 0x80AD, 0x5190, 0x80AC, 0x80DB, 0x80E5, 0x80D9, 0x80DD, 0x80C4, 0x80DA, 0x80D6, 0x8109, 0x80EF, 0x80F1, 0x811B, 0x8129, 0x8123, 0x812F, 0x814B}, { /* category 71 */ 0x968B, 0x8146, 0x813E, 0x8153, 0x8151, 0x80FC, 0x8171, 0x816E, 0x8165, 0x8166, 0x8174, 0x8183, 0x8188, 0x818A, 0x8180, 0x8182, 0x81A0, 0x8195, 0x81A4, 0x81A3, 0x815F, 0x8193, 0x81A9, 0x81B0, 0x81B5, 0x81BE, 0x81B8, 0x81BD, 0x81C0, 0x81C2, 0x81BA, 0x81C9, 0x81CD, 0x81D1, 0x81D9, 0x81D8, 0x81C8, 0x81DA, 0x81DF, 0x81E0, 0x81E7, 0x81FA, 0x81FB, 0x81FE, 0x8201, 0x8202, 0x8205, 0x8207, 0x820A, 0x820D, 0x8210, 0x8216, 0x8229, 0x822B, 0x8238, 0x8233, 0x8240, 0x8259, 0x8258, 0x825D, 0x825A, 0x825F, 0x8264, 0x8262, 0x8268, 0x826A, 0x826B, 0x822E, 0x8271, 0x8277, 0x8278, 0x827E, 0x828D, 0x8292, 0x82AB, 0x829F, 0x82BB, 0x82AC, 0x82E1, 0x82E3, 0x82DF, 0x82D2, 0x82F4, 0x82F3, 0x82FA, 0x8393, 0x8303, 0x82FB, 0x82F9, 0x82DE, 0x8306, 0x82DC, 0x8309, 0x82D9}, { /* category 72 */ 0x8335, 0x8334, 0x8316, 0x8332, 0x8331, 0x8340, 0x8339, 0x8350, 0x8345, 0x832F, 0x832B, 0x8317, 0x8318, 0x8385, 0x839A, 0x83AA, 0x839F, 0x83A2, 0x8396, 0x8323, 0x838E, 0x8387, 0x838A, 0x837C, 0x83B5, 0x8373, 0x8375, 0x83A0, 0x8389, 0x83A8, 0x83F4, 0x8413, 0x83EB, 0x83CE, 0x83FD, 0x8403, 0x83D8, 0x840B, 0x83C1, 0x83F7, 0x8407, 0x83E0, 0x83F2, 0x840D, 0x8422, 0x8420, 0x83BD, 0x8438, 0x8506, 0x83FB, 0x846D, 0x842A, 0x843C, 0x855A, 0x8484, 0x8477, 0x846B, 0x84AD, 0x846E, 0x8482, 0x8469, 0x8446, 0x842C, 0x846F, 0x8479, 0x8435, 0x84CA, 0x8462, 0x84B9, 0x84BF, 0x849F, 0x84D9, 0x84CD, 0x84BB, 0x84DA, 0x84D0, 0x84C1, 0x84C6, 0x84D6, 0x84A1, 0x8521, 0x84FF, 0x84F4, 0x8517, 0x8518, 0x852C, 0x851F, 0x8515, 0x8514, 0x84FC, 0x8540, 0x8563, 0x8558, 0x8548}, { /* category 73 */ 0x8541, 0x8602, 0x854B, 0x8555, 0x8580, 0x85A4, 0x8588, 0x8591, 0x858A, 0x85A8, 0x856D, 0x8594, 0x859B, 0x85EA, 0x8587, 0x859C, 0x8577, 0x857E, 0x8590, 0x85C9, 0x85BA, 0x85CF, 0x85B9, 0x85D0, 0x85D5, 0x85DD, 0x85E5, 0x85DC, 0x85F9, 0x860A, 0x8613, 0x860B, 0x85FE, 0x85FA, 0x8606, 0x8622, 0x861A, 0x8630, 0x863F, 0x864D, 0x4E55, 0x8654, 0x865F, 0x8667, 0x8671, 0x8693, 0x86A3, 0x86A9, 0x86AA, 0x868B, 0x868C, 0x86B6, 0x86AF, 0x86C4, 0x86C6, 0x86B0, 0x86C9, 0x8823, 0x86AB, 0x86D4, 0x86DE, 0x86E9, 0x86EC, 0x86DF, 0x86DB, 0x86EF, 0x8712, 0x8706, 0x8708, 0x8700, 0x8703, 0x86FB, 0x8711, 0x8709, 0x870D, 0x86F9, 0x870A, 0x8734, 0x873F, 0x8737, 0x873B, 0x8725, 0x8729, 0x871A, 0x8760, 0x875F, 0x8778, 0x874C, 0x874E, 0x8774, 0x8757, 0x8768, 0x876E, 0x8759}, { /* category 74 */ 0x8753, 0x8763, 0x876A, 0x8805, 0x87A2, 0x879F, 0x8782, 0x87AF, 0x87CB, 0x87BD, 0x87C0, 0x87D0, 0x96D6, 0x87AB, 0x87C4, 0x87B3, 0x87C7, 0x87C6, 0x87BB, 0x87EF, 0x87F2, 0x87E0, 0x880F, 0x880D, 0x87FE, 0x87F6, 0x87F7, 0x880E, 0x87D2, 0x8811, 0x8816, 0x8815, 0x8822, 0x8821, 0x8831, 0x8836, 0x8839, 0x8827, 0x883B, 0x8844, 0x8842, 0x8852, 0x8859, 0x885E, 0x8862, 0x886B, 0x8881, 0x887E, 0x889E, 0x8875, 0x887D, 0x88B5, 0x8872, 0x8882, 0x8897, 0x8892, 0x88AE, 0x8899, 0x88A2, 0x888D, 0x88A4, 0x88B0, 0x88BF, 0x88B1, 0x88C3, 0x88C4, 0x88D4, 0x88D8, 0x88D9, 0x88DD, 0x88F9, 0x8902, 0x88FC, 0x88F4, 0x88E8, 0x88F2, 0x8904, 0x890C, 0x890A, 0x8913, 0x8943, 0x891E, 0x8925, 0x892A, 0x892B, 0x8941, 0x8944, 0x893B, 0x8936, 0x8938, 0x894C, 0x891D, 0x8960, 0x895E}, { /* category 75 */ 0x8966, 0x8964, 0x896D, 0x896A, 0x896F, 0x8974, 0x8977, 0x897E, 0x8983, 0x8988, 0x898A, 0x8993, 0x8998, 0x89A1, 0x89A9, 0x89A6, 0x89AC, 0x89AF, 0x89B2, 0x89BA, 0x89BD, 0x89BF, 0x89C0, 0x89DA, 0x89DC, 0x89DD, 0x89E7, 0x89F4, 0x89F8, 0x8A03, 0x8A16, 0x8A10, 0x8A0C, 0x8A1B, 0x8A1D, 0x8A25, 0x8A36, 0x8A41, 0x8A5B, 0x8A52, 0x8A46, 0x8A48, 0x8A7C, 0x8A6D, 0x8A6C, 0x8A62, 0x8A85, 0x8A82, 0x8A84, 0x8AA8, 0x8AA1, 0x8A91, 0x8AA5, 0x8AA6, 0x8A9A, 0x8AA3, 0x8AC4, 0x8ACD, 0x8AC2, 0x8ADA, 0x8AEB, 0x8AF3, 0x8AE7, 0x8AE4, 0x8AF1, 0x8B14, 0x8AE0, 0x8AE2, 0x8AF7, 0x8ADE, 0x8ADB, 0x8B0C, 0x8B07, 0x8B1A, 0x8AE1, 0x8B16, 0x8B10, 0x8B17, 0x8B20, 0x8B33, 0x97AB, 0x8B26, 0x8B2B, 0x8B3E, 0x8B28, 0x8B41, 0x8B4C, 0x8B4F, 0x8B4E, 0x8B49, 0x8B56, 0x8B5B, 0x8B5A, 0x8B6B}, { /* category 76 */ 0x8B5F, 0x8B6C, 0x8B6F, 0x8B74, 0x8B7D, 0x8B80, 0x8B8C, 0x8B8E, 0x8B92, 0x8B93, 0x8B96, 0x8B99, 0x8B9A, 0x8C3A, 0x8C41, 0x8C3F, 0x8C48, 0x8C4C, 0x8C4E, 0x8C50, 0x8C55, 0x8C62, 0x8C6C, 0x8C78, 0x8C7A, 0x8C82, 0x8C89, 0x8C85, 0x8C8A, 0x8C8D, 0x8C8E, 0x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8FB7, 0x8FDA, 0x8FE5, 0x8FE2, 0x8FEA, 0x8FEF, 0x9087, 0x8FF4, 0x9005, 0x8FF9, 0x8FFA, 0x9011, 0x9015, 0x9021, 0x900D, 0x901E, 0x9016, 0x900B, 0x9027, 0x9036, 0x9035, 0x9039, 0x8FF8}, { /* category 78 */ 0x904F, 0x9050, 0x9051, 0x9052, 0x900E, 0x9049, 0x903E, 0x9056, 0x9058, 0x905E, 0x9068, 0x906F, 0x9076, 0x96A8, 0x9072, 0x9082, 0x907D, 0x9081, 0x9080, 0x908A, 0x9089, 0x908F, 0x90A8, 0x90AF, 0x90B1, 0x90B5, 0x90E2, 0x90E4, 0x6248, 0x90DB, 0x9102, 0x9112, 0x9119, 0x9132, 0x9130, 0x914A, 0x9156, 0x9158, 0x9163, 0x9165, 0x9169, 0x9173, 0x9172, 0x918B, 0x9189, 0x9182, 0x91A2, 0x91AB, 0x91AF, 0x91AA, 0x91B5, 0x91B4, 0x91BA, 0x91C0, 0x91C1, 0x91C9, 0x91CB, 0x91D0, 0x91D6, 0x91DF, 0x91E1, 0x91DB, 0x91FC, 0x91F5, 0x91F6, 0x921E, 0x91FF, 0x9214, 0x922C, 0x9215, 0x9211, 0x925E, 0x9257, 0x9245, 0x9249, 0x9264, 0x9248, 0x9295, 0x923F, 0x924B, 0x9250, 0x929C, 0x9296, 0x9293, 0x929B, 0x925A, 0x92CF, 0x92B9, 0x92B7, 0x92E9, 0x930F, 0x92FA, 0x9344, 0x932E}, { /* category 79 */ 0x9319, 0x9322, 0x931A, 0x9323, 0x933A, 0x9335, 0x933B, 0x935C, 0x9360, 0x937C, 0x936E, 0x9356, 0x93B0, 0x93AC, 0x93AD, 0x9394, 0x93B9, 0x93D6, 0x93D7, 0x93E8, 0x93E5, 0x93D8, 0x93C3, 0x93DD, 0x93D0, 0x93C8, 0x93E4, 0x941A, 0x9414, 0x9413, 0x9403, 0x9407, 0x9410, 0x9436, 0x942B, 0x9435, 0x9421, 0x943A, 0x9441, 0x9452, 0x9444, 0x945B, 0x9460, 0x9462, 0x945E, 0x946A, 0x9229, 0x9470, 0x9475, 0x9477, 0x947D, 0x945A, 0x947C, 0x947E, 0x9481, 0x947F, 0x9582, 0x9587, 0x958A, 0x9594, 0x9596, 0x9598, 0x9599, 0x95A0, 0x95A8, 0x95A7, 0x95AD, 0x95BC, 0x95BB, 0x95B9, 0x95BE, 0x95CA, 0x6FF6, 0x95C3, 0x95CD, 0x95CC, 0x95D5, 0x95D4, 0x95D6, 0x95DC, 0x95E1, 0x95E5, 0x95E2, 0x9621, 0x9628, 0x962E, 0x962F, 0x9642, 0x964C, 0x964F, 0x964B, 0x9677, 0x965C, 0x965E}, { /* category 80 */ 0x965D, 0x965F, 0x9666, 0x9672, 0x966C, 0x968D, 0x9698, 0x9695, 0x9697, 0x96AA, 0x96A7, 0x96B1, 0x96B2, 0x96B0, 0x96B4, 0x96B6, 0x96B8, 0x96B9, 0x96CE, 0x96CB, 0x96C9, 0x96CD, 0x894D, 0x96DC, 0x970D, 0x96D5, 0x96F9, 0x9704, 0x9706, 0x9708, 0x9713, 0x970E, 0x9711, 0x970F, 0x9716, 0x9719, 0x9724, 0x972A, 0x9730, 0x9739, 0x973D, 0x973E, 0x9744, 0x9746, 0x9748, 0x9742, 0x9749, 0x975C, 0x9760, 0x9764, 0x9766, 0x9768, 0x52D2, 0x976B, 0x9771, 0x9779, 0x9785, 0x977C, 0x9781, 0x977A, 0x9786, 0x978B, 0x978F, 0x9790, 0x979C, 0x97A8, 0x97A6, 0x97A3, 0x97B3, 0x97B4, 0x97C3, 0x97C6, 0x97C8, 0x97CB, 0x97DC, 0x97ED, 0x9F4F, 0x97F2, 0x7ADF, 0x97F6, 0x97F5, 0x980F, 0x980C, 0x9838, 0x9824, 0x9821, 0x9837, 0x983D, 0x9846, 0x984F, 0x984B, 0x986B, 0x986F, 0x9870}, { /* category 81 */ 0x9871, 0x9874, 0x9873, 0x98AA, 0x98AF, 0x98B1, 0x98B6, 0x98C4, 0x98C3, 0x98C6, 0x98E9, 0x98EB, 0x9903, 0x9909, 0x9912, 0x9914, 0x9918, 0x9921, 0x991D, 0x991E, 0x9924, 0x9920, 0x992C, 0x992E, 0x993D, 0x993E, 0x9942, 0x9949, 0x9945, 0x9950, 0x994B, 0x9951, 0x9952, 0x994C, 0x9955, 0x9997, 0x9998, 0x99A5, 0x99AD, 0x99AE, 0x99BC, 0x99DF, 0x99DB, 0x99DD, 0x99D8, 0x99D1, 0x99ED, 0x99EE, 0x99F1, 0x99F2, 0x99FB, 0x99F8, 0x9A01, 0x9A0F, 0x9A05, 0x99E2, 0x9A19, 0x9A2B, 0x9A37, 0x9A45, 0x9A42, 0x9A40, 0x9A43, 0x9A3E, 0x9A55, 0x9A4D, 0x9A5B, 0x9A57, 0x9A5F, 0x9A62, 0x9A65, 0x9A64, 0x9A69, 0x9A6B, 0x9A6A, 0x9AAD, 0x9AB0, 0x9ABC, 0x9AC0, 0x9ACF, 0x9AD1, 0x9AD3, 0x9AD4, 0x9ADE, 0x9ADF, 0x9AE2, 0x9AE3, 0x9AE6, 0x9AEF, 0x9AEB, 0x9AEE, 0x9AF4, 0x9AF1, 0x9AF7}, { /* category 82 */ 0x9AFB, 0x9B06, 0x9B18, 0x9B1A, 0x9B1F, 0x9B22, 0x9B23, 0x9B25, 0x9B27, 0x9B28, 0x9B29, 0x9B2A, 0x9B2E, 0x9B2F, 0x9B32, 0x9B44, 0x9B43, 0x9B4F, 0x9B4D, 0x9B4E, 0x9B51, 0x9B58, 0x9B74, 0x9B93, 0x9B83, 0x9B91, 0x9B96, 0x9B97, 0x9B9F, 0x9BA0, 0x9BA8, 0x9BB4, 0x9BC0, 0x9BCA, 0x9BB9, 0x9BC6, 0x9BCF, 0x9BD1, 0x9BD2, 0x9BE3, 0x9BE2, 0x9BE4, 0x9BD4, 0x9BE1, 0x9C3A, 0x9BF2, 0x9BF1, 0x9BF0, 0x9C15, 0x9C14, 0x9C09, 0x9C13, 0x9C0C, 0x9C06, 0x9C08,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*/ 0x582F, 0x69C7, 0x9059, 0x7464, 0x51DC, 0x7199, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}, { /* category 85 */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}, { /* category 86 */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}, { /* category 87 */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}, { /* category 88 */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}, { /* category 89 */ 0x7E8A, 0x891C, 0x9348, 0x9288, 0x84DC, 0x4FC9, 0x70BB, 0x6631, 0x68C8, 0x92F9, 0x66FB, 0x5F45, 0x4E28, 0x4EE1, 0x4EFC, 0x4F00, 0x4F03, 0x4F39, 0x4F56, 0x4F92, 0x4F8A, 0x4F9A, 0x4F94, 0x4FCD, 0x5040, 0x5022, 0x4FFF, 0x501E, 0x5046, 0x5070, 0x5042, 0x5094, 0x50F4, 0x50D8, 0x514A, 0x5164, 0x519D, 0x51BE, 0x51EC, 0x5215, 0x529C, 0x52A6, 0x52C0, 0x52DB, 0x5300, 0x5307, 0x5324, 0x5372, 0x5393, 0x53B2, 0x53DD, 0xFA0E, 0x549C, 0x548A, 0x54A9, 0x54FF, 0x5586, 0x5759, 0x5765, 0x57AC, 0x57C8, 0x57C7, 0xFA0F, 0xFA10, 0x589E, 0x58B2, 0x590B, 0x5953, 0x595B, 0x595D, 0x5963, 0x59A4, 0x59BA, 0x5B56, 0x5BC0, 0x752F, 0x5BD8, 0x5BEC, 0x5C1E, 0x5CA6, 0x5CBA, 0x5CF5, 0x5D27, 0x5D53, 0xFA11, 0x5D42, 0x5D6D, 0x5DB8, 0x5DB9, 0x5DD0, 0x5F21, 0x5F34, 0x5F67, 0x5FB7}, { /* category 90 */ 0x5FDE, 0x605D, 0x6085, 0x608A, 0x60DE, 0x60D5, 0x6120, 0x60F2, 0x6111, 0x6137, 0x6130, 0x6198, 0x6213, 0x62A6, 0x63F5, 0x6460, 0x649D, 0x64CE, 0x654E, 0x6600, 0x6615, 0x663B, 0x6609, 0x662E, 0x661E, 0x6624, 0x6665, 0x6657, 0x6659, 0xFA12, 0x6673, 0x6699, 0x66A0, 0x66B2, 0x66BF, 0x66FA, 0x670E, 0xF929, 0x6766, 0x67BB, 0x6852, 0x67C0, 0x6801, 0x6844, 0x68CF, 0xFA13, 0x6968, 0xFA14, 0x6998, 0x69E2, 0x6A30, 0x6A6B, 0x6A46, 0x6A73, 0x6A7E, 0x6AE2, 0x6AE4, 0x6BD6, 0x6C3F, 0x6C5C, 0x6C86, 0x6C6F, 0x6CDA, 0x6D04, 0x6D87, 0x6D6F, 0x6D96, 0x6DAC, 0x6DCF, 0x6DF8, 0x6DF2, 0x6DFC, 0x6E39, 0x6E5C, 0x6E27, 0x6E3C, 0x6EBF, 0x6F88, 0x6FB5, 0x6FF5, 0x7005, 0x7007, 0x7028, 0x7085, 0x70AB, 0x710F, 0x7104, 0x715C, 0x7146, 0x7147, 0xFA15, 0x71C1, 0x71FE, 0x72B1}, { /* category 91 */ 0x72BE, 0x7324, 0xFA16, 0x7377, 0x73BD, 0x73C9, 0x73D6, 0x73E3, 0x73D2, 0x7407, 0x73F5, 0x7426, 0x742A, 0x7429, 0x742E, 0x7462, 0x7489, 0x749F, 0x7501, 0x756F, 0x7682, 0x769C, 0x769E, 0x769B, 0x76A6, 0xFA17, 0x7746, 0x52AF, 0x7821, 0x784E, 0x7864, 0x787A, 0x7930, 0xFA18, 0xFA19, 0xFA1A, 0x7994, 0xFA1B, 0x799B, 0x7AD1, 0x7AE7, 0xFA1C, 0x7AEB, 0x7B9E, 0xFA1D, 0x7D48, 0x7D5C, 0x7DB7, 0x7DA0, 0x7DD6, 0x7E52, 0x7F47, 0x7FA1, 0xFA1E, 0x8301, 0x8362, 0x837F, 0x83C7, 0x83F6, 0x8448, 0x84B4, 0x8553, 0x8559, 0x856B, 0xFA1F, 0x85B0, 0xFA20, 0xFA21, 0x8807, 0x88F5, 0x8A12, 0x8A37, 0x8A79, 0x8AA7, 0x8ABE, 0x8ADF, 0xFA22, 0x8AF6, 0x8B53, 0x8B7F, 0x8CF0, 0x8CF4, 0x8D12, 0x8D76, 0xFA23, 0x8ECF, 0xFA24, 0xFA25, 0x9067, 0x90DE, 0xFA26, 0x9115, 0x9127, 0x91DA}, { /* category 92 */ 0x91D7, 0x91DE, 0x91ED, 0x91EE, 0x91E4, 0x91E5, 0x9206, 0x9210, 0x920A, 0x923A, 0x9240, 0x923C, 0x924E, 0x9259, 0x9251, 0x9239, 0x9267, 0x92A7, 0x9277, 0x9278, 0x92E7, 0x92D7, 0x92D9, 0x92D0, 0xFA27, 0x92D5, 0x92E0, 0x92D3, 0x9325, 0x9321, 0x92FB, 0xFA28, 0x931E, 0x92FF, 0x931D, 0x9302, 0x9370, 0x9357, 0x93A4, 0x93C6, 0x93DE, 0x93F8, 0x9431, 0x9445, 0x9448, 0x9592, 0xF9DC, 0xFA29, 0x969D, 0x96AF, 0x9733, 0x973B, 0x9743, 0x974D, 0x974F, 0x9751, 0x9755, 0x9857, 0x9865, 0xFA2A, 0xFA2B, 0x9927, 0xFA2C, 0x999E, 0x9A4E, 0x9AD9, 0x9ADC, 0x9B75, 0x9B72, 0x9B8F, 0x9BB1, 0x9BBB, 0x9C00, 0x9D70, 0x9D6B, 0xFA2D, 0x9E19, 0x9ED1, 0x0000, 0x0000, 0x2170, 0x2171, 0x2172, 0x2173, 0x2174, 0x2175, 0x2176, 0x2177, 0x2178, 0x2179, 0xFFE2, 0xFFE4, 0xFF07, 0xFF02}}; #endif /* JISX0208_H */ php-4.4.8/ext/gd/libgd/wbmp.c0000644000175000017500000001541010574526535015203 0ustar derickderick /* WBMP ** ---- ** WBMP Level 0: B/W, Uncompressed ** This implements the WBMP format as specified in WAPSpec 1.1 and 1.2. ** It does not support ExtHeaders as defined in the spec. The spec states ** that a WAP client does not need to implement ExtHeaders. ** ** (c) 2000 Johan Van den Brande */ #include #include #include #include #include "wbmp.h" #include "gd.h" #include "gdhelpers.h" #ifdef NOTDEF #define __TEST /* Compile with main function */ #define __DEBUG /* Extra verbose when with __TEST */ #define __WRITE /* readwbmp and writewbmp(stdout) */ #define __VIEW /* view the wbmp on stdout */ #endif /* getmbi ** ------ ** Get a multibyte integer from a generic getin function ** 'getin' can be getc, with in = NULL ** you can find getin as a function just above the main function ** This way you gain a lot of flexibilty about how this package ** reads a wbmp file. */ int getmbi (int (*getin) (void *in), void *in) { int i, mbi = 0; do { i = getin (in); if (i < 0) return (-1); mbi = (mbi << 7) | (i & 0x7f); } while (i & 0x80); return (mbi); } /* putmbi ** ------ ** Put a multibyte intgerer in some kind of output stream ** I work here with a function pointer, to make it as generic ** as possible. Look at this function as an iterator on the ** mbi integers it spits out. ** */ void putmbi (int i, void (*putout) (int c, void *out), void *out) { int cnt, l, accu; /* Get number of septets */ cnt = 0; accu = 0; while (accu != i) accu += i & 0x7f << 7 * cnt++; /* Produce the multibyte output */ for (l = cnt - 1; l > 0; l--) putout (0x80 | (i & 0x7f << 7 * l) >> 7 * l, out); putout (i & 0x7f, out); } /* skipheader ** ---------- ** Skips the ExtHeader. Not needed for the moment ** */ int skipheader (int (*getin) (void *in), void *in) { int i; do { i = getin (in); if (i < 0) return (-1); } while (i & 0x80); return (0); } /* create wbmp ** ----------- ** create an empty wbmp ** */ Wbmp * createwbmp (int width, int height, int color) { int i; Wbmp *wbmp; if ((wbmp = (Wbmp *) gdMalloc (sizeof (Wbmp))) == NULL) return (NULL); if (overflow2(sizeof (int), width)) { gdFree(wbmp); return NULL; } if (overflow2(sizeof (int) * width, height)) { gdFree(wbmp); return NULL; } if ((wbmp->bitmap = (int *) safe_emalloc(sizeof(int), (width * height), 0)) == NULL) { gdFree (wbmp); return (NULL); } wbmp->width = width; wbmp->height = height; for (i = 0; i < width * height; wbmp->bitmap[i++] = color); return (wbmp); } /* readwbmp ** ------- ** Actually reads the WBMP format from an open file descriptor ** It goes along by returning a pointer to a WBMP struct. ** */ int readwbmp (int (*getin) (void *in), void *in, Wbmp ** return_wbmp) { int row, col, byte, pel, pos; Wbmp *wbmp; if ((wbmp = (Wbmp *) gdMalloc (sizeof (Wbmp))) == NULL) return (-1); wbmp->type = getin (in); if (wbmp->type != 0) { gdFree (wbmp); return (-1); } if (skipheader (getin, in)) return (-1); wbmp->width = getmbi (getin, in); if (wbmp->width == -1) { gdFree (wbmp); return (-1); } wbmp->height = getmbi (getin, in); if (wbmp->height == -1) { gdFree (wbmp); return (-1); } #ifdef __DEBUG printf ("W: %d, H: %d\n", wbmp->width, wbmp->height); #endif if (overflow2(sizeof (int), wbmp->width) || overflow2(sizeof (int) * wbmp->width, wbmp->height)) { gdFree(wbmp); return (-1); } if ((wbmp->bitmap = (int *) safe_emalloc(sizeof(int), (wbmp->width * wbmp->height), 0)) == NULL) { gdFree (wbmp); return (-1); } #ifdef __DEBUG printf ("DATA CONSTRUCTED\n"); #endif pos = 0; for (row = 0; row < wbmp->height; row++) { for (col = 0; col < wbmp->width;) { byte = getin (in); for (pel = 7; pel >= 0; pel--) { if (col++ < wbmp->width) { if (byte & 1 << pel) { wbmp->bitmap[pos] = WBMP_WHITE; } else { wbmp->bitmap[pos] = WBMP_BLACK; } pos++; } } } } *return_wbmp = wbmp; return (0); } /* writewbmp ** --------- ** Write a wbmp to a file descriptor ** ** Why not just giving a filedescriptor to this function? ** Well, the incentive to write this function was the complete ** integration in gd library from www.boutell.com. They use ** their own io functions, so the passing of a function seemed to be ** a logic(?) decision ... ** */ int writewbmp (Wbmp * wbmp, void (*putout) (int c, void *out), void *out) { int row, col; int bitpos, octet; /* Generate the header */ putout (0, out); /* WBMP Type 0: B/W, Uncompressed bitmap */ putout (0, out); /* FixHeaderField */ /* Size of the image */ putmbi (wbmp->width, putout, out); /* width */ putmbi (wbmp->height, putout, out); /* height */ /* Image data */ for (row = 0; row < wbmp->height; row++) { bitpos = 8; octet = 0; for (col = 0; col < wbmp->width; col++) { octet |= ((wbmp->bitmap[row * wbmp->width + col] == 1) ? WBMP_WHITE : WBMP_BLACK) << --bitpos; if (bitpos == 0) { bitpos = 8; putout (octet, out); octet = 0; } } if (bitpos != 8) putout (octet, out); } return (0); } /* freewbmp ** -------- ** gdFrees up memory occupied by a WBMP structure ** */ void freewbmp (Wbmp * wbmp) { gdFree (wbmp->bitmap); gdFree (wbmp); } /* printwbmp ** --------- ** print a WBMP to stdout for visualisation ** */ void printwbmp (Wbmp * wbmp) { int row, col; for (row = 0; row < wbmp->height; row++) { for (col = 0; col < wbmp->width; col++) { if (wbmp->bitmap[wbmp->width * row + col] == WBMP_BLACK) { putchar ('#'); } else { putchar (' '); } } putchar ('\n'); } } #ifdef __TEST /* putout to file descriptor ** ------------------------- */ int putout (int c, void *out) { return (putc (c, (FILE *) out)); } /* getin from file descriptor ** -------------------------- */ int getin (void *in) { return (getc ((FILE *) in)); } /* Main function ** ------------- ** */ int main (int argc, char *argv[]) { FILE *wbmp_file; Wbmp *wbmp; wbmp_file = fopen (argv[1], "rb"); if (wbmp_file) { readwbmp (&getin, wbmp_file, &wbmp); #ifdef __VIEW #ifdef __DEBUG printf ("\nVIEWING IMAGE\n"); #endif printwbmp (wbmp); #endif #ifdef __WRITE #ifdef __DEBUG printf ("\nDUMPING WBMP to STDOUT\n"); #endif writewbmp (wbmp, &putout, stdout); #endif freewbmp (wbmp); fclose (wbmp_file); } } #endif php-4.4.8/ext/gd/libgd/wbmp.h0000644000175000017500000000231007455710735015204 0ustar derickderick/* WBMP ** ---- ** WBMP Level 0: B/W, Uncompressed ** This implements the WBMP format as specified in WAPSpec 1.1 and 1.2. ** It does not support ExtHeaders as defined in the spec. The spec states ** that a WAP client does not need to implement ExtHeaders. ** ** (c) 2000 Johan Van den Brande ** ** Header file */ #ifndef __WBMP_H #define __WBMP_H 1 /* WBMP struct ** ----------- ** A Wireless bitmap structure ** */ typedef struct Wbmp_ { int type; /* type of the wbmp */ int width; /* width of the image */ int height; /* height of the image */ int *bitmap; /* pointer to data: 0 = WHITE , 1 = BLACK */ } Wbmp; #define WBMP_WHITE 1 #define WBMP_BLACK 0 /* Proto's ** ------- ** */ void putmbi( int i, void (*putout)(int c, void *out), void *out); int getmbi ( int (*getin)(void *in), void *in ); int skipheader( int (*getin)(void *in), void *in ); Wbmp *createwbmp( int width, int height, int color ); int readwbmp( int (*getin)(void *in), void *in, Wbmp **wbmp ); int writewbmp( Wbmp *wbmp, void (*putout)( int c, void *out), void *out); void freewbmp( Wbmp *wbmp ); void printwbmp( Wbmp *wbmp ); #endif php-4.4.8/ext/gd/libgd/gd2copypal.c0000644000175000017500000000251407525533503016276 0ustar derickderick #include #include "gd.h" #include /* A short program which converts a .png file into a .gd file, for your convenience in creating images on the fly from a basis image that must be loaded quickly. The .gd format is not intended to be a general-purpose format. */ int main (int argc, char **argv) { gdImagePtr im; gdImagePtr pal; FILE *in, *out; if (argc != 3) { fprintf (stderr, "Usage: gd2copypal palettefile.gd2 filename.gd2\n"); exit (1); } in = fopen (argv[1], "rb"); if (!in) { fprintf (stderr, "Palette file does not exist!\n"); exit (1); } pal = gdImageCreateFromGd2 (in); fclose (in); if (!pal) { fprintf (stderr, "Palette is not in GD2 format!\n"); exit (1); } in = fopen (argv[2], "rb"); if (!in) { fprintf (stderr, "Input file does not exist!\n"); exit (1); } im = gdImageCreateFromGd2 (in); fclose (in); if (!im) { fprintf (stderr, "Input is not in GD2 format!\n"); exit (1); } gdImagePaletteCopy (im, pal); out = fopen (argv[2], "wb"); if (!out) { fprintf (stderr, "Output file cannot be written to!\n"); gdImageDestroy (im); exit (1); } gdImageGd2 (im, out, 128, 2); fclose (out); gdImageDestroy (pal); gdImageDestroy (im); return 0; } php-4.4.8/ext/gd/libgd/gd_io_file.c0000644000175000017500000000464307772662637016336 0ustar derickderick /* * io_file.c * * Implements the file interface. * * As will all I/O modules, most functions are for local use only (called * via function pointers in the I/O context). * * Most functions are just 'wrappers' for standard file functions. * * Written/Modified 1999, Philip Warner. * */ /* For platforms with incomplete ANSI defines. Fortunately, SEEK_SET is defined to be zero by the standard. */ #ifndef SEEK_SET #define SEEK_SET 0 #endif /* SEEK_SET */ #include #include #include #include "gd.h" #include "gdhelpers.h" /* this is used for creating images in main memory */ typedef struct fileIOCtx { gdIOCtx ctx; FILE *f; } fileIOCtx; gdIOCtx *newFileCtx (FILE * f); static int fileGetbuf (gdIOCtx *, void *, int); static int filePutbuf (gdIOCtx *, const void *, int); static void filePutchar (gdIOCtx *, int); static int fileGetchar (gdIOCtx * ctx); static int fileSeek (struct gdIOCtx *, const int); static long fileTell (struct gdIOCtx *); static void gdFreeFileCtx (gdIOCtx * ctx); /* return data as a dynamic pointer */ gdIOCtx * gdNewFileCtx (FILE * f) { fileIOCtx *ctx; ctx = (fileIOCtx *) gdMalloc (sizeof (fileIOCtx)); if (ctx == NULL) { return NULL; } ctx->f = f; ctx->ctx.getC = fileGetchar; ctx->ctx.putC = filePutchar; ctx->ctx.getBuf = fileGetbuf; ctx->ctx.putBuf = filePutbuf; ctx->ctx.tell = fileTell; ctx->ctx.seek = fileSeek; ctx->ctx.gd_free = gdFreeFileCtx; return (gdIOCtx *) ctx; } static void gdFreeFileCtx (gdIOCtx * ctx) { gdFree (ctx); } static int filePutbuf (gdIOCtx * ctx, const void *buf, int size) { fileIOCtx *fctx; fctx = (fileIOCtx *) ctx; return fwrite (buf, 1, size, fctx->f); } static int fileGetbuf (gdIOCtx * ctx, void *buf, int size) { fileIOCtx *fctx; fctx = (fileIOCtx *) ctx; return (fread (buf, 1, size, fctx->f)); } static void filePutchar (gdIOCtx * ctx, int a) { unsigned char b; fileIOCtx *fctx; fctx = (fileIOCtx *) ctx; b = a; putc (b, fctx->f); } static int fileGetchar (gdIOCtx * ctx) { fileIOCtx *fctx; fctx = (fileIOCtx *) ctx; return getc (fctx->f); } static int fileSeek (struct gdIOCtx *ctx, const int pos) { fileIOCtx *fctx; fctx = (fileIOCtx *) ctx; return (fseek (fctx->f, pos, SEEK_SET) == 0); } static long fileTell (struct gdIOCtx *ctx) { fileIOCtx *fctx; fctx = (fileIOCtx *) ctx; return ftell (fctx->f); } php-4.4.8/ext/gd/libgd/gdfontmb.c0000644000175000017500000023633710032064414016031 0ustar derickderick /* This is a header file for gd font, generated using bdftogd version 0.5 by Jan Pazdziora, adelton@fi.muni.cz from bdf font -misc-fixed-bold-r-normal-sans-13-94-100-100-c-70-iso8859-2 at Thu Jan 8 13:54:57 1998. No copyright info was found in the original bdf. */ #include "gdfontmb.h" char gdFontMediumBoldData[] = { /* Char 0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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* Char 255 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; gdFont gdFontMediumBoldRep = { 256, 0, 7, 13, gdFontMediumBoldData }; gdFontPtr gdFontMediumBold = &gdFontMediumBoldRep; gdFontPtr gdFontGetMediumBold(void) { return gdFontMediumBold; } /* This file has not been truncated. */ php-4.4.8/ext/gd/libgd/gdfontmb.h0000644000175000017500000000075710032064414016031 0ustar derickderick #ifndef _GDFONTMB_H_ #define _GDFONTMB_H_ 1 #ifdef __cplusplus extern "C" { #endif /* This is a header file for gd font, generated using bdftogd version 0.5 by Jan Pazdziora, adelton@fi.muni.cz from bdf font -misc-fixed-bold-r-normal-sans-13-94-100-100-c-70-iso8859-2 at Thu Jan 8 13:54:57 1998. No copyright info was found in the original bdf. */ #include "gd.h" extern gdFontPtr gdFontMediumBold; extern gdFontPtr gdFontGetMediumBold(void); #ifdef __cplusplus } #endif #endif php-4.4.8/ext/gd/libgd/gd_jpeg.c0000644000175000017500000006101410032064414015614 0ustar derickderick/* * gd_jpeg.c: Read and write JPEG (JFIF) format image files using the * gd graphics library (http://www.boutell.com/gd/). * * This software is based in part on the work of the Independent JPEG * Group. For more information on the IJG JPEG software (and JPEG * documentation, etc.), see ftp://ftp.uu.net/graphics/jpeg/. * * NOTE: IJG 12-bit JSAMPLE (BITS_IN_JSAMPLE == 12) mode is not * supported at all on read in gd 2.0, and is not supported on write * except for palette images, which is sort of pointless (TBB). Even that * has never been tested according to DB. * * Copyright 2000 Doug Becker, mailto:thebeckers@home.com * * Modification 4/18/00 TBB: JPEG_DEBUG rather than just DEBUG, * so VC++ builds don't spew to standard output, causing * major CGI brain damage * * 2.0.10: more efficient gdImageCreateFromJpegCtx, thanks to * Christian Aberger */ #if PHP_WIN32 && !defined(ssize_t) typedef int ssize_t; #endif #include #include #include #include #include #include "gd.h" /* TBB: move this up so include files are not brought in */ /* JCE: arrange HAVE_LIBJPEG so that it can be set in gd.h */ #ifdef HAVE_LIBJPEG #include "gdhelpers.h" #undef HAVE_STDLIB_H /* 1.8.1: remove dependency on jinclude.h */ #include "jpeglib.h" #include "jerror.h" static const char *const GD_JPEG_VERSION = "1.0"; typedef struct _jmpbuf_wrapper { jmp_buf jmpbuf; } jmpbuf_wrapper; /* Called by the IJG JPEG library upon encountering a fatal error */ static void fatal_jpeg_error (j_common_ptr cinfo) { jmpbuf_wrapper *jmpbufw; php_gd_error("gd-jpeg: JPEG library reports unrecoverable error: "); (*cinfo->err->output_message) (cinfo); jmpbufw = (jmpbuf_wrapper *) cinfo->client_data; jpeg_destroy (cinfo); if (jmpbufw != 0) { longjmp (jmpbufw->jmpbuf, 1); php_gd_error_ex(E_ERROR, "gd-jpeg: EXTREMELY fatal error: longjmp returned control; terminating"); } else { php_gd_error_ex(E_ERROR, "gd-jpeg: EXTREMELY fatal error: jmpbuf unrecoverable; terminating"); } exit (99); } /* * Write IM to OUTFILE as a JFIF-formatted JPEG image, using quality * QUALITY. If QUALITY is in the range 0-100, increasing values * represent higher quality but also larger image size. If QUALITY is * negative, the IJG JPEG library's default quality is used (which * should be near optimal for many applications). See the IJG JPEG * library documentation for more details. */ void gdImageJpeg (gdImagePtr im, FILE * outFile, int quality) { gdIOCtx *out = gdNewFileCtx (outFile); gdImageJpegCtx (im, out, quality); out->gd_free (out); } void *gdImageJpegPtr (gdImagePtr im, int *size, int quality) { void *rv; gdIOCtx *out = gdNewDynamicCtx (2048, NULL); gdImageJpegCtx (im, out, quality); rv = gdDPExtractData (out, size); out->gd_free (out); return rv; } void jpeg_gdIOCtx_dest (j_compress_ptr cinfo, gdIOCtx * outfile); void gdImageJpegCtx (gdImagePtr im, gdIOCtx * outfile, int quality) { struct jpeg_compress_struct cinfo; struct jpeg_error_mgr jerr; int i, j, jidx; /* volatile so we can gdFree it on return from longjmp */ volatile JSAMPROW row = 0; JSAMPROW rowptr[1]; jmpbuf_wrapper jmpbufw; JDIMENSION nlines; char comment[255]; memset (&cinfo, 0, sizeof (cinfo)); memset (&jerr, 0, sizeof (jerr)); cinfo.err = jpeg_std_error (&jerr); cinfo.client_data = &jmpbufw; if (setjmp (jmpbufw.jmpbuf) != 0) { /* we're here courtesy of longjmp */ if (row) { gdFree (row); } return; } cinfo.err->error_exit = fatal_jpeg_error; jpeg_create_compress (&cinfo); cinfo.image_width = im->sx; cinfo.image_height = im->sy; cinfo.input_components = 3; /* # of color components per pixel */ cinfo.in_color_space = JCS_RGB; /* colorspace of input image */ jpeg_set_defaults (&cinfo); if (quality >= 0) { jpeg_set_quality (&cinfo, quality, TRUE); } /* If user requests interlace, translate that to progressive JPEG */ if (gdImageGetInterlaced (im)) { jpeg_simple_progression (&cinfo); } jpeg_gdIOCtx_dest (&cinfo, outfile); row = (JSAMPROW) safe_emalloc(cinfo.image_width * cinfo.input_components, sizeof(JSAMPLE), 0); memset(row, 0, cinfo.image_width * cinfo.input_components * sizeof(JSAMPLE)); rowptr[0] = row; jpeg_start_compress (&cinfo, TRUE); if (quality >= 0) { snprintf(comment, sizeof(comment)-1, "CREATOR: gd-jpeg v%s (using IJG JPEG v%d), quality = %d\n", GD_JPEG_VERSION, JPEG_LIB_VERSION, quality); } else { snprintf(comment, sizeof(comment)-1, "CREATOR: gd-jpeg v%s (using IJG JPEG v%d), default quality\n", GD_JPEG_VERSION, JPEG_LIB_VERSION); } jpeg_write_marker (&cinfo, JPEG_COM, (unsigned char *) comment, (unsigned int) strlen (comment)); if (im->trueColor) { #if BITS_IN_JSAMPLE == 12 php_gd_error("gd-jpeg: error: jpeg library was compiled for 12-bit precision. This is mostly useless, because JPEGs on the web are 8-bit and such versions of the jpeg library won't read or write them. GD doesn't support these unusual images. Edit your jmorecfg.h file to specify the correct precision and completely 'make clean' and 'make install' libjpeg again. Sorry"); goto error; #endif /* BITS_IN_JSAMPLE == 12 */ for (i = 0; i < im->sy; i++) { for (jidx = 0, j = 0; j < im->sx; j++) { int val = im->tpixels[i][j]; row[jidx++] = gdTrueColorGetRed (val); row[jidx++] = gdTrueColorGetGreen (val); row[jidx++] = gdTrueColorGetBlue (val); } nlines = jpeg_write_scanlines (&cinfo, rowptr, 1); if (nlines != 1) { php_gd_error_ex(E_WARNING, "gd_jpeg: warning: jpeg_write_scanlines returns %u -- expected 1\n", nlines); } } } else { for (i = 0; i < im->sy; i++) { for (jidx = 0, j = 0; j < im->sx; j++) { int idx = im->pixels[i][j]; /* NB: Although gd RGB values are ints, their max value is * 255 (see the documentation for gdImageColorAllocate()) * -- perfect for 8-bit JPEG encoding (which is the norm) */ #if BITS_IN_JSAMPLE == 8 row[jidx++] = im->red[idx]; row[jidx++] = im->green[idx]; row[jidx++] = im->blue[idx]; #elif BITS_IN_JSAMPLE == 12 row[jidx++] = im->red[idx] << 4; row[jidx++] = im->green[idx] << 4; row[jidx++] = im->blue[idx] << 4; #else #error IJG JPEG library BITS_IN_JSAMPLE value must be 8 or 12 #endif } nlines = jpeg_write_scanlines (&cinfo, rowptr, 1); if (nlines != 1) { php_gd_error_ex(E_WARNING, "gd_jpeg: warning: jpeg_write_scanlines returns %u -- expected 1\n", nlines); } } } jpeg_finish_compress (&cinfo); jpeg_destroy_compress (&cinfo); gdFree (row); } gdImagePtr gdImageCreateFromJpeg (FILE * inFile) { gdImagePtr im; gdIOCtx *in = gdNewFileCtx(inFile); im = gdImageCreateFromJpegCtx(in); in->gd_free (in); return im; } gdImagePtr gdImageCreateFromJpegPtr (int size, void *data) { gdImagePtr im; gdIOCtx *in = gdNewDynamicCtxEx(size, data, 0); im = gdImageCreateFromJpegCtx(in); in->gd_free(in); return im; } void jpeg_gdIOCtx_src (j_decompress_ptr cinfo, gdIOCtx * infile); static int CMYKToRGB(int c, int m, int y, int k, int inverted); /* * Create a gd-format image from the JPEG-format INFILE. Returns the * image, or NULL upon error. */ gdImagePtr gdImageCreateFromJpegCtx (gdIOCtx * infile) { struct jpeg_decompress_struct cinfo; struct jpeg_error_mgr jerr; jmpbuf_wrapper jmpbufw; /* volatile so we can gdFree them after longjmp */ volatile JSAMPROW row = 0; volatile gdImagePtr im = 0; JSAMPROW rowptr[1]; unsigned int i, j; int retval; JDIMENSION nrows; int channels = 3; int inverted = 0; memset (&cinfo, 0, sizeof (cinfo)); memset (&jerr, 0, sizeof (jerr)); cinfo.err = jpeg_std_error (&jerr); cinfo.client_data = &jmpbufw; if (setjmp (jmpbufw.jmpbuf) != 0) { /* we're here courtesy of longjmp */ if (row) { gdFree (row); } if (im) { gdImageDestroy (im); } return 0; } cinfo.err->error_exit = fatal_jpeg_error; jpeg_create_decompress (&cinfo); jpeg_gdIOCtx_src (&cinfo, infile); /* 2.0.22: save the APP14 marker to check for Adobe Photoshop CMYK files with inverted components. */ jpeg_save_markers(&cinfo, JPEG_APP0 + 14, 256); retval = jpeg_read_header (&cinfo, TRUE); if (retval != JPEG_HEADER_OK) { php_gd_error_ex(E_WARNING, "gd-jpeg: warning: jpeg_read_header returned %d, expected %d", retval, JPEG_HEADER_OK); } if (cinfo.image_height > INT_MAX) { php_gd_error_ex(E_WARNING, "gd-jpeg: warning: JPEG image height (%u) is greater than INT_MAX (%d) (and thus greater than gd can handle)", cinfo.image_height, INT_MAX); } if (cinfo.image_width > INT_MAX) { php_gd_error_ex(E_WARNING, "gd-jpeg: warning: JPEG image width (%u) is greater than INT_MAX (%d) (and thus greater than gd can handle)", cinfo.image_width, INT_MAX); } im = gdImageCreateTrueColor ((int) cinfo.image_width, (int) cinfo.image_height); if (im == 0) { php_gd_error("gd-jpeg error: cannot allocate gdImage struct"); goto error; } /* 2.0.22: very basic support for reading CMYK colorspace files. Nice for * thumbnails but there's no support for fussy adjustment of the * assumed properties of inks and paper. */ if ((cinfo.jpeg_color_space == JCS_CMYK) || (cinfo.jpeg_color_space == JCS_YCCK)) { cinfo.out_color_space = JCS_CMYK; } else { cinfo.out_color_space = JCS_RGB; } if (jpeg_start_decompress (&cinfo) != TRUE) { php_gd_error("gd-jpeg: warning: jpeg_start_decompress reports suspended data source"); } /* REMOVED by TBB 2/12/01. This field of the structure is * documented as private, and sure enough it's gone in the * latest libjpeg, replaced by something else. Unfortunately * there is still no right way to find out if the file was * progressive or not; just declare your intent before you * write one by calling gdImageInterlace(im, 1) yourself. * After all, we're not really supposed to rework JPEGs and * write them out again anyway. Lossy compression, remember? */ #if 0 gdImageInterlace (im, cinfo.progressive_mode != 0); #endif if (cinfo.out_color_space == JCS_RGB) { if (cinfo.output_components != 3) { php_gd_error_ex(E_WARNING, "gd-jpeg: error: JPEG color quantization request resulted in output_components == %d (expected 3 for RGB)", cinfo.output_components); goto error; } channels = 3; } else if (cinfo.out_color_space == JCS_CMYK) { jpeg_saved_marker_ptr marker; if (cinfo.output_components != 4) { php_gd_error_ex(E_WARNING, "gd-jpeg: error: JPEG color quantization request resulted in output_components == %d (expected 4 for CMYK)", cinfo.output_components); goto error; } channels = 4; marker = cinfo.marker_list; while (marker) { if ((marker->marker == (JPEG_APP0 + 14)) && (marker->data_length >= 12) && (!strncmp((const char *) marker->data, "Adobe", 5))) { inverted = 1; break; } marker = marker->next; } } else { php_gd_error_ex(E_WARNING, "gd-jpeg: error: unexpected colorspace."); goto error; } #if BITS_IN_JSAMPLE == 12 php_gd_error("gd-jpeg: error: jpeg library was compiled for 12-bit precision. This is mostly useless, because JPEGs on the web are 8-bit and such versions of the jpeg library won't read or write them. GD doesn't support these unusual images. Edit your jmorecfg.h file to specify the correct precision and completely 'make clean' and 'make install' libjpeg again. Sorry."); goto error; #endif /* BITS_IN_JSAMPLE == 12 */ row = safe_emalloc(cinfo.output_width * channels, sizeof(JSAMPLE), 0); memset(row, 0, cinfo.output_width * channels * sizeof(JSAMPLE)); rowptr[0] = row; if (cinfo.out_color_space == JCS_CMYK) { for (i = 0; i < cinfo.output_height; i++) { register JSAMPROW currow = row; register int *tpix = im->tpixels[i]; nrows = jpeg_read_scanlines (&cinfo, rowptr, 1); if (nrows != 1) { php_gd_error_ex(E_WARNING, "gd-jpeg: error: jpeg_read_scanlines returns %u, expected 1", nrows); goto error; } for (j = 0; j < cinfo.output_width; j++, currow += 4, tpix++) { *tpix = CMYKToRGB (currow[0], currow[1], currow[2], currow[3], inverted); } } } else { for (i = 0; i < cinfo.output_height; i++) { register JSAMPROW currow = row; register int *tpix = im->tpixels[i]; nrows = jpeg_read_scanlines (&cinfo, rowptr, 1); if (nrows != 1) { php_gd_error_ex(E_WARNING, "gd-jpeg: error: jpeg_read_scanlines returns %u, expected 1", nrows); goto error; } for (j = 0; j < cinfo.output_width; j++, currow += 3, tpix++) { *tpix = gdTrueColor (currow[0], currow[1], currow[2]); } } } if (jpeg_finish_decompress (&cinfo) != TRUE) { php_gd_error("gd-jpeg: warning: jpeg_finish_decompress reports suspended data source"); } /* Thanks to Truxton Fulton */ if (cinfo.err->num_warnings > 0) { goto error; } jpeg_destroy_decompress (&cinfo); gdFree (row); return im; error: jpeg_destroy_decompress (&cinfo); if (row) { gdFree (row); } if (im) { gdImageDestroy (im); } return 0; } /* A very basic conversion approach, TBB */ static int CMYKToRGB(int c, int m, int y, int k, int inverted) { if (inverted) { c = 255 - c; m = 255 - m; y = 255 - y; k = 255 - k; } return gdTrueColor((255 - c) * (255 - k) / 255, (255 - m) * (255 - k) / 255, (255 - y) * (255 - k) / 255); } /* * gdIOCtx JPEG data sources and sinks, T. Boutell * almost a simple global replace from T. Lane's stdio versions. * */ /* Different versions of libjpeg use either 'jboolean' or 'boolean', and some platforms define 'boolean', and so forth. Deal with this madness by typedeffing 'safeboolean' to 'boolean' if HAVE_BOOLEAN is already set, because this is the test that libjpeg uses. Otherwise, typedef it to int, because that's what libjpeg does if HAVE_BOOLEAN is not defined. -TBB */ #ifdef HAVE_BOOLEAN typedef boolean safeboolean; #else typedef int safeboolean; #endif /* HAVE_BOOLEAN */ /* Expanded data source object for gdIOCtx input */ typedef struct { struct jpeg_source_mgr pub; /* public fields */ gdIOCtx *infile; /* source stream */ unsigned char *buffer; /* start of buffer */ safeboolean start_of_file; /* have we gotten any data yet? */ } my_source_mgr; typedef my_source_mgr *my_src_ptr; #define INPUT_BUF_SIZE 4096 /* choose an efficiently fread'able size */ /* * Initialize source --- called by jpeg_read_header * before any data is actually read. */ void init_source (j_decompress_ptr cinfo) { my_src_ptr src = (my_src_ptr) cinfo->src; /* We reset the empty-input-file flag for each image, * but we don't clear the input buffer. * This is correct behavior for reading a series of images from one source. */ src->start_of_file = TRUE; } /* * Fill the input buffer --- called whenever buffer is emptied. * * In typical applications, this should read fresh data into the buffer * (ignoring the current state of next_input_byte & bytes_in_buffer), * reset the pointer & count to the start of the buffer, and return TRUE * indicating that the buffer has been reloaded. It is not necessary to * fill the buffer entirely, only to obtain at least one more byte. * * There is no such thing as an EOF return. If the end of the file has been * reached, the routine has a choice of ERREXIT() or inserting fake data into * the buffer. In most cases, generating a warning message and inserting a * fake EOI marker is the best course of action --- this will allow the * decompressor to output however much of the image is there. However, * the resulting error message is misleading if the real problem is an empty * input file, so we handle that case specially. * * In applications that need to be able to suspend compression due to input * not being available yet, a FALSE return indicates that no more data can be * obtained right now, but more may be forthcoming later. In this situation, * the decompressor will return to its caller (with an indication of the * number of scanlines it has read, if any). The application should resume * decompression after it has loaded more data into the input buffer. Note * that there are substantial restrictions on the use of suspension --- see * the documentation. * * When suspending, the decompressor will back up to a convenient restart point * (typically the start of the current MCU). next_input_byte & bytes_in_buffer * indicate where the restart point will be if the current call returns FALSE. * Data beyond this point must be rescanned after resumption, so move it to * the front of the buffer rather than discarding it. */ #define END_JPEG_SEQUENCE "\r\n[*]--:END JPEG:--[*]\r\n" safeboolean fill_input_buffer (j_decompress_ptr cinfo) { my_src_ptr src = (my_src_ptr) cinfo->src; /* 2.0.12: signed size. Thanks to Geert Jansen */ ssize_t nbytes = 0; /* ssize_t got; */ /* char *s; */ memset(src->buffer, 0, INPUT_BUF_SIZE); while (nbytes < INPUT_BUF_SIZE) { int got = gdGetBuf(src->buffer + nbytes, INPUT_BUF_SIZE - nbytes, src->infile); if (got == EOF || got == 0) { /* EOF or error. If we got any data, don't worry about it. If we didn't, then this is unexpected. */ if (!nbytes) { nbytes = -1; } break; } nbytes += got; } if (nbytes <= 0) { if (src->start_of_file) { /* Treat empty input file as fatal error */ ERREXIT (cinfo, JERR_INPUT_EMPTY); } WARNMS (cinfo, JWRN_JPEG_EOF); /* Insert a fake EOI marker */ src->buffer[0] = (unsigned char) 0xFF; src->buffer[1] = (unsigned char) JPEG_EOI; nbytes = 2; } src->pub.next_input_byte = src->buffer; src->pub.bytes_in_buffer = nbytes; src->start_of_file = FALSE; return TRUE; } /* * Skip data --- used to skip over a potentially large amount of * uninteresting data (such as an APPn marker). * * Writers of suspendable-input applications must note that skip_input_data * is not granted the right to give a suspension return. If the skip extends * beyond the data currently in the buffer, the buffer can be marked empty so * that the next read will cause a fill_input_buffer call that can suspend. * Arranging for additional bytes to be discarded before reloading the input * buffer is the application writer's problem. */ void skip_input_data (j_decompress_ptr cinfo, long num_bytes) { my_src_ptr src = (my_src_ptr) cinfo->src; /* Just a dumb implementation for now. Not clear that being smart is worth * any trouble anyway --- large skips are infrequent. */ if (num_bytes > 0) { while (num_bytes > (long) src->pub.bytes_in_buffer) { num_bytes -= (long) src->pub.bytes_in_buffer; (void) fill_input_buffer (cinfo); /* note we assume that fill_input_buffer will never return FALSE, * so suspension need not be handled. */ } src->pub.next_input_byte += (size_t) num_bytes; src->pub.bytes_in_buffer -= (size_t) num_bytes; } } /* * An additional method that can be provided by data source modules is the * resync_to_restart method for error recovery in the presence of RST markers. * For the moment, this source module just uses the default resync method * provided by the JPEG library. That method assumes that no backtracking * is possible. */ /* * Terminate source --- called by jpeg_finish_decompress * after all data has been read. Often a no-op. * * NB: *not* called by jpeg_abort or jpeg_destroy; surrounding * application must deal with any cleanup that should happen even * for error exit. */ void term_source (j_decompress_ptr cinfo) { #if 0 * never used */ my_src_ptr src = (my_src_ptr) cinfo->src; #endif } /* * Prepare for input from a gdIOCtx stream. * The caller must have already opened the stream, and is responsible * for closing it after finishing decompression. */ void jpeg_gdIOCtx_src (j_decompress_ptr cinfo, gdIOCtx * infile) { my_src_ptr src; /* The source object and input buffer are made permanent so that a series * of JPEG images can be read from the same file by calling jpeg_gdIOCtx_src * only before the first one. (If we discarded the buffer at the end of * one image, we'd likely lose the start of the next one.) * This makes it unsafe to use this manager and a different source * manager serially with the same JPEG object. Caveat programmer. */ if (cinfo->src == NULL) { /* first time for this JPEG object? */ cinfo->src = (struct jpeg_source_mgr *) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, sizeof (my_source_mgr)); src = (my_src_ptr) cinfo->src; src->buffer = (unsigned char *) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, INPUT_BUF_SIZE * sizeof (unsigned char)); } src = (my_src_ptr) cinfo->src; src->pub.init_source = init_source; src->pub.fill_input_buffer = fill_input_buffer; src->pub.skip_input_data = skip_input_data; src->pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */ src->pub.term_source = term_source; src->infile = infile; src->pub.bytes_in_buffer = 0; /* forces fill_input_buffer on first read */ src->pub.next_input_byte = NULL; /* until buffer loaded */ } /* Expanded data destination object for stdio output */ typedef struct { struct jpeg_destination_mgr pub; /* public fields */ gdIOCtx *outfile; /* target stream */ unsigned char *buffer; /* start of buffer */ } my_destination_mgr; typedef my_destination_mgr *my_dest_ptr; #define OUTPUT_BUF_SIZE 4096 /* choose an efficiently fwrite'able size */ /* * Initialize destination --- called by jpeg_start_compress * before any data is actually written. */ void init_destination (j_compress_ptr cinfo) { my_dest_ptr dest = (my_dest_ptr) cinfo->dest; /* Allocate the output buffer --- it will be released when done with image */ dest->buffer = (unsigned char *) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, OUTPUT_BUF_SIZE * sizeof (unsigned char)); dest->pub.next_output_byte = dest->buffer; dest->pub.free_in_buffer = OUTPUT_BUF_SIZE; } /* * Empty the output buffer --- called whenever buffer fills up. * * In typical applications, this should write the entire output buffer * (ignoring the current state of next_output_byte & free_in_buffer), * reset the pointer & count to the start of the buffer, and return TRUE * indicating that the buffer has been dumped. * * In applications that need to be able to suspend compression due to output * overrun, a FALSE return indicates that the buffer cannot be emptied now. * In this situation, the compressor will return to its caller (possibly with * an indication that it has not accepted all the supplied scanlines). The * application should resume compression after it has made more room in the * output buffer. Note that there are substantial restrictions on the use of * suspension --- see the documentation. * * When suspending, the compressor will back up to a convenient restart point * (typically the start of the current MCU). next_output_byte & free_in_buffer * indicate where the restart point will be if the current call returns FALSE. * Data beyond this point will be regenerated after resumption, so do not * write it out when emptying the buffer externally. */ safeboolean empty_output_buffer (j_compress_ptr cinfo) { my_dest_ptr dest = (my_dest_ptr) cinfo->dest; if (gdPutBuf (dest->buffer, OUTPUT_BUF_SIZE, dest->outfile) != (size_t) OUTPUT_BUF_SIZE) { ERREXIT (cinfo, JERR_FILE_WRITE); } dest->pub.next_output_byte = dest->buffer; dest->pub.free_in_buffer = OUTPUT_BUF_SIZE; return TRUE; } /* * Terminate destination --- called by jpeg_finish_compress * after all data has been written. Usually needs to flush buffer. * * NB: *not* called by jpeg_abort or jpeg_destroy; surrounding * application must deal with any cleanup that should happen even * for error exit. */ void term_destination (j_compress_ptr cinfo) { my_dest_ptr dest = (my_dest_ptr) cinfo->dest; size_t datacount = OUTPUT_BUF_SIZE - dest->pub.free_in_buffer; /* Write any data remaining in the buffer */ if (datacount > 0 && ((size_t)gdPutBuf (dest->buffer, datacount, dest->outfile) != datacount)) { ERREXIT (cinfo, JERR_FILE_WRITE); } } /* * Prepare for output to a stdio stream. * The caller must have already opened the stream, and is responsible * for closing it after finishing compression. */ void jpeg_gdIOCtx_dest (j_compress_ptr cinfo, gdIOCtx * outfile) { my_dest_ptr dest; /* The destination object is made permanent so that multiple JPEG images * can be written to the same file without re-executing jpeg_stdio_dest. * This makes it dangerous to use this manager and a different destination * manager serially with the same JPEG object, because their private object * sizes may be different. Caveat programmer. */ if (cinfo->dest == NULL) { /* first time for this JPEG object? */ cinfo->dest = (struct jpeg_destination_mgr *) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, sizeof (my_destination_mgr)); } dest = (my_dest_ptr) cinfo->dest; dest->pub.init_destination = init_destination; dest->pub.empty_output_buffer = empty_output_buffer; dest->pub.term_destination = term_destination; dest->outfile = outfile; } #endif /* HAVE_JPEG */ php-4.4.8/ext/gd/libgd/gd_gif_in.c0000644000175000017500000004042410632164626016140 0ustar derickderick#include #include #include #include #include "gd.h" #include "php.h" /* Used only when debugging GIF compression code */ /* #define DEBUGGING_ENVARS */ #ifdef DEBUGGING_ENVARS static int verbose_set = 0; static int verbose; #define VERBOSE (verbose_set?verbose:set_verbose()) static int set_verbose(void) { verbose = !!getenv("GIF_VERBOSE"); verbose_set = 1; return(verbose); } #else #define VERBOSE 0 #endif #define MAXCOLORMAPSIZE 256 #define TRUE 1 #define FALSE 0 #define CM_RED 0 #define CM_GREEN 1 #define CM_BLUE 2 #define MAX_LWZ_BITS 12 #define INTERLACE 0x40 #define LOCALCOLORMAP 0x80 #define BitSet(byte, bit) (((byte) & (bit)) == (bit)) #define ReadOK(file,buffer,len) (gdGetBuf(buffer, len, file) != 0) #define LM_to_uint(a,b) (((b)<<8)|(a)) /* We may eventually want to use this information, but def it out for now */ #if 0 static struct { unsigned int Width; unsigned int Height; unsigned char ColorMap[3][MAXCOLORMAPSIZE]; unsigned int BitPixel; unsigned int ColorResolution; unsigned int Background; unsigned int AspectRatio; } GifScreen; #endif static struct { int transparent; int delayTime; int inputFlag; int disposal; } Gif89 = { -1, -1, -1, 0 }; static int ReadColorMap (gdIOCtx *fd, int number, unsigned char (*buffer)[256]); static int DoExtension (gdIOCtx *fd, int label, int *Transparent); static int GetDataBlock (gdIOCtx *fd, unsigned char *buf); static int GetCode (gdIOCtx *fd, int code_size, int flag); static int LWZReadByte (gdIOCtx *fd, int flag, int input_code_size); static void ReadImage (gdImagePtr im, gdIOCtx *fd, int len, int height, unsigned char (*cmap)[256], int interlace); /*1.4//, int ignore); */ int ZeroDataBlock; gdImagePtr gdImageCreateFromGifSource(gdSourcePtr inSource) { gdIOCtx *in = gdNewSSCtx(inSource, NULL); gdImagePtr im; im = gdImageCreateFromGifCtx(in); in->gd_free(in); return im; } gdImagePtr gdImageCreateFromGif(FILE *fdFile) { gdIOCtx *fd = gdNewFileCtx(fdFile); gdImagePtr im = 0; im = gdImageCreateFromGifCtx(fd); fd->gd_free(fd); return im; } gdImagePtr gdImageCreateFromGifCtx(gdIOCtxPtr fd) { /* 1.4 int imageNumber; */ int BitPixel; int ColorResolution; int Background; int AspectRatio; int Transparent = (-1); unsigned char buf[16]; unsigned char c; unsigned char ColorMap[3][MAXCOLORMAPSIZE]; unsigned char localColorMap[3][MAXCOLORMAPSIZE]; int imw, imh; int useGlobalColormap; int bitPixel; int i; /*1.4//int imageCount = 0; */ char version[4]; gdImagePtr im = 0; ZeroDataBlock = FALSE; /*1.4//imageNumber = 1; */ if (! ReadOK(fd,buf,6)) { return 0; } if (strncmp((char *)buf,"GIF",3) != 0) { return 0; } strncpy(version, (char *)buf + 3, 3); version[3] = '\0'; if ((strcmp(version, "87a") != 0) && (strcmp(version, "89a") != 0)) { return 0; } if (! ReadOK(fd,buf,7)) { return 0; } BitPixel = 2<<(buf[4]&0x07); ColorResolution = (int) (((buf[4]&0x70)>>3)+1); Background = buf[5]; AspectRatio = buf[6]; imw = LM_to_uint(buf[0],buf[1]); imh = LM_to_uint(buf[2],buf[3]); if (BitSet(buf[4], LOCALCOLORMAP)) { /* Global Colormap */ if (ReadColorMap(fd, BitPixel, ColorMap)) { return 0; } } for (;;) { if (! ReadOK(fd,&c,1)) { return 0; } if (c == ';') { /* GIF terminator */ goto terminated; } if (c == '!') { /* Extension */ if (! ReadOK(fd,&c,1)) { return 0; } DoExtension(fd, c, &Transparent); continue; } if (c != ',') { /* Not a valid start character */ continue; } /*1.4//++imageCount; */ if (! ReadOK(fd,buf,9)) { return 0; } useGlobalColormap = ! BitSet(buf[8], LOCALCOLORMAP); bitPixel = 1<<((buf[8]&0x07)+1); if (!useGlobalColormap) { if (ReadColorMap(fd, bitPixel, localColorMap)) { return 0; } } if (!(im = gdImageCreate(imw, imh))) { return 0; } im->interlace = BitSet(buf[8], INTERLACE); if (! useGlobalColormap) { ReadImage(im, fd, imw, imh, localColorMap, BitSet(buf[8], INTERLACE)); /*1.4//imageCount != imageNumber); */ } else { ReadImage(im, fd, imw, imh, ColorMap, BitSet(buf[8], INTERLACE)); /*1.4//imageCount != imageNumber); */ } if (Transparent != (-1)) { gdImageColorTransparent(im, Transparent); } goto terminated; } terminated: /* Terminator before any image was declared! */ if (!im) { return 0; } if (!im->colorsTotal) { gdImageDestroy(im); return 0; } /* Check for open colors at the end, so we can reduce colorsTotal and ultimately BitsPerPixel */ for (i=((im->colorsTotal-1)); (i>=0); i--) { if (im->open[i]) { im->colorsTotal--; } else { break; } } return im; } static int ReadColorMap(gdIOCtx *fd, int number, unsigned char (*buffer)[256]) { int i; unsigned char rgb[3]; for (i = 0; i < number; ++i) { if (! ReadOK(fd, rgb, sizeof(rgb))) { return TRUE; } buffer[CM_RED][i] = rgb[0] ; buffer[CM_GREEN][i] = rgb[1] ; buffer[CM_BLUE][i] = rgb[2] ; } return FALSE; } static int DoExtension(gdIOCtx *fd, int label, int *Transparent) { static unsigned char buf[256]; switch (label) { case 0xf9: /* Graphic Control Extension */ (void) GetDataBlock(fd, (unsigned char*) buf); Gif89.disposal = (buf[0] >> 2) & 0x7; Gif89.inputFlag = (buf[0] >> 1) & 0x1; Gif89.delayTime = LM_to_uint(buf[1],buf[2]); if ((buf[0] & 0x1) != 0) *Transparent = buf[3]; while (GetDataBlock(fd, (unsigned char*) buf) > 0) ; return FALSE; default: break; } while (GetDataBlock(fd, (unsigned char*) buf) > 0) ; return FALSE; } static int GetDataBlock_(gdIOCtx *fd, unsigned char *buf) { unsigned char count; if (! ReadOK(fd,&count,1)) { return -1; } ZeroDataBlock = count == 0; if ((count != 0) && (! ReadOK(fd, buf, count))) { return -1; } return count; } static int GetDataBlock(gdIOCtx *fd, unsigned char *buf) { int rv; int i; char *tmp = NULL; rv = GetDataBlock_(fd,buf); if (VERBOSE) { if (rv > 0) { tmp = safe_emalloc(3 * rv, sizeof(char), 1); for (i=0;i= lastbit) { if (done) { if (curbit >= lastbit) { /* Oh well */ } return -1; } buf[0] = buf[last_byte-2]; buf[1] = buf[last_byte-1]; if ((count = GetDataBlock(fd, &buf[2])) <= 0) done = TRUE; last_byte = 2 + count; curbit = (curbit - lastbit) + 16; lastbit = (2+count)*8 ; } ret = 0; for (i = curbit, j = 0; j < code_size; ++i, ++j) ret |= ((buf[ i / 8 ] & (1 << (i % 8))) != 0) << j; curbit += code_size; return ret; } static int GetCode(gdIOCtx *fd, int code_size, int flag) { int rv; rv = GetCode_(fd,code_size,flag); if (VERBOSE) php_gd_error_ex(E_NOTICE, "[GetCode(,%d,%d) returning %d]\n",code_size,flag,rv); return(rv); } #define STACK_SIZE ((1<<(MAX_LWZ_BITS))*2) static int LWZReadByte_(gdIOCtx *fd, int flag, int input_code_size) { static int fresh = FALSE; int code, incode; static int code_size, set_code_size; static int max_code, max_code_size; static int firstcode, oldcode; static int clear_code, end_code; static int table[2][(1<< MAX_LWZ_BITS)]; static int stack[STACK_SIZE], *sp; register int i; if (flag) { set_code_size = input_code_size; code_size = set_code_size+1; clear_code = 1 << set_code_size ; end_code = clear_code + 1; max_code_size = 2*clear_code; max_code = clear_code+2; GetCode(fd, 0, TRUE); fresh = TRUE; for (i = 0; i < clear_code; ++i) { table[0][i] = 0; table[1][i] = i; } for (; i < (1< stack) return *--sp; while ((code = GetCode(fd, code_size, FALSE)) >= 0) { if (code == clear_code) { for (i = 0; i < clear_code; ++i) { table[0][i] = 0; table[1][i] = i; } for (; i < (1< 0) ; if (count != 0) return -2; } incode = code; if (sp == (stack + STACK_SIZE)) { /* Bad compressed data stream */ return -1; } if (code >= max_code) { *sp++ = firstcode; code = oldcode; } while (code >= clear_code) { if (sp == (stack + STACK_SIZE)) { /* Bad compressed data stream */ return -1; } *sp++ = table[1][code]; if (code == table[0][code]) { /* Oh well */ } code = table[0][code]; } *sp++ = firstcode = table[1][code]; if ((code = max_code) <(1<= max_code_size) && (max_code_size < (1< stack) return *--sp; } return code; } static int LWZReadByte(gdIOCtx *fd, int flag, int input_code_size) { int rv; rv = LWZReadByte_(fd,flag,input_code_size); if (VERBOSE) php_gd_error_ex(E_NOTICE, "[LWZReadByte(,%d,%d) returning %d]\n",flag,input_code_size,rv); return(rv); } static void ReadImage(gdImagePtr im, gdIOCtx *fd, int len, int height, unsigned char (*cmap)[256], int interlace) /*1.4//, int ignore) */ { unsigned char c; int v; int xpos = 0, ypos = 0, pass = 0; int i; /* ** Initialize the Compression routines */ if (! ReadOK(fd,&c,1)) { return; } if (c > MAX_LWZ_BITS) { return; } /* Stash the color map into the image */ for (i=0; (ired[i] = cmap[CM_RED][i]; im->green[i] = cmap[CM_GREEN][i]; im->blue[i] = cmap[CM_BLUE][i]; im->open[i] = 1; } /* Many (perhaps most) of these colors will remain marked open. */ im->colorsTotal = gdMaxColors; if (LWZReadByte(fd, TRUE, c) < 0) { return; } /* ** If this is an "uninteresting picture" ignore it. ** REMOVED For 1.4 */ /*if (ignore) { */ /* while (LWZReadByte(fd, FALSE, c) >= 0) */ /* ; */ /* return; */ /*} */ while ((v = LWZReadByte(fd,FALSE,c)) >= 0 ) { if (v >= gdMaxColors) { v = 0; } /* This how we recognize which colors are actually used. */ if (im->open[v]) { im->open[v] = 0; } gdImageSetPixel(im, xpos, ypos, v); ++xpos; if (xpos == len) { xpos = 0; if (interlace) { switch (pass) { case 0: case 1: ypos += 8; break; case 2: ypos += 4; break; case 3: ypos += 2; break; } if (ypos >= height) { ++pass; switch (pass) { case 1: ypos = 4; break; case 2: ypos = 2; break; case 3: ypos = 1; break; default: goto fini; } } } else { ++ypos; } } if (ypos >= height) break; } fini: if (LWZReadByte(fd,FALSE,c)>=0) { /* Ignore extra */ } } php-4.4.8/ext/gd/libgd/gdtestft.c0000644000175000017500000000541407631733257016066 0ustar derickderick #include "gd.h" #include #define PI 3.141592 #define DEG2RAD(x) ((x)*PI/180.) #define MAX(x,y) ((x) > (y) ? (x) : (y)) #define MIN(x,y) ((x) < (y) ? (x) : (y)) #define MAX4(x,y,z,w) \ ((MAX((x),(y))) > (MAX((z),(w))) ? (MAX((x),(y))) : (MAX((z),(w)))) #define MIN4(x,y,z,w) \ ((MIN((x),(y))) < (MIN((z),(w))) ? (MIN((x),(y))) : (MIN((z),(w)))) #define MAXX(x) MAX4(x[0],x[2],x[4],x[6]) #define MINX(x) MIN4(x[0],x[2],x[4],x[6]) #define MAXY(x) MAX4(x[1],x[3],x[5],x[7]) #define MINY(x) MIN4(x[1],x[3],x[5],x[7]) int main (int argc, char *argv[]) { #ifndef HAVE_LIBFREETYPE fprintf (stderr, "gd was not compiled with HAVE_LIBFREETYPE defined.\n"); fprintf (stderr, "Install the FreeType library, including the\n"); fprintf (stderr, "header files. Then edit the gd Makefile, type\n"); fprintf (stderr, "make clean, and type make again.\n"); return 1; #else gdImagePtr im; int black; int white; int brect[8]; int x, y; char *err; FILE *out; #ifdef JISX0208 char *s = "Hello. ‚±‚ñ‚É‚¿‚Í Qyjpqg,"; /* String to draw. */ #else char *s = "Hello. Qyjpqg,"; /* String to draw. */ #endif double sz = 40.; #if 0 double angle = 0.; #else double angle = DEG2RAD (-90); #endif #ifdef JISX0208 char *f = "/usr/openwin/lib/locale/ja/X11/fonts/TT/HG-MinchoL.ttf"; /* UNICODE */ /* char *f = "/usr/local/lib/fonts/truetype/DynaFont/dfpop1.ttf"; *//* SJIS */ #else char *f = "times"; /* TrueType font */ #endif /* obtain brect so that we can size the image */ err = gdImageStringFT ((gdImagePtr) NULL, &brect[0], 0, f, sz, angle, 0, 0, s); if (err) { fprintf (stderr, "%s", err); return 1; } /* create an image just big enough for the string */ x = MAXX (brect) - MINX (brect) + 6; y = MAXY (brect) - MINY (brect) + 6; #if 0 im = gdImageCreate (500, 500); #else /* gd 2.0: true color images can use freetype too */ im = gdImageCreateTrueColor (x, y); #endif /* Background color. gd 2.0: fill the image with it; truecolor images have a black background otherwise. */ white = gdImageColorResolve (im, 255, 255, 255); gdImageFilledRectangle (im, 0, 0, x, y, white); black = gdImageColorResolve (im, 0, 0, 0); /* render the string, offset origin to center string */ x = 0 - MINX (brect) + 3; y = 0 - MINY (brect) + 3; err = gdImageStringFT (im, NULL, black, f, sz, angle, x, y, s); if (err) { fprintf (stderr, "%s", err); return 1; } /* TBB: Write img to test/fttest.png */ out = fopen ("test/fttest.png", "wb"); if (!out) { fprintf (stderr, "Can't create test/fttest.png\n"); exit (1); } gdImagePng (im, out); fclose (out); fprintf (stderr, "Test image written to test/fttest.png\n"); /* Destroy it */ gdImageDestroy (im); return 0; #endif /* HAVE_FREETYPE */ } php-4.4.8/ext/gd/libgd/gdfontg.c0000644000175000017500000034235310032064414015655 0ustar derickderick /* This is a header file for gd font, generated using bdftogd version 0.51 by Jan Pazdziora, adelton@fi.muni.cz from bdf font -Misc-Fixed-Bold-R-Normal-Sans-15-140-75-75-C-90-ISO8859-2 at Mon Jan 26 14:45:58 1998. The original bdf was holding following copyright: "Libor Skarvada, libor@informatics.muni.cz" */ #include "gdfontg.h" char gdFontGiantData[] = { /* Char 0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; gdFont gdFontGiantRep = { 256, 0, 9, 15, gdFontGiantData }; gdFontPtr gdFontGiant = &gdFontGiantRep; gdFontPtr gdFontGetGiant(void) { return gdFontGiant; } /* This file has not been truncated. */ php-4.4.8/ext/gd/libgd/gdfontg.h0000644000175000017500000000102110032064414015642 0ustar derickderick #ifndef _GDFONTG_H_ #define _GDFONTG_H_ 1 #ifdef __cplusplus extern "C" { #endif /* This is a header file for gd font, generated using bdftogd version 0.51 by Jan Pazdziora, adelton@fi.muni.cz from bdf font -Misc-Fixed-Bold-R-Normal-Sans-15-140-75-75-C-90-ISO8859-2 at Mon Jan 26 14:45:58 1998. The original bdf was holding following copyright: "Libor Skarvada, libor@informatics.muni.cz" */ #include "gd.h" extern gdFontPtr gdFontGiant; extern gdFontPtr gdFontGetGiant(void); #ifdef __cplusplus } #endif #endif php-4.4.8/ext/gd/libgd/gdfontl.c0000644000175000017500000033075110032064414015661 0ustar derickderick /* This is a header file for gd font, generated using bdftogd version 0.5 by Jan Pazdziora, adelton@fi.muni.cz from bdf font -misc-fixed-medium-r-normal--16-140-75-75-c-80-iso8859-2 at Tue Jan 6 19:39:27 1998. The original bdf was holding following copyright: "Libor Skarvada, libor@informatics.muni.cz" */ #include "gdfontl.h" char gdFontLargeData[] = { /* Char 0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; gdFont gdFontLargeRep = { 256, 0, 8, 16, gdFontLargeData }; gdFontPtr gdFontLarge = &gdFontLargeRep; gdFontPtr gdFontGetLarge(void) { return gdFontLarge; } /* This file has not been truncated. */ php-4.4.8/ext/gd/libgd/gdfontl.h0000644000175000017500000000101710032064414015654 0ustar derickderick #ifndef _GDFONTL_H_ #define _GDFONTL_H_ 1 #ifdef __cplusplus extern "C" { #endif /* This is a header file for gd font, generated using bdftogd version 0.5 by Jan Pazdziora, adelton@fi.muni.cz from bdf font -misc-fixed-medium-r-normal--16-140-75-75-c-80-iso8859-2 at Tue Jan 6 19:39:27 1998. The original bdf was holding following copyright: "Libor Skarvada, libor@informatics.muni.cz" */ #include "gd.h" extern gdFontPtr gdFontLarge; extern gdFontPtr gdFontGetLarge(void); #ifdef __cplusplus } #endif #endif php-4.4.8/ext/gd/libgd/gdfonts.c0000644000175000017500000021270310032064414015664 0ustar derickderick /* This is a header file for gd font, generated using bdftogd version 0.5 by Jan Pazdziora, adelton@fi.muni.cz from bdf font -misc-fixed-medium-r-semicondensed-sans-12-116-75-75-c-60-iso8859-2 at Thu Jan 8 14:13:20 1998. No copyright info was found in the original bdf. */ #include "gdfonts.h" char gdFontSmallData[] = { /* Char 0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, /* Char 254 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, /* Char 255 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; gdFont gdFontSmallRep = { 256, 0, 6, 13, gdFontSmallData }; gdFontPtr gdFontSmall = &gdFontSmallRep; gdFontPtr gdFontGetSmall(void) { return gdFontSmall; } /* This file has not been truncated. */ php-4.4.8/ext/gd/libgd/gdfonts.h0000644000175000017500000000075310032064414015671 0ustar derickderick #ifndef _GDFONTS_H_ #define _GDFONTS_H_ 1 #ifdef __cplusplus extern "C" { #endif /* This is a header file for gd font, generated using bdftogd version 0.5 by Jan Pazdziora, adelton@fi.muni.cz from bdf font -misc-fixed-medium-r-semicondensed-sans-12-116-75-75-c-60-iso8859-2 at Thu Jan 8 14:13:20 1998. No copyright info was found in the original bdf. */ #include "gd.h" extern gdFontPtr gdFontSmall; extern gdFontPtr gdFontGetSmall(void); #ifdef __cplusplus } #endif #endif php-4.4.8/ext/gd/libgd/gdfontt.c0000644000175000017500000011473610032064414015674 0ustar derickderick /* This is a header file for gd font, generated using bdftogd version 0.5 by Jan Pazdziora, adelton@fi.muni.cz from bdf font -Misc-Fixed-Medium-R-Normal--8-80-75-75-C-50-ISO8859-2 at Thu Jan 8 13:49:54 1998. The original bdf was holding following copyright: "Libor Skarvada, libor@informatics.muni.cz" */ #include "gdfontt.h" char gdFontTinyData[] = { /* Char 0 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* Char 1 */ 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* Char 2 */ 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, /* Char 3 */ 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, /* Char 4 */ 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, /* Char 5 */ 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, /* Char 6 */ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1,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1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, /* Char 253 */ 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, /* Char 254 */ 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, /* Char 255 */ 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; gdFont gdFontTinyRep = { 256, 0, 5, 8, gdFontTinyData }; gdFontPtr gdFontTiny = &gdFontTinyRep; gdFontPtr gdFontGetTiny(void) { return gdFontTiny; } /* This file has not been truncated. */ php-4.4.8/ext/gd/libgd/gdfontt.h0000644000175000017500000000101210032064414015657 0ustar derickderick #ifndef _GDFONTT_H_ #define _GDFONTT_H_ 1 #ifdef __cplusplus extern "C" { #endif /* This is a header file for gd font, generated using bdftogd version 0.5 by Jan Pazdziora, adelton@fi.muni.cz from bdf font -Misc-Fixed-Medium-R-Normal--8-80-75-75-C-50-ISO8859-2 at Thu Jan 8 13:49:54 1998. The original bdf was holding following copyright: "Libor Skarvada, libor@informatics.muni.cz" */ #include "gd.h" extern gdFontPtr gdFontTiny; extern gdFontPtr gdFontGetTiny(void); #ifdef __cplusplus } #endif #endif php-4.4.8/ext/gd/libgd/webpng.c0000644000175000017500000001447507460541446015530 0ustar derickderick/* Bring in the gd library functions */ #include "gd.h" /* Bring in standard I/O and string manipulation functions */ #include #include /* for atoi() */ #include #ifdef _WIN32 #include int getpid () { return _getpid (); } #else #include /* for getpid(), unlink() */ #endif int main (int argc, char **argv) { FILE *in; FILE *out; char outFn[20]; int useStdinStdout = 0; /* Declare our image pointer */ gdImagePtr im = 0; int i; /* We'll clear 'no' once we know the user has made a reasonable request. */ int no = 1; /* We'll set 'write' once we know the user's request requires that the image be written back to disk. */ int write = 0; /* C programs always get at least one argument; we want at least one more (the image), more in practice. */ if (argc < 2 || !strcmp (argv[1], "--help")) { no = 1; goto usage; } /* The last argument should be the image. Open the file. */ if (strcmp ("-", argv[argc - 1]) == 0) { /* - is synonymous with STDIN */ useStdinStdout = 1; in = stdin; } else { in = fopen (argv[argc - 1], "rb"); } if (!in) { fprintf (stderr, "Error: can't open file %s.\n", argv[argc - 1]); exit (1); } /* Now load the image. */ im = gdImageCreateFromPng (in); fclose (in); /* If the load failed, it must not be a PNG file. */ if (!im) { fprintf (stderr, "Error: %s is not a valid PNG file.\n", argv[argc - 1]); exit (1); } /* Consider each argument in turn. */ for (i = 1; (i < (argc - 1)); i++) { /* -i turns on and off interlacing. */ if (!strcmp (argv[i], "--help")) { /* Every program should use this for help! :) */ no = 1; goto usage; } else if (!strcmp (argv[i], "-i")) { if (i == (argc - 2)) { fprintf (stderr, "Error: -i specified without y or n.\n"); no = 1; goto usage; } if (!strcmp (argv[i + 1], "y")) { /* Set interlace. */ gdImageInterlace (im, 1); } else if (!strcmp (argv[i + 1], "n")) { /* Clear interlace. */ gdImageInterlace (im, 0); } else { fprintf (stderr, "Error: -i specified without y or n.\n"); no = 1; goto usage; } i++; no = 0; write = 1; } else if (!strcmp (argv[i], "-t")) { /* Set transparent index (or none). */ int index; if (i == (argc - 2)) { fprintf (stderr, "Error: -t specified without a color table index.\n"); no = 1; goto usage; } if (!strcmp (argv[i + 1], "none")) { /* -1 means not transparent. */ gdImageColorTransparent (im, -1); } else { /* OK, get an integer and set the index. */ index = atoi (argv[i + 1]); gdImageColorTransparent (im, index); } i++; write = 1; no = 0; } else if (!strcmp (argv[i], "-l")) { /* List the colors in the color table. */ int j; if (!im->trueColor) { /* Tabs used below. */ printf ("Index Red Green Blue Alpha\n"); for (j = 0; (j < gdImageColorsTotal (im)); j++) { /* Use access macros to learn colors. */ printf ("%d %d %d %d %d\n", j, gdImageRed (im, j), gdImageGreen (im, j), gdImageBlue (im, j), gdImageAlpha (im, j)); } } else { printf ("Truecolor image, no palette entries to list.\n"); } no = 0; } else if (!strcmp (argv[i], "-d")) { /* Output dimensions, etc. */ int t; printf ("Width: %d Height: %d Colors: %d\n", gdImageSX (im), gdImageSY (im), gdImageColorsTotal (im)); t = gdImageGetTransparent (im); if (t != (-1)) { printf ("First 100%% transparent index: %d\n", t); } else { /* -1 means the image is not transparent. */ printf ("First 100%% transparent index: none\n"); } if (gdImageGetInterlaced (im)) { printf ("Interlaced: yes\n"); } else { printf ("Interlaced: no\n"); } no = 0; } else if (!strcmp(argv[i], "-a")) { int maxx, maxy, x, y, alpha, pix, nalpha = 0; maxx = gdImageSX(im); maxy = gdImageSY(im); printf("alpha channel information:\n"); if (im->trueColor) { for (y = 0; y < maxy; y++) { for (x = 0; x < maxx; x++) { pix = gdImageGetPixel(im, x, y); alpha = gdTrueColorGetAlpha(pix); if (alpha > gdAlphaOpaque) { /* Use access macros to learn colors. */ printf ("%d %d %d %d\n", gdTrueColorGetRed(pix), gdTrueColorGetGreen(pix), gdTrueColorGetBlue(pix), alpha); nalpha++; } } } } else printf("NOT a true color image\n"); no = 0; printf("%d alpha channels\n", nalpha); } else { fprintf (stderr, "Unknown argument: %s\n", argv[i]); break; } } usage: if (no) { /* If the command failed, output an explanation. */ fprintf (stderr, "Usage: webpng [-i y|n ] [-l] [-t index|none ] [-d] pngname.png\n" " -i [y|n] Turns on/off interlace\n" " -l Prints the table of color indexes\n" " -t [index] Set the transparent color to the specified index (0-255 or \"none\")\n" " -d Reports the dimensions and other characteristics of the image.\n" " -a Prints all alpha channels that are not 100%% opaque.\n" "\n" "If you specify '-' as the input file, stdin/stdout will be used input/output.\n" ); } if (write) { if (useStdinStdout) { out = stdout; } else { /* Open a temporary file. */ /* "temp.tmp" is not good temporary filename. */ sprintf (outFn, "webpng.tmp%d", getpid ()); out = fopen (outFn, "wb"); if (!out) { fprintf (stderr, "Unable to write to %s -- exiting\n", outFn); exit (1); } } /* Write the new PNG. */ gdImagePng (im, out); if (!useStdinStdout) { fclose (out); /* Erase the old PNG. */ unlink (argv[argc - 1]); /* Rename the new to the old. */ if (rename (outFn, argv[argc - 1]) != 0) { perror ("rename"); exit (1); } } } /* Delete the image from memory. */ if (im) { gdImageDestroy (im); } /* All's well that ends well. */ return 0; } php-4.4.8/ext/gd/libgd/gdtopng.c0000644000175000017500000000170607455710735015704 0ustar derickderick#include #include "gd.h" /* A short program which converts a .png file into a .gd file, for your convenience in creating images on the fly from a basis image that must be loaded quickly. The .gd format is not intended to be a general-purpose format. */ int main (int argc, char **argv) { gdImagePtr im; FILE *in, *out; if (argc != 3) { fprintf (stderr, "Usage: gdtopng filename.gd filename.png\n"); exit (1); } in = fopen (argv[1], "rb"); if (!in) { fprintf (stderr, "Input file does not exist!\n"); exit (1); } im = gdImageCreateFromGd (in); fclose (in); if (!im) { fprintf (stderr, "Input is not in PNG format!\n"); exit (1); } out = fopen (argv[2], "wb"); if (!out) { fprintf (stderr, "Output file cannot be written to!\n"); gdImageDestroy (im); exit (1); } gdImagePng (im, out); fclose (out); gdImageDestroy (im); return 0; } php-4.4.8/ext/gd/libgd/gd_security.c0000644000175000017500000000125510574526535016561 0ustar derickderick/* * gd_security.c * * Implements buffer overflow check routines. * * Written 2004, Phil Knirsch. * Based on netpbm fixes by Alan Cox. * */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include "gd.h" int overflow2(int a, int b) { if(a < 0 || b < 0) { php_gd_error("gd warning: one parameter to a memory allocation multiplication is negative, failing operation gracefully\n"); return 1; } if(b == 0) return 0; if(a > INT_MAX / b) { php_gd_error("gd warning: product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully\n"); return 1; } return 0; } php-4.4.8/ext/gd/libgd/gd_wbmp.c0000644000175000017500000001247410032064414015642 0ustar derickderick /* WBMP: Wireless Bitmap Type 0: B/W, Uncompressed Bitmap Specification of the WBMP format can be found in the file: SPEC-WAESpec-19990524.pdf You can download the WAP specification on: http://www.wapforum.com/ gd_wbmp.c Copyright (C) Johan Van den Brande (johan@vandenbrande.com) Fixed: gdImageWBMPPtr, gdImageWBMP Recoded: gdImageWBMPCtx for use with my wbmp library (wbmp library included, but you can find the latest distribution at http://www.vandenbrande.com/wbmp) Implemented: gdImageCreateFromWBMPCtx, gdImageCreateFromWBMP --------------------------------------------------------------------------- Parts of this code are from Maurice Smurlo. ** Copyright (C) Maurice Szmurlo --- T-SIT --- January 2000 ** (Maurice.Szmurlo@info.unicaen.fr) ** 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 appear in all copies and that both that ** copyright notice and this permission notice appear in supporting ** documentation. This software is provided "as is" without express or ** implied warranty. --------------------------------------------------------------------------- Parts od this code are inspired by 'pbmtowbmp.c' and 'wbmptopbm.c' by Terje Sannum . ** ** 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 appear in all copies and that both that ** copyright notice and this permission notice appear in supporting ** documentation. This software is provided "as is" without express or ** implied warranty. ** --------------------------------------------------------------------------- Todo: gdCreateFromWBMP function for reading WBMP files ---------------------------------------------------------------------------- */ #include #include #include #include #include #include "wbmp.h" /* gd_putout ** --------- ** Wrapper around gdPutC for use with writewbmp ** */ void gd_putout (int i, void *out) { gdPutC (i, (gdIOCtx *) out); } /* gd_getin ** -------- ** Wrapper around gdGetC for use with readwbmp ** */ int gd_getin (void *in) { return (gdGetC ((gdIOCtx *) in)); } /* gdImageWBMPCtx ** -------------- ** Write the image as a wbmp file ** Parameters are: ** image: gd image structure; ** fg: the index of the foreground color. any other value will be ** considered as background and will not be written ** out: the stream where to write */ void gdImageWBMPCtx (gdImagePtr image, int fg, gdIOCtx * out) { int x, y, pos; Wbmp *wbmp; /* create the WBMP */ if ((wbmp = createwbmp (gdImageSX (image), gdImageSY (image), WBMP_WHITE)) == NULL) php_gd_error("Could not create WBMP\n"); /* fill up the WBMP structure */ pos = 0; for (y = 0; y < gdImageSY (image); y++) { for (x = 0; x < gdImageSX (image); x++) { if (gdImageGetPixel (image, x, y) == fg) { wbmp->bitmap[pos] = WBMP_BLACK; } pos++; } } /* write the WBMP to a gd file descriptor */ if (writewbmp (wbmp, &gd_putout, out)) php_gd_error("Could not save WBMP\n"); /* des submitted this bugfix: gdFree the memory. */ freewbmp (wbmp); } /* gdImageCreateFromWBMPCtx ** ------------------------ ** Create a gdImage from a WBMP file input from an gdIOCtx */ gdImagePtr gdImageCreateFromWBMPCtx (gdIOCtx * infile) { /* FILE *wbmp_file; */ Wbmp *wbmp; gdImagePtr im = NULL; int black, white; int col, row, pos; if (readwbmp (&gd_getin, infile, &wbmp)) return (NULL); if (!(im = gdImageCreate (wbmp->width, wbmp->height))) { freewbmp (wbmp); return (NULL); } /* create the background color */ white = gdImageColorAllocate (im, 255, 255, 255); /* create foreground color */ black = gdImageColorAllocate (im, 0, 0, 0); /* fill in image (in a wbmp 1 = white/ 0 = black) */ pos = 0; for (row = 0; row < wbmp->height; row++) { for (col = 0; col < wbmp->width; col++) { if (wbmp->bitmap[pos++] == WBMP_WHITE) { gdImageSetPixel (im, col, row, white); } else { gdImageSetPixel (im, col, row, black); } } } freewbmp (wbmp); return (im); } /* gdImageCreateFromWBMP ** --------------------- */ gdImagePtr gdImageCreateFromWBMP (FILE * inFile) { gdImagePtr im; gdIOCtx *in = gdNewFileCtx (inFile); im = gdImageCreateFromWBMPCtx (in); in->gd_free (in); return (im); } gdImagePtr gdImageCreateFromWBMPPtr (int size, void *data) { gdImagePtr im; gdIOCtx *in = gdNewDynamicCtxEx(size, data, 0); im = gdImageCreateFromWBMPCtx(in); in->gd_free(in); return im; } /* gdImageWBMP ** ----------- */ void gdImageWBMP (gdImagePtr im, int fg, FILE * outFile) { gdIOCtx *out = gdNewFileCtx (outFile); gdImageWBMPCtx (im, fg, out); out->gd_free (out); } /* gdImageWBMPPtr ** -------------- */ void * gdImageWBMPPtr (gdImagePtr im, int *size, int fg) { void *rv; gdIOCtx *out = gdNewDynamicCtx (2048, NULL); gdImageWBMPCtx (im, fg, out); rv = gdDPExtractData (out, size); out->gd_free (out); return rv; } php-4.4.8/ext/gd/libgd/gd_gif_out.c0000644000175000017500000005027610100044444016330 0ustar derickderick#include #include #include #include #include "gd.h" /* Code drawn from ppmtogif.c, from the pbmplus package ** ** Based on GIFENCOD by David Rowley . A ** Lempel-Zim compression based on "compress". ** ** Modified by Marcel Wijkstra ** ** Copyright (C) 1989 by Jef Poskanzer. ** ** 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 appear in all copies and that both that ** copyright notice and this permission notice appear in supporting ** documentation. This software is provided "as is" without express or ** implied warranty. ** ** The Graphics Interchange Format(c) is the Copyright property of ** CompuServe Incorporated. GIF(sm) is a Service Mark property of ** CompuServe Incorporated. */ /* * a code_int must be able to hold 2**GIFBITS values of type int, and also -1 */ typedef int code_int; #ifdef SIGNED_COMPARE_SLOW typedef unsigned long int count_int; typedef unsigned short int count_short; #else /*SIGNED_COMPARE_SLOW*/ typedef long int count_int; #endif /*SIGNED_COMPARE_SLOW*/ /* 2.0.28: threadsafe */ #define maxbits GIFBITS /* should NEVER generate this code */ #define maxmaxcode ((code_int)1 << GIFBITS) #define HSIZE 5003 /* 80% occupancy */ #define hsize HSIZE /* Apparently invariant, left over from compress */ typedef struct { int Width, Height; int curx, cury; long CountDown; int Pass; int Interlace; int n_bits; /* number of bits/code */ code_int maxcode; /* maximum code, given n_bits */ count_int htab [HSIZE]; unsigned short codetab [HSIZE]; code_int free_ent; /* first unused entry */ /* * block compression parameters -- after all codes are used up, * and compression rate changes, start over. */ int clear_flg; int offset; long int in_count; /* length of input */ long int out_count; /* # of codes output (for debugging) */ int g_init_bits; gdIOCtx * g_outfile; int ClearCode; int EOFCode; unsigned long cur_accum; int cur_bits; /* * Number of characters so far in this 'packet' */ int a_count; /* * Define the storage for the packet accumulator */ char accum[ 256 ]; } GifCtx; static int gifPutWord(int w, gdIOCtx *out); static int colorstobpp(int colors); static void BumpPixel (GifCtx *ctx); static int GIFNextPixel (gdImagePtr im, GifCtx *ctx); static void GIFEncode (gdIOCtxPtr fp, int GWidth, int GHeight, int GInterlace, int Background, int Transparent, int BitsPerPixel, int *Red, int *Green, int *Blue, gdImagePtr im); static void compress (int init_bits, gdIOCtx *outfile, gdImagePtr im, GifCtx *ctx); static void output (code_int code, GifCtx *ctx); static void cl_block (GifCtx *ctx); static void cl_hash (register count_int chsize, GifCtx *ctx); static void char_init (GifCtx *ctx); static void char_out (int c, GifCtx *ctx); static void flush_char (GifCtx *ctx); void * gdImageGifPtr (gdImagePtr im, int *size) { void *rv; gdIOCtx *out = gdNewDynamicCtx (2048, NULL); gdImageGifCtx (im, out); rv = gdDPExtractData (out, size); out->gd_free (out); return rv; } void gdImageGif (gdImagePtr im, FILE * outFile) { gdIOCtx *out = gdNewFileCtx (outFile); gdImageGifCtx (im, out); out->gd_free (out); } void gdImageGifCtx(gdImagePtr im, gdIOCtxPtr out) { gdImagePtr pim = 0, tim = im; int interlace, transparent, BitsPerPixel; interlace = im->interlace; transparent = im->transparent; if (im->trueColor) { /* Expensive, but the only way that produces an acceptable result: mix down to a palette based temporary image. */ pim = gdImageCreatePaletteFromTrueColor(im, 1, 256); if (!pim) { return; } tim = pim; } BitsPerPixel = colorstobpp(tim->colorsTotal); /* All set, let's do it. */ GIFEncode( out, tim->sx, tim->sy, interlace, 0, transparent, BitsPerPixel, tim->red, tim->green, tim->blue, tim); if (pim) { /* Destroy palette based temporary image. */ gdImageDestroy( pim); } } static int colorstobpp(int colors) { int bpp = 0; if ( colors <= 2 ) bpp = 1; else if ( colors <= 4 ) bpp = 2; else if ( colors <= 8 ) bpp = 3; else if ( colors <= 16 ) bpp = 4; else if ( colors <= 32 ) bpp = 5; else if ( colors <= 64 ) bpp = 6; else if ( colors <= 128 ) bpp = 7; else if ( colors <= 256 ) bpp = 8; return bpp; } /***************************************************************************** * * GIFENCODE.C - GIF Image compression interface * * GIFEncode( FName, GHeight, GWidth, GInterlace, Background, Transparent, * BitsPerPixel, Red, Green, Blue, gdImagePtr ) * *****************************************************************************/ #define TRUE 1 #define FALSE 0 /* * Bump the 'curx' and 'cury' to point to the next pixel */ static void BumpPixel(GifCtx *ctx) { /* * Bump the current X position */ ++(ctx->curx); /* * If we are at the end of a scan line, set curx back to the beginning * If we are interlaced, bump the cury to the appropriate spot, * otherwise, just increment it. */ if( ctx->curx == ctx->Width ) { ctx->curx = 0; if( !ctx->Interlace ) ++(ctx->cury); else { switch( ctx->Pass ) { case 0: ctx->cury += 8; if( ctx->cury >= ctx->Height ) { ++(ctx->Pass); ctx->cury = 4; } break; case 1: ctx->cury += 8; if( ctx->cury >= ctx->Height ) { ++(ctx->Pass); ctx->cury = 2; } break; case 2: ctx->cury += 4; if( ctx->cury >= ctx->Height ) { ++(ctx->Pass); ctx->cury = 1; } break; case 3: ctx->cury += 2; break; } } } } /* * Return the next pixel from the image */ static int GIFNextPixel(gdImagePtr im, GifCtx *ctx) { int r; if( ctx->CountDown == 0 ) return EOF; --(ctx->CountDown); r = gdImageGetPixel(im, ctx->curx, ctx->cury); BumpPixel(ctx); return r; } /* public */ static void GIFEncode(gdIOCtxPtr fp, int GWidth, int GHeight, int GInterlace, int Background, int Transparent, int BitsPerPixel, int *Red, int *Green, int *Blue, gdImagePtr im) { int B; int RWidth, RHeight; int LeftOfs, TopOfs; int Resolution; int ColorMapSize; int InitCodeSize; int i; GifCtx ctx; ctx.Interlace = GInterlace; ctx.in_count = 1; memset(&ctx, 0, sizeof(ctx)); ColorMapSize = 1 << BitsPerPixel; RWidth = ctx.Width = GWidth; RHeight = ctx.Height = GHeight; LeftOfs = TopOfs = 0; Resolution = BitsPerPixel; /* * Calculate number of bits we are expecting */ ctx.CountDown = (long)ctx.Width * (long)ctx.Height; /* * Indicate which pass we are on (if interlace) */ ctx.Pass = 0; /* * The initial code size */ if( BitsPerPixel <= 1 ) InitCodeSize = 2; else InitCodeSize = BitsPerPixel; /* * Set up the current x and y position */ ctx.curx = ctx.cury = 0; /* * Write the Magic header */ gdPutBuf(Transparent < 0 ? "GIF87a" : "GIF89a", 6, fp ); /* * Write out the screen width and height */ gifPutWord( RWidth, fp ); gifPutWord( RHeight, fp ); /* * Indicate that there is a global colour map */ B = 0x80; /* Yes, there is a color map */ /* * OR in the resolution */ B |= (Resolution - 1) << 5; /* * OR in the Bits per Pixel */ B |= (BitsPerPixel - 1); /* * Write it out */ gdPutC( B, fp ); /* * Write out the Background colour */ gdPutC( Background, fp ); /* * Byte of 0's (future expansion) */ gdPutC( 0, fp ); /* * Write out the Global Colour Map */ for( i=0; i= 0 ) { gdPutC( '!', fp ); gdPutC( 0xf9, fp ); gdPutC( 4, fp ); gdPutC( 1, fp ); gdPutC( 0, fp ); gdPutC( 0, fp ); gdPutC( (unsigned char) Transparent, fp ); gdPutC( 0, fp ); } /* * Write an Image separator */ gdPutC( ',', fp ); /* * Write the Image header */ gifPutWord( LeftOfs, fp ); gifPutWord( TopOfs, fp ); gifPutWord( ctx.Width, fp ); gifPutWord( ctx.Height, fp ); /* * Write out whether or not the image is interlaced */ if( ctx.Interlace ) gdPutC( 0x40, fp ); else gdPutC( 0x00, fp ); /* * Write out the initial code size */ gdPutC( InitCodeSize, fp ); /* * Go and actually compress the data */ compress( InitCodeSize+1, fp, im, &ctx ); /* * Write out a Zero-length packet (to end the series) */ gdPutC( 0, fp ); /* * Write the GIF file terminator */ gdPutC( ';', fp ); } /*************************************************************************** * * GIFCOMPR.C - GIF Image compression routines * * Lempel-Ziv compression based on 'compress'. GIF modifications by * David Rowley (mgardi@watdcsu.waterloo.edu) * ***************************************************************************/ /* * General DEFINEs */ #define GIFBITS 12 #ifdef NO_UCHAR typedef char char_type; #else /*NO_UCHAR*/ typedef unsigned char char_type; #endif /*NO_UCHAR*/ /* * * GIF Image compression - modified 'compress' * * Based on: compress.c - File compression ala IEEE Computer, June 1984. * * By Authors: Spencer W. Thomas (decvax!harpo!utah-cs!utah-gr!thomas) * Jim McKie (decvax!mcvax!jim) * Steve Davies (decvax!vax135!petsd!peora!srd) * Ken Turkowski (decvax!decwrl!turtlevax!ken) * James A. Woods (decvax!ihnp4!ames!jaw) * Joe Orost (decvax!vax135!petsd!joe) * */ #include #define ARGVAL() (*++(*argv) || (--argc && *++argv)) #ifdef COMPATIBLE /* But wrong! */ # define MAXCODE(n_bits) ((code_int) 1 << (n_bits) - 1) #else /*COMPATIBLE*/ # define MAXCODE(n_bits) (((code_int) 1 << (n_bits)) - 1) #endif /*COMPATIBLE*/ #define HashTabOf(i) ctx->htab[i] #define CodeTabOf(i) ctx->codetab[i] /* * To save much memory, we overlay the table used by compress() with those * used by decompress(). The tab_prefix table is the same size and type * as the codetab. The tab_suffix table needs 2**GIFBITS characters. We * get this from the beginning of htab. The output stack uses the rest * of htab, and contains characters. There is plenty of room for any * possible stack (stack used to be 8000 characters). */ #define tab_prefixof(i) CodeTabOf(i) #define tab_suffixof(i) ((char_type*)(htab))[i] #define de_stack ((char_type*)&tab_suffixof((code_int)1<g_init_bits = init_bits; ctx->g_outfile = outfile; /* * Set up the necessary values */ ctx->offset = 0; ctx->out_count = 0; ctx->clear_flg = 0; ctx->in_count = 1; ctx->maxcode = MAXCODE(ctx->n_bits = ctx->g_init_bits); ctx->ClearCode = (1 << (init_bits - 1)); ctx->EOFCode = ctx->ClearCode + 1; ctx->free_ent = ctx->ClearCode + 2; char_init(ctx); ent = GIFNextPixel( im, ctx ); hshift = 0; for ( fcode = (long) hsize; fcode < 65536L; fcode *= 2L ) ++hshift; hshift = 8 - hshift; /* set hash code range bound */ hsize_reg = hsize; cl_hash( (count_int) hsize_reg, ctx ); /* clear hash table */ output( (code_int)ctx->ClearCode, ctx ); #ifdef SIGNED_COMPARE_SLOW while ( (c = GIFNextPixel( im )) != (unsigned) EOF ) { #else /*SIGNED_COMPARE_SLOW*/ while ( (c = GIFNextPixel( im, ctx )) != EOF ) { /* } */ #endif /*SIGNED_COMPARE_SLOW*/ ++(ctx->in_count); fcode = (long) (((long) c << maxbits) + ent); i = (((code_int)c << hshift) ^ ent); /* xor hashing */ if ( HashTabOf (i) == fcode ) { ent = CodeTabOf (i); continue; } else if ( (long)HashTabOf (i) < 0 ) /* empty slot */ goto nomatch; disp = hsize_reg - i; /* secondary hash (after G. Knott) */ if ( i == 0 ) disp = 1; probe: if ( (i -= disp) < 0 ) i += hsize_reg; if ( HashTabOf (i) == fcode ) { ent = CodeTabOf (i); continue; } if ( (long)HashTabOf (i) > 0 ) goto probe; nomatch: output ( (code_int) ent, ctx ); ++(ctx->out_count); ent = c; #ifdef SIGNED_COMPARE_SLOW if ( (unsigned) ctx->free_ent < (unsigned) maxmaxcode) { #else /*SIGNED_COMPARE_SLOW*/ if ( ctx->free_ent < maxmaxcode ) { /* } */ #endif /*SIGNED_COMPARE_SLOW*/ CodeTabOf (i) = ctx->free_ent++; /* code -> hashtable */ HashTabOf (i) = fcode; } else cl_block(ctx); } /* * Put out the final code. */ output( (code_int)ent, ctx ); ++(ctx->out_count); output( (code_int) ctx->EOFCode, ctx ); } /***************************************************************** * TAG( output ) * * Output the given code. * Inputs: * code: A n_bits-bit integer. If == -1, then EOF. This assumes * that n_bits =< (long)wordsize - 1. * Outputs: * Outputs code to the file. * Assumptions: * Chars are 8 bits long. * Algorithm: * Maintain a GIFBITS character long buffer (so that 8 codes will * fit in it exactly). Use the VAX insv instruction to insert each * code in turn. When the buffer fills up empty it and start over. */ static unsigned long masks[] = { 0x0000, 0x0001, 0x0003, 0x0007, 0x000F, 0x001F, 0x003F, 0x007F, 0x00FF, 0x01FF, 0x03FF, 0x07FF, 0x0FFF, 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF }; static void output(code_int code, GifCtx *ctx) { ctx->cur_accum &= masks[ ctx->cur_bits ]; if( ctx->cur_bits > 0 ) ctx->cur_accum |= ((long)code << ctx->cur_bits); else ctx->cur_accum = code; ctx->cur_bits += ctx->n_bits; while( ctx->cur_bits >= 8 ) { char_out( (unsigned int)(ctx->cur_accum & 0xff), ctx ); ctx->cur_accum >>= 8; ctx->cur_bits -= 8; } /* * If the next entry is going to be too big for the code size, * then increase it, if possible. */ if ( ctx->free_ent > ctx->maxcode || ctx->clear_flg ) { if( ctx->clear_flg ) { ctx->maxcode = MAXCODE (ctx->n_bits = ctx->g_init_bits); ctx->clear_flg = 0; } else { ++(ctx->n_bits); if ( ctx->n_bits == maxbits ) ctx->maxcode = maxmaxcode; else ctx->maxcode = MAXCODE(ctx->n_bits); } } if( code == ctx->EOFCode ) { /* * At EOF, write the rest of the buffer. */ while( ctx->cur_bits > 0 ) { char_out( (unsigned int)(ctx->cur_accum & 0xff), ctx); ctx->cur_accum >>= 8; ctx->cur_bits -= 8; } flush_char(ctx); } } /* * Clear out the hash table */ static void cl_block (GifCtx *ctx) /* table clear for block compress */ { cl_hash ( (count_int) hsize, ctx ); ctx->free_ent = ctx->ClearCode + 2; ctx->clear_flg = 1; output( (code_int)ctx->ClearCode, ctx); } static void cl_hash(register count_int chsize, GifCtx *ctx) /* reset code table */ { register count_int *htab_p = ctx->htab+chsize; register long i; register long m1 = -1; i = chsize - 16; do { /* might use Sys V memset(3) here */ *(htab_p-16) = m1; *(htab_p-15) = m1; *(htab_p-14) = m1; *(htab_p-13) = m1; *(htab_p-12) = m1; *(htab_p-11) = m1; *(htab_p-10) = m1; *(htab_p-9) = m1; *(htab_p-8) = m1; *(htab_p-7) = m1; *(htab_p-6) = m1; *(htab_p-5) = m1; *(htab_p-4) = m1; *(htab_p-3) = m1; *(htab_p-2) = m1; *(htab_p-1) = m1; htab_p -= 16; } while ((i -= 16) >= 0); for ( i += 16; i > 0; --i ) *--htab_p = m1; } /****************************************************************************** * * GIF Specific routines * ******************************************************************************/ /* * Set up the 'byte output' routine */ static void char_init(GifCtx *ctx) { ctx->a_count = 0; } /* * Add a character to the end of the current packet, and if it is 254 * characters, flush the packet to disk. */ static void char_out(int c, GifCtx *ctx) { ctx->accum[ ctx->a_count++ ] = c; if( ctx->a_count >= 254 ) flush_char(ctx); } /* * Flush the packet to disk, and reset the accumulator */ static void flush_char(GifCtx *ctx) { if( ctx->a_count > 0 ) { gdPutC( ctx->a_count, ctx->g_outfile ); gdPutBuf( ctx->accum, ctx->a_count, ctx->g_outfile ); ctx->a_count = 0; } } static int gifPutWord(int w, gdIOCtx *out) { /* Byte order is little-endian */ gdPutC(w & 0xFF, out); gdPutC((w >> 8) & 0xFF, out); return 0; } php-4.4.8/ext/gd/libgd/mathmake.c0000644000175000017500000000176207455710735016033 0ustar derickderick#include #include #define scale 1024 int basis[91]; int cost[360]; main (void) { int i; printf ("#define costScale %d\n", scale); printf ("int cost[] = {\n "); for (i = 0; (i <= 90); i++) { basis[i] = cos ((double) i * .0174532925) * scale; } for (i = 0; (i < 90); i++) { printf ("%d,\n ", cost[i] = basis[i]); } for (i = 90; (i < 180); i++) { printf ("%d,\n ", cost[i] = -basis[180 - i]); } for (i = 180; (i < 270); i++) { printf ("%d,\n ", cost[i] = -basis[i - 180]); } for (i = 270; (i < 359); i++) { printf ("%d,\n ", cost[i] = basis[360 - i]); } printf ("%d\n", cost[359] = basis[1]); printf ("};\n"); printf ("#define sintScale %d\n", scale); printf ("int sint[] = {\n "); for (i = 0; (i < 360); i++) { int val; val = cost[(i + 270) % 360]; if (i != 359) { printf ("%d,\n ", val); } else { printf ("%d\n", val); } } printf ("};\n"); } php-4.4.8/ext/gd/tests/0000755000175000017500000000000010737115146014143 5ustar derickderickphp-4.4.8/ext/gd/tests/xpm2gd.phpt0000644000175000017500000000137710160300531016231 0ustar derickderick--TEST-- xpm --> gd1/gd2 conversion test --SKIPIF-- --FILE-- --EXPECT-- XPM to GD1 conversion: ok XPM to GD2 conversion: ok php-4.4.8/ext/gd/tests/bug28147.phpt0000644000175000017500000000170010043012342016201 0ustar derickderick--TEST-- Bug #28147 (Crash with anti-aliased line) --SKIPIF-- --FILE-- --EXPECT-- Alive php-4.4.8/ext/gd/tests/bug38112.gif0000644000175000017500000004354410456725164016025 0ustar derickderickGIF89a‚‚÷ÿÿÿš•–}~pnoˆj‚—‘–ІВ‘’TIUzv{jTq›–ƒ„r^‚F>M–’š’Ž–‹ŠŒ2KGPŒ†•=5L ,–¨ ž¥LF^ur~NFj85B”¡4+%E’›RNfŽ‹*%K&"ALHeˆ„¡  >&"F!E\Zn>53W"!<43J¬3$$L&&F&&@˜˜«MMUŠŠ•––Ÿ……‹ŽŽ’––š’’–úúþ››­­®~Ñ+,Egh= "G+-L<=M CEcKMk‡‹¸SUmŽ‘µ˜š¶hiu€"A3}‚±“˜Å;KV6=C%=O*>N.BR,:EKbp6JVq·Õ~«¹–š›ïóô(Òæ ‡““#%%@CC†ŠŠ’––öûûúþþóööòúøvzv’–’˜šþþúXVHtsm›š•nmi–•‘bR.æâÚ•ƒf¤ž•‹yd<4,„y»µ¯ÇÅÃ{zy2'sfZž’‡ÞÓÊ®¦ XTQc]Z}mg&{vu•Šˆ‹††þúúuttþþþúúú–––†††ÿÿÿ!ÿ NETSCAPE2.0!ùdÿ,‚‚€ÿÿÿš•–}~pnoˆj‚—‘–ІВ‘’TIUzv{jTq›–ƒ„r^‚F>M–’š’Ž–‹ŠŒ2KGPŒ†•=5L ,–¨ ž¥LF^ur~NFj85B”¡4+%E’›RNfŽ‹*%K&"ALHeˆ„¡  >&"F!E\Zn>53W"!<43J¬3$$L&&F&&@˜˜«MMUŠŠ•––Ÿ……‹ŽŽ’––š’’–úúþ››­­®~Ñ+,Egh= "G+-L<=M CEcKMk‡‹¸SUmŽ‘µ˜š¶hiu€"A3}‚±“˜Å;KV6=C%=O*>N.BR,:EKbp6JVq·Õ~«¹–š›ïóô(Òæ ‡““#%%@CC†ŠŠ’––öûûúþþóööòúøvzv’–’˜šþþúXVHtsm›š•nmi–•‘bR.æâÚ•ƒf¤ž•‹yd<4,„y»µ¯ÇÅÃ{zy2'sfZž’‡ÞÓÊ®¦ XTQc]Z}mg&{vu•Šˆ‹††þúúuttþþþúúú–––†††ÿÿÿÿŒ©ËÍû¡‰qÝ]ïès¿†âH6Uà¡É~ý¡–»ÿðîF7•úÎ÷JšèýÒØ»Ì|[¿Ärú¦Ôê¢ÚüE–wЫÿ*4;çïW(´ÆºjÎ “¬ùÈ–Ö¨ƒ_Ë×ÎxëÖšhyvVyë”xc-%Ba­â×kç(¨XÉÆö˜FÆ(½­äìÉÙyèvÛâä¹ï™‹ aÝë¸Ï‘@‰æHÛÙœøZk«¨hÚŠ'ÝMªåé °Í)Zùk[ùÖÒâ0K¡«ëÑÝíŒÂ\Gø%êÔy,l [6%F¼Ðà2Å >Ǿ…“UIŸ?6N¨ƒòîÀ>MÿhîØº…CŒ¥J„ ÔJªmÚ¶iI’eÊ‘%~­!T‰"2¶ZU 禅^Ú@ë¥â¢-ÌBAYÊV©Y›Ü0âÅKTÊFÏX¹Ls†‘…)râ§R+0l-¹BãV%’âUråÜ Jmy@ƒÌÒ-QYÅàŦ©mŒµ¼œ1%ΤO¥jvr3hm!1`0WêD©ÜJµj­%‚ÐTÚð¨o4­½QéÉ™%)0 *â‚Æ‹%LüÔTt9s­WKäÈ™#‡‰˜D›(QšÑ§ÓÜ_•NG‘ƒ¡PHx#{ 1ŒHe{™¥„"Ë¥Z\¾UúÓ+M²fÑÿü#HP„B„ ª¨BÇ}ð1wV¡$øã.è˜[zsüÕJ'²ÌMN("ˆOsò‰$RÇ'ŠD!EAÌÏ=Ì#L!`0ÑÊ[SŒ6—wL`AxˆPNñ×*· ‰·œQÚ+û9Ç„"´XÐñÄÓÀ=úˆR\Ã2…‚„”˜0Z-ÝÙ•Úð øhÀLRKò 8ÜR,‰ôÈ£¤QEX†:ñ$ðÍ< @pÅ&±$² €èx …ø±Ùd¸Æ\ݵ@HÜy§øD5æýéC…ÜòŠ*sY‚¨„²Ž:æøÎ ÿ a‡u¢c%l‰!F!¢Z­ŽÅЪrÎ9BýÜÉžH ÁË e‘ÔPµÁð±# ƒQ !ž‰ñE³ÿÀÒG}A‡³pký)ŠlˆˆÄžzZÉYân,A~ûð*Ÿ·nYÂÇ( ׌Çƨ‡*°Ð1‡&rÈéÆ\gûÅ…¬bÉ*¡T²S%Ð~Z‰P©•Ë}ÇDÐÃhðÀk´;`»¯ôñB½¡õA¯kF.g- ¿²G!¯X‚íõ–à`‰ D¯›ÈD+Öô8P¸A\Üã˜À0 ";_Þõ†BÈÄeIƒ-œàµ‚ŠZ8A6 ÀMgv„ÍšÕ JG:Ràöº×±ðõ` `Ú…,È€ô-®3ªb´Z±Š5A 7³ƒÃˆ§‰R¨ eÂ!È0/Jÿðál¡!@štÏuìAø€ÐCj< ˆ ÐÜP>è[[ƒ%^Ñ:è‘u„ˆph ꀄ:‚`¼!øXY, x½/T†{3è3ö @‚4€6jÄX`!ø°²B0A/hå^ñG) ñ dâÁ{Øcò¨€4<àJ0q+*"¸È¼ZØPŒóøÌØNaAÀÆì,˜7žÒ;ªÊPHˆsˆ¼Ç7x1Þy 1¸@³XT‡æUnE‰X"$Q-j­Œ’åJËM €C@ຮI»Ü€ •HD&± :d"ÿ ñ`G¥*`VgýŠç …P¨‰`CXѰl3_èÏŽ=ð™›”f'}°ŽK1› F&`­°ðG‰¢F‚b©LýÂ* Ç0Ù. ÿ°¥@^0óŸÝd';IPTd§¸Á¡äÅ0|a¡ËŸè*R6ÈW¾ˆpfF­â&UE_()=ÙpOé‘Ô» Ü[ëÂKS› Ëð-YÑ&KÂGàœæÐ)¶$¯‹Ñ[ŰU‡B%½+ê©ÝU¤¨˜ p/*Ù1™Òt»5¯ƒ%ë[¡…P µ Æ]y^³øðƒÙ"Z¯M8u¬X…1¶ŠYb™}C°&mJP œW”9n“2чzjTaxöÀ¢9̈€,† Ú8¡R  †À‡Lp‚ ’p"T–Ufö ·%¯ÿ–o,ÙèøËl(k—PW$„–> ì;Pp@ ¤:>=#^db¥Î ˆ©"V¼xq?eê·+ï¶“NC¯H€KØ Üôl"ö°?¬a ‚@A°€…OK*æ¸G:ôÁˆK!œÆŽÍÆŠ'‹8HøB‹]íÀ×)¶ÆžD´?TVüÔˆp \°Žb1ÛFá°”4®à¢Ó¨Hè7·ß¹"mûW~îÞë<ërÛ:è¶Ä,HÁ æÆ dÂw¾A‰¢ªÖYu¨ƒIQzbV0ëϤæèuNLOo¥’ 1M½ºÛÇrùÖÝ.†$R$ b®Ã8ÿØqz"Aä(çà‘71‹YØ*Á0Æ Tôï:(,‡õËussŸWøB1Hq&ú×®ÿ^Q¿ü»í܉±@Ä‚ø@÷Òs²h±(`|ð—+µ¶5®-aóŽ‚Â®LeêŠîê°Ða .h¼$"y>¸9 E§û·«.cMÂü«[F/×W ÷b×®WƤmÀ3Æ3ž5 üP»sžsPé(ßÄ TH©;áîcœ©æÞyQr Ä'`1dS(m({fýÏýr¢K MeÆ„Èí éD°šê <¸b÷|lÀ]½ xOzÒséÅÐUHmŒÿü—¼äˆÈ~Éû0K—t› -pwn¾§I4öU u##fàl@¤ ³À K×oa×oͲ¦—ØGù—W±ç0ÕqHG Å H`w•^™·€Dcç5ˆ`N¤tÿ~Ø,ÒE ³ Ê·6@ ±`±}C šB ÄЂ/˜Ór hF_Ec2wƒK"Rà‰ÀƒÙg ìæ\oÇ— yÀ“}MV®°0аf0y– ’ z€UH °° È{I“wšGc˰ è' åd˜ª@ t@ˆ D°‹€2€h`Hÿoñ¦l_bÜ€öð ð}@šb10…±0 Ã`ˆˆH |^]µCZ¶ `¸S“Ø  ƒ ò%  P,’Òl Œ 8 ¿Ôœ€ ¤@ qG Ñ@|0 #]}P‹·˜‹»ç|s[\ø‹f‰a¨!pŇ€TAœ T@œPZ°àW˜ƒÉf{¤Gˆ` °  ˆ  ± À€† I-öYƒ­ãýIfÔޏIˆM@ ô( ý7û§tl·Óv&)ŽI nÖ I À° ÂW”0 # ÚÀ‹>à:ý ”¿× s¿%’Åx ‚ø0Ùÿç”' …3cSyˆp•'™ évYÐÖaéoð78”ý yšd”0’LÙá zäû·B-I qàz=C™˜Öyæ0ª;9–>©ˆd„–=€–Ë`Fk‰^0’@cÀƒ9óÕW™p™àw€ˆ’0š3 .à™.@ )0‰3ÆÀf\ÙªÀ„@–çâ@Œé˜½™ À–¸"o9 з l臙 S9•Úgl†• eëÃЪà+Àc0šSŸó5_•–•G0G 9›CZ@%P6ð¡óEÝ9–Ù@æ‖: =’lD¡¶ ª0™3 iŸ¢òÕ3ŠEG¢0P!à¢d05B#£o 9°1á9žÚ£áӣЯP:+ Wä¤K*_' £=ß5¹ ¥&`~é¤S ™v¢ °Fž=  ðC8 À 1 ás‹ÖÀÓIpÒ#PΖç@îÀ÷pÌžàXÐ3ØWŽâ½AÎ`Îèöðå\=ã,íࢤæTð¶3Ðãë ‡çèÿ0ïÀlï êxþ@í@ X úmâ© ©ë±Þ…0x°èŒŽë ^ÛÄqP鸪Epák Y€8På0 ó€÷ êõÀ ùoX Sž®벎 ´Ž¬H¸æcé™|i. +l?+ì\ ÞI@Ü îñÐö ¤ð óÀlÑ 1/€=0åÝ®ð©ðívö@Oî_n\ݾéþàš@*š»‹Ö–-žKÝ æÐŒŸ†à g’)€ :Á© ¹ ðÀ ƒ°\ÞŠÿ ¸NñÝm½^` ÿï¨ìhí‘òŽ ê@_RKæ ë óžZÀ McŒó5Ÿ aŸ ΀ l0xð á>ÿ ?æÙ ôOVG¿ñ¨ c<^°>ðN` ›-@ð `_¢RõÙœ Pc@ö8oùf¼ÐúÀömO?÷/æ)íì@ôT`ôr°ñ’°»c¬^PHM ûVP{¾ðP, °c0 UiðDìbübŸ ¢° Њ¼Ðùáðö¡/÷\múbô’ T ÷]0#UÐ(aÉ0 ¨ÌÅýYÀi j jÐ2ÿ Àñ5¯É_ö˜ðàüÑïùŸOß—ý†?`”“V{q°šªéÂâ» mªæy‚smûÒ᮪t1±OsÀe®Xtê­k¸~> QÃÁ¾èûÌ–Û•T;®Ù,tØ—°¸jz³šN«UH·YËPIóaéSsµŠŒ”ZÖÝæ™Ÿ§Ø²¼*-)6:$ÇŠŠH‚°PÖ>2¬ÔÔTšd2ZŸ2^Q°"XfR“´†”†rS[°pš‰¾§ìí .›/Á4É:yÒÖd®Õ_ÃZ½[QP>4HT³pwws•>Ȩ§NÜBÅ!sñ7þ›Q@ ¼î,~ÀG o‚cÈC\pá‡CŠÀð†'¬ £/ÁÛ%_"¤RLDñvDBÎK7º;¼1‡3n€CÍ}~dó’kÞTA ·â ŸÊ@|3*°ÁA’2L´ EA… &æÿ¨DŠç°À;rÈCÍÓ2Õ´!Eˆ=‘a±óô 7ÞŠ‚ã·S°m#ƒH¸ªÂOIü˜CŒ]y¥‘º3ÌØåRcor†KXO„$ÕškD¼ó +zk#øäË€œ.ÎÉ‚"´ 7×]ÿ{tL)þ[ÐG-Š…w -8E¨^ÆÛ‚‹t@!½0Ò#Å‘¬d ùȉ#a"!"‰$¨ðC7ÐÒéþ …ÁŒ5îB f†¤—…N’ uÔ&P~¢ 4 ex|ñ%”ÃÚ+ÖƒNEì[¨"WŽ[(–øçéhAL‹væè9T0‚…»‹¸°¼§ŸPaÏG#,?·ÿ~¹ r&ƒ,Ra$\2Ñ™çi\›,øQ3îxéæƒ†»›ÞÛÉþ£¨¾°Ee—VCѶI.CAh$‹,€I%r9lÙA3Ê)žŽƒ˜yws8u¡V`‹K¶(OƒÑ­Ü­ mª=ÅZ8Ú€¢‡Ä9™}Œ1? >ü£ß)S\zîã›Aš UV`Þd`hô'ºæ5¯¬7ôZá…Øéa| 4_Ò§Š "bl»ƒ»D4ú]àh³¨,âP‚ì¯X°nºfªAR"`ƒ@؉€³ƒÍø ( R.@»¢E4¸Á Ìmª8B ú`ÿèm!J}›CL‰Á np»Ô §æˆr6]¼a¡ÃžiF¦‚(D€uB,q„8Äa‰Qrxc­ÔeÍO¾@Eë`ˆ†xa yƒM…º8†8(b Œ˜f\á6ù©Ñ×xE 6AD¨"“˜Õr3À€™ØòË_N!%(h‚u:D’2I0Ò‘´+Ð4IJZâh€ˆÁ,ì@‡a¨v{8 özs-Sêq™Øb!äÐ… ½–IÒÃ,?±Ã[:¢Cóæ.½`nÀ¡ˆ`à æ@ b@Ϙ¡Àž6JiJyÎ38¡€Äº7XæÍØt¤ \‘KÿS â´†+ÈЇKðA›PEäp”P,s{¾ñ =³eO|^¨š°¼¦"²i†;¸BÂJ#A9˜}TchXÄ1q‰x€ŠD$þ‚JŠno{§ˆDðé‚K\ÂI2BQõ  ?”Bf -,6?”VS§‘@/B…5ü=V@Ãor ¸œŽu™m€D ö0 %^‚ vsžáÏ;DˆRjºa k ±ª¸F/vŠS´>Ü“/XÁŒ5?M+ èH#lá¨pHá Hhî¤wu 3;X+ŒX} 9x!4¸ $ [Ĥuجg7—)k0£ƒ8ÅÀD1-í•bqã@# Ì ~˜„#p›ÛaícM°FªÑÛÖ=a‹ØÃ%ºð9•¼‡Æ,n°W«F^|¥n7._ê6ÈÕPÏ0bw/#L!¹’Ø„Ûôz]öjj~Ô•_U«z±¾`ÀŮЈFC­XÀ‚tIÉ!ùdÿ,‚‚‡ÿÿÿ§œŸÿýÿÌÊÌþúÿ›–Ÿ¨¦¬«¨²±®¾ÐÏÕ¯®µ¤¤­úúþŸŸ¢ÍÍÐýýÿ´µÎ¹ºÇ©ª¶UXuž¡¼ÆÉÙïðõ•›µÔÕÙ‹“±§®È«²È£§´ÎÒßÃÆÐdrœ*/>ª®º³·Ã§©¯ÇÉÏØÙÜ-Q§¨®½®³¿ÁÃÈ«±¿˜œ¥¯²¹6AX¢ªº«±½£¤¦IRbgŒÉ *¦­¹½Äл¾ÃÀÓï°ÁÛ­ºÎ𢮢ª¶©±½«³¿»Áʱµ»•«È›¨ºyƒ‘Ÿ©·§´œ¢ª“˜Ÿ‡­Û¤¯¼©³¿¦¯º­¶Á­µ¿«³½Þãés¤Ù¢È‘·à¨Ãâ½Ñ炎›‡’ž©·›§µÔà®Ï¯Í운Ξ¬š¦²Ÿ«·©µ©³½§±»¯¹Ã«µ¿ž§°ØÞäÈÍÒÀÁ›Å랼ػÎࢮ¹¡ª²©²º¥®¶–¥²Š˜¤œ«¸›©µ–£®ÌÝëÈØæŸ«µ±¾ÉÜéôâïúÓÚàËÑÖ³Êܧ•¡ª¢®·§°·¶¾Äâçë¨ÁÓ¢¸Èœ®»«µª³š¦®z¼ä;HP»Þõ±¹¾³ÇÒ©ºÄÃÕߟ­µ›©±Š’”¬¹¼Î×éïòÄÈÊÉîÿïøüŠÐìÆçõ©®£®²”Ûòåëí¸»¼öùú˜­³^hkÏ×ÙŸ³·Ÿ­°É×Ú§°²ò÷ø÷ýþÜâãíôõÂÒÔ¢«¬ÎÝÞW^^nqqšœœýÿÿêìì®°°¦§§·ÊÉ­¹¸vzyµ¹¸áåä7D@ÉØÓÖâÞ¹ÄÀÜÞÝÉÎËæéç—›˜úýúöùö“•“ýÿýóõóïñïùúùª¬©ÅÇÃÓÔÒÚÛØ®²¤§©¢´·«ïñéêëçÐÒÉHJ>„…€z÷øòilT©«™àáØôõí»¼²˜˜’üüõ‹ÓÓο¿ºææáþþú××ÔÎÎËÿÿýááßÐÐÎÉÉÈ£¢‹Šƒ•”¥¤ÌËĘ•‡ÄþñêסŸš›–ÛÖϰ®¬ÓÍÉËÆÃÎÊÈÿýýýýýûûû´´´ÿÿÿÿH° Áƒ€p?Ê! ÀO”EQª2Zl%*ÀD… CŠI²¤I ò»ÐJÏMªD%µ ™ª'«>žÜɳ'Ot‘õ+¶JÔªRº²¥DV"A|JJU!ÓeC‹-[Ö A4±øì'Và ýV]Ë¶ä² Ê”Q£¦LUZ´$ ,%+¸yÕ¼5+&b‰!ÎÚ*. Ô#2èÔ–k<Bƒdµ‚+Õ§Ÿ'„†)ëH]¶s!zÑ ‚#ÒÑTT‹ ­Å¸ ˜¡\9µViÒDK/sÂn Úµ+” ž´êzûï8zØdÅb$ƒ‚ ,,Dÿp¡J Ð>VŽÜp:àvî÷÷ T–n—+M?bè×¿È gÔ’L7ÜÆŽ6½„ `2 QÁ\rÉÃ,ƒ‰ Éà^rtb+•Á—ÛGå ƒ‰$ZP¢ËŒ3˶HðÁæ8ÓÌ6Øhc Ðà hOìñ+&øÒL¶‚†M”Ápì0BG刘›XÄsM;”Á g Ž`ãlÓŽŽ«)èäÀÆOóL)h`‚ }xÀ$gœá¤ ­d Nø°C S––‹ù‚Í1,ÌM.î´#Í;:º ¤øq‡¥TS©z~ð&XÐ' |°ÿò( ”B¨¡€¼1ÂnÔin&PB ,ìØæw ð\¾øRB3ò¤¡Â*¨úA«”b¶άƒÆ`¢‚0¡¢ A|x!ˆ#IrƒW¿.fB8ÄñD`°Áäù0ÀÜÊ 7¨`ð§>ð€ƒÉ ÒlóÎ6õ¦0 ðR‚  ë…#ôà |Ä»ÂRRK-,¤Ê.@8’Ks7HPp hœÚLÀ/C ;ñ|SÏ,Á  \¢J†Î@©Ö^Ô0‚ =QCÇ&³5/1V„vD @Ñœ ?ü€° ã„âÏ=Ð0ó=ßÄãŽG¸‘¿~Â˳‚ÿ"J±d¸[¬xmôÐ ¸—5UÁS!µÊ ƒì,7ÞD¼ =ì|ó 1¤ÁC6x(¥´nB|ƒÊ*Mêᆧ°Ä"Ô!éôøI‘kÚ,»ØBÂ+ÑÄOv×ÐÝØðAg­÷†08? €žúÄå±Kmƒ?á…Lì¾fø JdL ÏS0Â_˳ÌÂÀ, Ъ>PÂX‡ Ä¥'Là¬O~:唑 eðBiˆA,Ε¾?¸aK€aWØO*[£(*G-`ÈC8+´TP0ƒ‰ëZÐÙV:‚Á qÀ£¡°…ÿŽ&-,@¤¨MY±>ö` 0ðÁ ŠÛð$øã(†Á‚—5gÊDÙªõ4< Î0G5à!]0ƒÄ Û:Ñ"ÆàÒù08P¬¯ ðD>P×X)UÃàĀРþ@{ `u§ÕðX¡‡w©eé`–Œè–p‰uÅ À !Áw9‚‰²´Wɶf> ˜V˜Ç€˜ò` ì-|öú°çðXú—FטÐroi ËÙÐ ÂÓž©!"šMŒušP™~oÆšå5 Çðš¶€}ÍÐ ÞæO³÷L0ÿ&k‡hŽnk„}éÐX  ºð™´š<ðM•Q©—øéÝÅŸÔY[Ö‰i°Ô‡öŽë) Ò · /H\(€ï4îP“Ç`zä ÆŸÊé( ŠpŸøéoO”~|µÿ9î  à ÷…õà<(˜‚òÅÆõ6™Å àÍÁRç eÁPWײ° Ê<¢Î9¢(Beð¤eàŸƒ¹vÀ +Š˜gá<ºos ÷ ¥»0ò€›¬8‘;5xh(¤gø–qI º`¤AIª¤Ùcƒ$=°Š£mÆJSªH@Q˜î0Ù¹ çPIúà :ÿ´C,Æb~Çtäp™Q—™&—àoJH*f°Ë&•}¹> JP!©D¨Í¸¢Ð"þ² ð›@°Šwç â`|çw“ê›lÙˆo™ “ºàœú¡tºl»s§{jªm†ª€Úš5i¨ã°²ªÀg §ug†øL¾Ùˆ&GœàPA²Å™ õÆ œÊZ 5H»Óð8v|E­¬ªH…"/ƒ,e ³–Üà«öúG«ò é ZzË úqÇ@ ë` $ „Pʉ òJ¯nà>Š#‰Rª¥zªcPýj?ƒZ“ ` ZúVÿàp×i¤C ÷500Ô}ãŠz?i !À†| ÌZ¯˜æ>µ§=’=€ã%X1kŽ™å³Ð1É *à=YFcT†=ÕSÎE Ã`–Ù0½À((¡vN ¢m€Q;¢ziªPYY+U1ëvô fpµ0—ÔŠÛ ùÐ{ö¸çP‘ ÓÐ ½0~ Q5`;¥¼Ê|ÊÕ%μʵA öÆÛ»ÈÜ{›&œ¨ßª›ÿ˜Ã0ÅÁ‹Xg›œêÌñ ˜F¿c ¼‡`òÌNÃPÈÏŒ>ÒÌÏI¬ÆJ¬Rº)ІhäpŒ¼åÐý@Q-0é¬Çñÿ+¿s¼Ýšá 4fì³â°Ï#LÂ&,ÀJŒ»Øü 0 t̆ý°Z¡¢@1]‰Œˆ ÀÕé„Óó[Ñ}K} †ü@½ €iìÑný¸Â`Š*¬'ÝÀË` (gñeWÝf`ˆ’0ØÉëÎûÖËŒº@Ïgíµ° « ù€uWÙáê͘ˆ‘Ê ÓP˜,œx- Æ€ÆWΓÀÐ[¼óëňØÌ ¸‹-b†,i ù`榷°?{ ½½¼ý $p° Àix” Kƒ×A @`€ÀГp݈ÀÅÉ»o»SKÿPѱ=½³íӯ娙jnDFS/œdLœ$GG@,§ o FO°4± ´ üÝß­°4Èà³qÝ©­ÕÚíÅݽ¼‰­µã-4åMè00¹p ,Ðk¯á¯à ©p žà ‚ð© ¡ ƒ }0U02àÆß¥¤ ÿÝ ³Q_PàÙíÕË»¼K°¼r@m²Ý%fY¶ á ˜À   ¿P £=Ú[åÂYÕ—ð ‘ ”@˜€ ;¥ …VJ泑Š@àz, x°Ý­=¿^Þ„IÛ,HÀC 0 Ïð ¥€xÁ´ Í °PJÃðNH*ÿPÙt qÑ ðèÈ0Ý€æj>Ø\ÍÚ­ u çóÜîÄ-hç  *@Ï  }îXÑQ½ ÐêòÁ ¥  ­ Ž@ ˜à劮 ŒÞ_Œ^ 6Ž]i~ÝžÌÇò;¿`œŽÑíp Î,vÞ ãP Ýà áÀÐ R° j° Ÿð Ýþ ›0^¬ð h€4ƒæŒ0å0uR "!ü`æ0 Ã^àëìÕ­u­Ùá°Yï õ@Óðýö  ‘í‹° Þ¾ Pß¾z@8| ˜ y° ÉÀ@5¨Sð~  Ðô> _ãønìmó{ ›ÿþïÄÐþn%°ÙÀ ÉÀé˜ ÿ훀Rð H°š@8¥°¿À L ÊòÅPƒ[D põ'ŸòŠÀòÅ~à`ó§çµÃð›EÿÉ€Á²V %PÊð ‹ðí[° k ¿„ã BLÀ±ŒÐS? ^xø¡! dPžã_]é0ÏïO%Udð£ƒöõpÉpêÐ öÀ &ðèÐ j°ñP€ú‹P&¬à÷ À y  QßËàYˆï…¼  L0аõ¿ßõx]- _•ÏQd =½ºŸÊÀç h¼ð S .¡œ°ýœÿÐÀ…òúµ> ø pû¼pS¼@êÏûŒ¯uüê¼ÎkÞÕ`€b¿QŠ´üÍöÀ¡ÌȺyÁ„±Â ¸bÈ6,‡®\¹¬\úÅ ’*eŒRûõ„Õ’#Y]PRå¢:Š&}™4)ÑÌDxð€¹‚å‹>ÐTèP¢E- !µkáÜÕ£' ž‡iɱŠUâpàÊ%£–Ž!eÅ&¢³è«¡O© ÆJ.«3rÏ Tɲ̘4É F'OŸH Fl”©S¨¾y¸ä@¹`ÁÒ­ShŒ,W¸,¹‚õDYDB¨`9úIÓ4F§Z™8[vÿìK)WÖi³ïÌIaŠ C„pbâÅ‘2mçî[ÔÇYÆÙ›g«7¿’±1& yȸúE6TPcÅ´bÝ)öíñ1*I^ÜŠ\îžù;°ðž´Œÿp˜kÚ ç›z³ ÎéFœgÌyXt tªlø xé Õ.aD‘KJ…½RJi”7ªð]úâ àKd?"„ƒ%ÿ21 4žo>4@…yžáF:nœÁ§«iº¡txï-µ„¤MDeE1U|Âã¦/°¸1ŒƒÛÑ‹ƒ¤ó0j°iÊÀzܱ€B™G‘ ,)Ägÿìé&›n”™œø@^¶|Âô¤–>ÄÜÔ>J!J´À`@`R„ÍÀÜ\ÕF9ë„õ¨aðdÌH Xù³› N(>)Erº9ë "¦‹ÖXÃ5òðÒ@@é£ÚMWôô 7 Æ‹/Œ@¿‹¨‘ÇXÏjÖ¦”«çHVXT fˆ¢ 5>á‚ÄqÆa|ùe‹ @B )Ö¸cšK\øc pÅÚj=øE 9¬(b‡–øšiÕá|õGtcU×)=m8c‡æYc†ºÈÁ>ù¤?ذd $\>¸PKr€eP& 4¬5ºWLÐ!v(ûÿ`êx?0®6Wä‘ë,¹À=Qfˆy ¡wB ÉaŠM61 $¶¢`.ÑÃŽH`©¥äH烌 øØàv©CjÝÚÔˆà^UjkXÕ%òk>Âf¹ì¨ˆ„)¶=ô º0¤)ü ‚ X@fo^J€ýoÀ-(eƒ!ÚÙá‹–©±Mß‚{¼G­%²l°©ÜøØa—yr æH<¸#“LpðÃÒ e#’Hø@EuBqÁŠtlˆöÖ/E‰kdù‚%Þ×ô]Gs#'>È;‘÷ÚLЂæ¡(a  8Ñd! w¸ƒ$Á;x¼ Ÿ‚¡ÿØ`}ØÐÀRèâ ‰›L~£8 >ÊfÅ?å¸#  …ÆúÁ{8hD#ì€d|ˆ„%"Á¹;Xâ‚C«B0~€ üÀŠ Ä…1*Ül,…5깊ð‡ÆP†ºà_løYX¡yà¡rÀ*pÂz™à'ö”b$ƒ|pEQ X„@&°¢mÈXà0€v·»—èŒ`”à ‡gFâÜIrŠ;FÀ‡#$ày-.à Qz K(ëä=/y°UHÐñ“MÚZ(†>^ŠÛÁ‚ÿs¨ì?‘s¥íó…ÓÊE0ûx84¿%{D@!ÐKŠAûÀt‰…Xºk8 H }[Á)œBÍbƒê«>"ò¿G0*tÀP„‡CE°§8hƒQ¨9xÿZ(Z¨µ# ~H†[ÀYК¢2xÂÓØ`P?À;@5B¤B*ä¼A–0‚‡kÄF\2ôkƒ4̃U€}@†7„C @ž…Z(…\ø†Á€!ÐWÈ`x`op­GxH:Í¢Å)”‚Bp…‚70#_”‘Äa8ôCXdø dÜDâPð±;0/¨„C(GÀ…kdÅl`À4 ¹ÏÀ…1S‘‘s¨ ob®ðX̃k¼Fqô„?`”TȪúƒ8X png conversion test --SKIPIF-- --FILE-- --EXPECT-- PNG to JPEG conversion: ok Generated JPEG to PNG conversion: ok JPEG to PNG conversion: ok Generated PNG to JPEG conversion: ok php-4.4.8/ext/gd/tests/bug37360.phpt0000644000175000017500000000054110427647767016237 0ustar derickderick--TEST-- Bug #37360 (gdimagecreatefromgif, bad image sizes) --SKIPIF-- --FILE-- --EXPECTF-- resource(%d) of type (gd) php-4.4.8/ext/gd/tests/png2gd.phpt0000644000175000017500000000226410160300531016205 0ustar derickderick--TEST-- png <--> gd1/gd2 conversion test --SKIPIF-- --FILE-- --EXPECT-- PNG to GD1 conversion: ok PNG to GD2 conversion: ok GD1 to PNG conversion: ok GD2 to PNG conversion: ok php-4.4.8/ext/gd/tests/gif2jpg.phpt0000644000175000017500000000122010160300530016342 0ustar derickderick--TEST-- gif --> jpeg conversion test --SKIPIF-- --FILE-- --EXPECT-- GIF to JPEG conversion: ok php-4.4.8/ext/gd/tests/conv_test.gif0000644000175000017500000001160607573467176016663 0ustar derickderickGIF89aKKçâ(:’Þ~b“n‚·ªFfnr©Þ".¦p‘ ‚©FŠÒ–Rz÷Úâ±B^ªbƒ‡f’šršì¼Èjr«”užµ„¥¨^ŠZ†Â6L¨Zz䨻ŒržÀF\Y~¾¾>S Z}¨Vv„r¡Ê‚•ºF^îÒ*:p~µÙŸ´Âqnn¦h~¸—Z fЍRq¢Jns‚¶Æ2Fј«¼p‹¶Hb²d~t¥†^ŒÊ.B…ƒ°«~¢zjœb~¹šRwŽfFŽÕ§NmÆ:Kpz±V‚Äú’_‡®Fcɧ°^|R‚ŨzžBŽ×bv²v~³¾Zr¾TlÊ2C‹v¢º:Tþóöž~¥˜‚ªfv°zt¦°ZwºNg„v¥¶n‹´Vq²j†Ú&2NŠÎŽ^ˆ”z£¶B[Ø‘Ÿ^‚¾îŽl—žRvÊ6F‚b‘¼~›óÎÖ¾Ne°Rovr¦²NiÂ’ª†b¦‚©˜bˆˆn›V†Ç¨v˜Æ~’¹‹¨é¶Äœv›¨i‹»z™ujžfz´Æ>QŽZ„Ö.9j™ê!ºZv¾BXŒƒ¯×‰–z¨zz­„~¯¶b}rn£ov¬ b…¹^yšk‘²pŽÚ˜«>ŽÚÎ2@¯Jf¦JjšVzÚ*4~~°‚f•ûçëö m’’V¶Nh~z«šfŒ®Nk¼v”ò¾:Q¸j…žNs¶z›Ò‰—^~¼Â„šznŸ¸f€Äx–V}h‚º´~ ’Z‚¾JaZ‚Á Vx”j’vz®¬pˈ›N†ÊУ®h†Š^Š’‚«é²ÀÂŽ¨>’ÛÎ.?¢Np€nžzf™¶Rl¢xœ²F`â"*ªJi”~§b‚½Þ&.ºBX˜^„ˆj—vn¢¶>YºRkÂ:N®VtŠbrr§~f–ƒz©¬‚¨°zœê"Ò.VJ‰Ð¶t“°v—vvª“n— ^à ´ïÃÍÂ>R¾^sœz  r–”fŽâš­æ%ºbzæ®Á¾j…JŽÒbz¶z~±ŽbŒºJcRŠÍÒ2>ÂBWÖ*7Œ~¬,KKþ3 H0H¨L¡DˆP6@ò“h`‹E[üùÓ6âWH5\¸°0RÔ“㞌{Æ€%0 L"À ¤ÈÒ¡€UO‚@L(¦¡<ˆXjÑ∧¿¢6 )Ò‚U 'U>qIàeL™“p’«€§ÏM›‚¨]«v … !Ê›«tiŦO¡FjÒ¤›ß«L>L˜×¯7Å’RP–+´›‚L("¡Q¹Æê6uúT›G¾ÝªF ,j\ÊÂ/ Ó Ë¢Ç¤±dy*@Û'²ä·Dã ¯îÝ‹#ø`Ázôrm1Ó!‰¾üb °À)@ªßÁH’+€0 Å%—(cÀWÂQ•æ•jÎRˆá2s¬ï°†¼&­³’Â+#öACœ¾ °²0ÂFDìÌf䇻ü$Û ƒÌÞí¹Ã'ä3Œäj¬ Ò¬à,ðËây Ÿ3­KÓ¸á†Ð?¯Çÿz€ÈDT×”PÁËO±ë^ílg6XˆæË‚²õ­Ïïë€,:@·’!/twßþôG.ÓP±KEj– _\IY dÇ5‹¤! œÀa)(®ïþÒè€;ú}°Ê›†.Ü0 Tà ÐÆ OUD#ÈUƒ*Æ>|O4tà Í7 f¡ U¸@ÒH!¦£ˆp‚’w·üAzÕøx‚>B)Ji]öÐC*°EÃ{`¤á¡ pP°U8c.@JVr‹H4G!€«v4ƒœX aHï'гv‘u =3òí¾FXÜ‘Lh"æÑŽ"èR2È… ŽLR`Ì€3àÇ|àÏŽÐ#¥÷ø¿Dô1JZ{WŸ Ù zŒ7Ì!†ÑŽv¢ åDD€9ÌÈ@ *XD<ã fÂ!ùþ˜Fþð½?è!8H„@#pM§h$8XÊÒŸ ´À~ˆñ–K0'8z9DÈ`Á &€‡hBž©'ò|ì`”pƒˆƒ–¦B '(@fz—¼dÏ<…ü“âhiË402¢Dv‰U¨˜ZÈ…0ñ MtÔh„'àÌ¥wÔ#@SÁUÊt¦xi]á¾!Ù1®–>m¤9Ñ9yu£Ð‚\åªÔŽª@šˆª'f1‹1Œ¥Õp¢0þˆ€ 4_@ž²…àÎ8eeÇ… FNT¨muëô¡CpÌ£ ŒØ¥*æ[_S˜ØÄ¨8tË1øw:œàsµ«Ô Æ9qÜc ã¥p ¶g*Œ‘MÃVàD#ÁQ…"„¸P6Á*@@œ¶°ÅJ lø@‡;2@f'| Æ\]Cþƒk«ˆˆC@G8„\†ôtÉKZ††õa…4¸U¨èˆI\eB€ @4.la o¸ÂËĸƒÐq‡2Ÿ93 ÂR‘ã@XâØÃ=î!çϤ§û’³ô\ }ä°ŒMª[9k:ÂÐñPÔ0,ºg¸Á¢à Û NpÂ>ð*¤b k°­§Á=X›ÔØ@ ¨Rd }©qÅàD1†Á,€ÃÉEål=VQe0Ä@Ã:ì Žu¸Á ˆí 8ÁßWx¦Ï¡cÃy ×G¶Ã1•&Œäbø’….Ž•oh 10á*eB˜"×ëX&þ° <⽨ƒ+nà~KWPö:A‚·ÔÔ¾v¾#œ×*^B•{VîÞQEX§°ƒQÐÁÄ`ÀÀ:0(,€%@y&°obÿȰ†5féšC8ÂÕ5¶{n„ªtCì1 ´4Ô;6¨¡‡MÆ(0™ƒ§\!‡&Ð@¬§œëÄF†¬±‹+ˆ ´8ÇŽ1j#<98E8Âí¶ÐÜ-ζ»#KgîLa 0¨ÃhX€¼1P"!߈‚á„üÃ>äüæ‹ú˜ß@,ŒÀ|ä|I9ËÈQ1>V Êe¡‡”¦ jþ¡G”¨hý#tMzÐåmxà …]ìÂ÷Ö°Dð;A‹ü€òG~ò7ÀyæÁùô2„B&C9Ò€F”$LJ• Þ—g` ½€ P´—u÷V×€à`÷ƒ|ÁG õjÕfm9ma±°‚Fp V¡©’#_À#C9éÃ>E@u• µ Zy`gðk/Ðm€r/€ë·{ƒàƒÐ –€"H?À Ü&x ' @ ÛàO€2wÒÂ#h9ÒpjD 5Zµ`æP ÞÐ DÐ ˆ m€„o íç‡ð{ø…J …?€{þ÷€…)È‚-Ø‚Xñ[1€4X-gb9€†9¸†å_s`]ÖeÞP¢x zÈ~}x6` ˆJ`(`ˆ;—œ§‚\(··p h/DÇeò*=à>hHIò¤xàTœ8]v®°r®p ê§»‡ ¾÷6ð„¬8ˆ$À (€y§p ü·‚µh¸˜[1†Ñ1Cp ÇÀ/þ" ßpDÔò„Wx@]ÿ5Gpúö7°~€ » ø¨ˆJ TÈÞޱ°@r° ¹˜yŽðQ&“p EóŽß°ADTL!å_ð0vÄ]º§„¾7‡þ“«¨$ÐÞ §°‚r0‘·Ài‘,á4x(ìx-p#?”ðF˜R  Ôe’wàR`î· ƒ“¨høÐ I$0à)¨‚r‘Û° \p‹? ÎA†9 Ù¢-ò’Éä xU&ilîÐo^àŠvKhø„-596ù+‘¹ û°–?™ñA4E#—Ò¡´?ô³p{5 ¨õ^c~Y¨I~h\ˆ_ –¯Ø´ ;iiÙ“? H \?‚-À ™HI?Ì Ëš³€@i}éo¨ù…` 1i¨ˆ-pb9­þÉ9©…É“>I¹›>ò#™ó/µ¢ó“qTUUÕ Vf˜x‡à„†©^ –ŠÙ Ý f i™–äI<°›æÉ!–É(: îéÈ#TU|5 –N1çÑ)–ð„ ‰›(Ð (‚©“©–>ù“¾ 3*2A ҜŠD] ;¤«Õ Íp`Ì&s3çxÁgÙ8ˆ±™ Pz ´¸“Û`‹=É\`H€¾à `£a¡&lÒ9JóA 4 BºZv`Ë&pK …´ðš( Û™ RÚ˜ ™XJ>¹¥4ú¥_ê›þ6Ñ(eJ2›: „?°ZP¤ÁÌ6W0`T`"8§`™˜9  ß ž{™ö@ž<@£] ` 2µB¡õ³ªDMd—[ FÁ@d·çyŠ`ÜX“*šyª“{z ‘É ª¥3*¨ªú¥8¡ÜâAGÏ´O•GZµ`жŠð­"èŠ(P…™ªgù˜\ –ö` º¥ï^*¨A²<LƒDH„7*¥RÒ¤UΠiжcSH…{ˆ™—‚Êžºþ®Yú°ñ ¯«:ŒA$}±÷C­ûƒG={ä @K ÐF $H…‡ˆ|Rª|ZH¥0Ú§ ±1+¨‚êª5û û᣻BÐÄO-…@Û`DËcpfm¢&gÀ˜´I¥.[ª º ^:£Q;µ÷ÁÞ²:«?€åR@ë Ñ–c öfi'g'(‹:©…Æš¥›¬+³ ª+$›àüÁ4Ð<ãÂ?Õ³ – AmàfÔj£–|œ'Ži‹jIl»¥\*µËºª«*’ºr$¾2.Y¥Uœë 9æ·»SpWX–)‘‰¥ìZž»¹¸q뺋Y›2R3.xþ´¹/¥f~ëfÜj{˜§²a°…{ ™· º Àû®1«ª^Ú¸«º D")¼’2*s½-¥‡µfÄg|‡¾à¸ˆgÙ²~š¸<à æÙ¸ñê¸_ ¿k³Hô4Í“2Õ05z°GÞÕiÛ½d{°³‰–r°–ÉË À¥ ¼ÀÍ+µ´‘Ó€$.<.Ïc:R¤¿‰ JSo6¶Ç—²9I¾<Ù“èû°»ÙÀDìºFµÁPƒ$ÏSJ3¬¿ªtõUo¦sŽ@`r`›@¬ºÉªÀð뺎‹ÂñK¿`¹÷+Ã&ÄG‰^3d¤šŽF°|wxi¸(ÄšožŒCÎ:´’ЮL“¥^ÎuO>¯{b"HžƒdÀdDÏ_Ð ð`¶ ±s´á@®E¨)|4ùX–5¬Ê ²ý|áW”bI¶”[rxýÁTsÃ^6f¶0 FÑ`F§bXß©{ò}bßê¡cÖ±7]±<\£o‘™ ^$jBmG0Û’u™éÌ qƒ&›c KMÖ¹xDÒå)n†ŒÀ%×+ªþ,3àú\9, “@Dz*V-±JËLÑC|‹þùÖhcSš^¥Á¼ôò£vOÆwç”f`3B&á-Yº“Azm…ÂD†5‘¢°j{6^ úHÑhå<`µ{ºTÕ]‹©¡¬©$¤¤’Ð8‚Ùd)¥{6¹Sͨ*p‰W31“Œ»dêyZÑÊ[„MðZ |ÏU ¢2[¿JÓµ\}ºwO5Kƒr2!¾­Ø$É-á~WMªf¢•¨®ÍÖ¸Šš©™!ã.ÙÊqzô ÒNQ˜Õl¼$Ž„ªxi¬FèEb6œ zÕma@åÁ•·léM‹¡bë©Èš‡$DX] ’4@–ÞÒ[)§™ˆEŠÖ\]‹d˜…wœa~5´ôRF[÷´øé fÁ)H2ÁSCb•J‚)&#€Fk »ršoénå°Z$|˜±ºŠ{AÁ]x›Ú–v RqZ硲úOñÂLoÉáÁ*¶$D4/NPª—>­ ÖüS3Ã-ÝËy¢ÆÐá öz2qun‹§TlJããÀuš‚Y‡&;VËwåª$¤„û› Ñ’‰)!%аÝ¢‚Nƒ¹…ƒ„ÜR.gAL?«Õe"j¬ï.‡Ñ¦Æî)´¡£žNð(Ê*-½ˆ'ó. "rϪ©éŠc–”D“P’äV,FUÂj `u3 C12gšY 53  °÷YÞȦÐ|µîiÔ½k:÷NZ¡ˆ¥›ejðèð$¥tK·/éþ&"É­ '~<€¦ÐQ h¨ŸdÉÆÆLëØÕúûRÕ &£ÉÌCW¦ ¯éç^\zk럀Â[Rˆ…"ÎÌ$)å·üõ§$))³H¡â~C¾ã_¦…8a€Pä S3jefÅiÔª7­]žÝˆŒN·x9¢šáEØ›º 'j+ÉòM½6ÔÄ“”Ò=}ý)1e¹å÷û-å%+¬¨>Ïò8ô§/8aåiEGQ7£ÁÙ èPT« dh†zOØ‹¡§ÞÌR¶1¶2ö„^è)Më犈!+Õ%Q¤jÌíK’”ä–ßßßoï_óûælfçóLJÉóñ,_ßñ,FôŒtfB˜Ì ŒT£J/’lžv3;ïÑJã±BÛzÏÌ?–.3`IK5§kmk_‘"9ÝïI™Þï·Ûû×·oßîý–þð®Çùüçwüo*†£™šnÖøƒÕdjÍ—»¡iÁ®Ù¸k †pbT|g¦l,[‡ç1LKÖ¡ ›wqÆ,‘[Jùžß¿ÜÿúíËßþ'û£>¼ý½ú<Žtjy"eÃaƒÑF˜Ò@UL»6É¡šCݺð>öGeébê&`³¯ @éÏ”‘¥tãb½¾S ‰9§?¼çoÌù“þú#ÿü÷S–$꽫©*Fo¦¤©¨¢ ŒN Ç >ª’»©§ê¹’›wpð¨öén ”$@möšžôULSýõ‡þxèqšªÁÜ‚À%ÕLÙ‹Pš—ø^ëë–g-[?ÿ¼è'öc Ä0f¸aæ)!Ò´¤[ÕúŒSËù<žÿüÎÛßóÏßõ8?þñËññox yÃóy2%ÎRžçùã¡ ~yðTœ@ LI5"¥X£CCÞ úëeîmÔPÔ¹{š¬Lõ ÂôÖz [; 3e¬¶¶lâ8ðË~ú‚ÇSòLgiÇi þuàã‰<`'Pàôƒ8 Ú<m‚Wµg…»Ìt¨-§-iû¥¹^-[Ò»»NZ„‚7)f µ¤Á5”‡°¯_p3;µÃŒ$YÀ_>ðñÄÓðN°",@M¤˜5À$§H.JAœ¶RÑ}©¸Á c¿¹ö~ÄQ…èÕתL4Cªu_A1šAb(O{ª¥›åd(p(ާâài<KY…PxœÖPõ‚ÑɉEfÄ"?=HµmÊÝàô^i.‹'°y‰b¸‰j›%)Pgôb()«Ö²ìBœ†8Ñž XTLÏŸ+:9ëcRû>hTÎ8/¾tÀ >f*5#çHe2Eº|<±Lç!µ%„’Åì ºÆð4Ð xœ ­"в6–õó ¼êÉbèSŒµ«°+<—lëÌsÄpà„¤¤†›š¢µÕP´f§ÕŽVaNÈZ':AÆó´³‘³¡êáU¢ 8Oz{¯®¡³M1zÝ“>̱Ök]fá \àÑ@õ´ôVAZ¿S®öµ0ƒÖf.´zê=zÏÓ”.Æ|!m©õ£žK¢ 7Ä›;‰é<Œb~¡NÊaé^ ·blF³F=Ô­……šÇµ±ÄóÄaR¼¾—ý£Ã‹—¥ªYr:K‡(Á«ß¢¨SåX/*ȘÉÏ’ o7CRC˜ðoYGô“ÄD5{œ<=J5Kã$¢€B¼u’åܦ0ÎÉshz—Øà 3õ&TÌy8]Hi/N%• æ $ƒŒÖm” jö<í´šcC- Ú‘‡ó<[ƒX„Ža±Ù†©ëyسqï•KC*N—ˆB¨"bHBIÖüœ)pªže z ã£ZÍ0ê]ÎpAØgáq"¼ÖŒ ï#tJÀ†ð쟌h´Ô1IS¶çVǹÖñ*BBöø‡Æo†W(J–®4!`×kÀ+Â:‰ë&plŒvoÍ\ )ÚgGíÅè}úµ‡0˜¨ùV¦4³Ü0ÓÀâ± ÁôÑ&Æ„b) 6†ò:z#x“M…«Z\ÜÜEŠ):ñíŠÞhdç~¯N.7ÍLÇšáUýßû(Í8ÝIW‚êqý&äÏà±]ܺ¨QD(—L[ ÆÕQ­u¿ ï%ÂfSW7ëäÖÍÕúy=ÅÕ@®g/m–wMÝ!üýðf-…nw7”…¶¥ãœÄ+¼E~í< æ¶}›;%à,®ÞŸÃëyèÅSܖ̼ªkx;\ÌÃgé0v¸oˆú ¯ì±ß׆ë„W~=¤/öRHø9¼±ˆ>×ûÞ¨Ì1hª;²ß…°Å-êÓ\÷sãZûš)¶}‡—àô,¬ÀD¦†è߇‡¹Z¼ë½Ýpal yI¼]fFõŠjãV o™,õðÓÿÂÕÊìjc÷4Æv꨾ ‹{Ÿ¬ùÖ…§–þóïЕ ­.7ñxù–—¦?£¢Ž›eÙíGB¦@VZzþÿððª{Z\øçð¦¤ò»<¶×=,Ö‚³àÑùèÿ1<¬,}é§lÙ¤ët;NhDšqY¯ËÆe݆¸ ÿ <Ù$5†|ú¯v{5Š7²\–ãbV[ÞÎÿý±äẈÿ%<áöŸ:_ØÔ^Ó®ÃâéúÉz]eöÿ€ÿê[Šƒ;œžžIEND®B`‚php-4.4.8/ext/gd/tests/conv_test.xpm0000644000175000017500000007217207573467176016727 0ustar derickderick/* XPM */ static char * conv_test_xpm[] = { "50 50 1535 2", " c None", ". c #F81010", "+ c #F71112", "@ c #F51314", "# c #F31517", "$ c #F01619", "% c #EE181C", "& c #EC191E", "* c #E91B21", "= c #E71D24", "- c #E41E26", "; c #E22028", "> c #E0212B", ", c #DE232D", "' c #DB2430", ") c #D92632", "! c #D62835", "~ c #D42938", "{ c #D22B3A", "] c #CF2C3D", "^ c #CD2E3F", "/ c #CB2F41", "( c #C93144", "_ c #C63346", ": c #C43449", "< c #C1364C", "[ c #BF374E", "} c #BD3951", "| c #BB3B53", "1 c #B83C55", "2 c #B63E58", "3 c #B43F5A", "4 c #B1415D", "5 c #AF4360", "6 c #AC4462", "7 c #AA4665", "8 c #A84767", "9 c #A6496A", "0 c #A34A6C", "a c #A14C6E", "b c #9F4D71", "c c #9C4F74", "d c #9A5176", "e c #975279", "f c #95547B", "g c #93557E", "h c #F71212", "i c #F51315", "j c #F21517", "k c #F0161A", "l c #EB191E", "m c #E22029", "n c #DD232E", "o c #D92633", "p c #D42A38", "q c #CF2D3D", "r c #CD2F3F", "s c #CB3142", "t c #C83244", "u c #C63347", "v c #C43549", "w c #BF384E", "x c #BA3B53", "y c #B83C56", "z c #B33F5B", "A c #A5496A", "B c #A14C6F", "C c #9E4E71", "D c #93567E", "E c #905780", "F c #F41315", "G c #EB191F", "H c #E61D24", "I c #DB2530", "J c #D92733", "K c #D62936", "L c #D22C3A", "M c #D02E3D", "N c #CD303F", "O c #C93344", "P c #C73447", "Q c #C53649", "R c #C2384C", "S c #C0394F", "T c #BD3A51", "U c #BB3C53", "V c #B83D56", "W c #B63F58", "X c #B3405B", "Y c #AE4360", "Z c #AC4463", "` c #A74767", " . c #A34B6C", ".. c #995177", "+. c #975379", "@. c #95547C", "#. c #8E5983", "$. c #F71213", "%. c #ED181C", "&. c #EB1A1F", "*. c #E91B22", "=. c #E41E27", "-. c #DF222C", ";. c #DB2630", ">. c #D82833", ",. c #D42B38", "'. c #D22D3B", "). c #D02F3D", "!. c #CE3040", "~. c #CB3242", "{. c #C93444", "]. c #C73547", "^. c #C53749", "/. c #C03A4F", "(. c #BE3B51", "_. c #BB3D54", ":. c #B93E56", "<. c #B64059", "[. c #B4415B", "}. c #B2425D", "|. c #AF4460", "1. c #AC4563", "2. c #A74868", "3. c #A34B6D", "4. c #A04C6F", "5. c #9E4E72", "6. c #9C5074", "7. c #92567E", "8. c #905781", "9. c #8B5B86", "0. c #F61213", "a. c #F21518", "b. c #F0171A", "c. c #ED181D", "d. c #E81B22", "e. c #E41F27", "f. c #E12029", "g. c #DD242E", "h. c #DB2631", "i. c #D62A36", "j. c #D42C38", "k. c #D22E3B", "l. c #D0303D", "m. c #CD3140", "n. c #CB3342", "o. c #C93545", "p. c #C73647", "q. c #C5384A", "r. c #C3394C", "s. c #C03B4F", "t. c #BE3D51", "u. c #BC3E54", "v. c #BA3F56", "w. c #B74159", "x. c #B5425B", "y. c #B2435E", "z. c #B04560", "A. c #AD4663", "B. c #AA4765", "C. c #A84868", "D. c #9B5075", "E. c #94547C", "F. c #905881", "G. c #895C88", "H. c #F81111", "I. c #F41415", "J. c #EF171A", "K. c #E81C22", "L. c #E61D25", "M. c #DA2731", "N. c #D92933", "O. c #D42D39", "P. c #D0303E", "Q. c #CD3240", "R. c #C33A4D", "S. c #BE3D52", "T. c #B94056", "U. c #B04561", "V. c #AE4763", "W. c #AB4866", "X. c #A94A68", "Y. c #A64B6B", "Z. c #A34C6D", "`. c #A14D6F", " + c #97537A", ".+ c #94557C", "++ c #92567F", "@+ c #8D5983", "#+ c #865E8B", "$+ c #F41416", "%+ c #F11518", "&+ c #EF171B", "*+ c #E31F27", "=+ c #E1202A", "-+ c #DF232C", ";+ c #DC252F", ">+ c #D62B36", ",+ c #D22F3B", "'+ c #CF303E", ")+ c #CB3343", "!+ c #C73648", "~+ c #C23A4D", "{+ c #BB3E54", "]+ c #B94057", "^+ c #B5425C", "/+ c #B2445E", "(+ c #AC4866", "_+ c #AA4A68", ":+ c #A74C6B", "<+ c #A44D6D", "[+ c #A24E70", "}+ c #9F4F72", "|+ c #9C5075", "1+ c #995277", "2+ c #96537A", "3+ c #8D5984", "4+ c #895C89", "5+ c #84608E", "6+ c #ED191D", "7+ c #EA1A20", "8+ c #E1212A", "9+ c #D92934", "0+ c #C83545", "a+ c #B74259", "b+ c #B4425C", "c+ c #AE4764", "d+ c #AC4966", "e+ c #A54D6D", "f+ c #A34F70", "g+ c #A05072", "h+ c #9D5275", "i+ c #9A5378", "j+ c #97547A", "k+ c #8F5881", "l+ c #885D89", "m+ c #865E8C", "n+ c #816191", "o+ c #F11618", "p+ c #EC191D", "q+ c #E81C23", "r+ c #E51E25", "s+ c #E31F28", "t+ c #D92A34", "u+ c #D62C37", "v+ c #D12F3C", "w+ c #CD3241", "x+ c #CA3343", "y+ c #C73748", "z+ c #C03B50", "A+ c #BD3D52", "B+ c #BB3F55", "C+ c #B6425A", "D+ c #B4435C", "E+ c #AF4661", "F+ c #AD4764", "G+ c #A94A69", "H+ c #A54D6E", "I+ c #9E5275", "J+ c #9B5478", "K+ c #99557A", "L+ c #96567D", "M+ c #93577F", "N+ c #905882", "O+ c #8D5A84", "P+ c #8B5B87", "Q+ c #83608E", "R+ c #816291", "S+ c #7F6393", "T+ c #E71C23", "U+ c #DC262F", "V+ c #DA2832", "W+ c #D82A34", "X+ c #D32D39", "Y+ c #CA3443", "Z+ c #C83546", "`+ c #C4394B", " @ c #C23B4E", ".@ c #C03D51", "+@ c #BE3F54", "@@ c #BC4157", "#@ c #BA435A", "$@ c #B7445C", "%@ c #B5455F", "&@ c #B24661", "*@ c #B04763", "=@ c #AE4865", "-@ c #A24F70", ";@ c #A05173", ">@ c #97577D", ",@ c #94587F", "'@ c #915982", ")@ c #8E5B84", "!@ c #865F8C", "~@ c #7C6596", "{@ c #E51E26", "]@ c #E0212A", "^@ c #D32D3A", "/@ c #CF313E", "(@ c #CC3241", "_@ c #C63749", ":@ c #C43A4D", "<@ c #C23D50", "[@ c #C03F53", "}@ c #BE4157", "|@ c #BC4359", "1@ c #BA455C", "2@ c #B8465F", "3@ c #B64861", "4@ c #B44964", "5@ c #B14A66", "6@ c #AF4B68", "7@ c #AD4C6A", "8@ c #AA4D6B", "9@ c #A74E6D", "0@ c #A54E6E", "a@ c #9D5276", "b@ c #99567B", "c@ c #96577D", "d@ c #945980", "e@ c #925A82", "f@ c #8F5C84", "g@ c #8C5C87", "h@ c #895E89", "i@ c #83608F", "j@ c #7E6394", "k@ c #7A6698", "l@ c #EA1B20", "m@ c #E21F28", "n@ c #DC2530", "o@ c #D52C37", "p@ c #D32E3A", "q@ c #CE313F", "r@ c #CA3444", "s@ c #C83646", "t@ c #C6394A", "u@ c #C53B4E", "v@ c #C33E52", "w@ c #C14155", "x@ c #BF4358", "y@ c #BD455C", "z@ c #BB475F", "A@ c #B94961", "B@ c #B74B64", "C@ c #B54C66", "D@ c #B34D68", "E@ c #B04F6B", "F@ c #AE4F6C", "G@ c #AC506E", "H@ c #A95170", "I@ c #A65272", "J@ c #A35273", "K@ c #A05274", "L@ c #9D5376", "M@ c #905C85", "N@ c #8E5E87", "O@ c #8A5F8A", "P@ c #87608C", "Q@ c #84618F", "R@ c #7E6494", "S@ c #7A6799", "T@ c #77689B", "U@ c #D92832", "V@ c #D82A35", "W@ c #C83647", "X@ c #C6394B", "Y@ c #C53D4F", "Z@ c #C33F53", "`@ c #C14257", " # c #C0445A", ".# c #BE475D", "+# c #BC4961", "@# c #BA4B63", "## c #B84D66", "$# c #B64F69", "%# c #B4506B", "&# c #B2526D", "*# c #AF536F", "=# c #AD5471", "-# c #AB5473", ";# c #A85574", "># c #A55576", ",# c #A25678", "'# c #9F5679", ")# c #9C567A", "!# c #925B82", "~# c #8C5F8A", "{# c #88618D", "]# c #86628F", "^# c #826392", "/# c #7F6494", "(# c #796799", "_# c #756A9E", ":# c #D72A35", "<# c #D52C38", "[# c #CC3342", "}# c #C83747", "|# c #C63A4B", "1# c #C53D50", "2# c #C34054", "3# c #C24358", "4# c #C0455B", "5# c #BE485F", "6# c #BC4B62", "7# c #BB4D65", "8# c #B94F68", "9# c #B7516B", "0# c #B5536E", "a# c #B35470", "b# c #B05672", "c# c #AE5774", "d# c #AD5876", "e# c #AA5878", "f# c #A75979", "g# c #A4597A", "h# c #A15A7C", "i# c #9E5A7D", "j# c #9B5A7E", "k# c #975A80", "l# c #945A81", "m# c #915B83", "n# c #8B5F8A", "o# c #89618D", "p# c #86638F", "q# c #846492", "r# c #806594", "s# c #7D6697", "t# c #77689C", "u# c #726CA1", "v# c #C63A4C", "w# c #C34154", "x# c #C0465C", "y# c #BE4960", "z# c #BD4C64", "A# c #BB4F67", "B# c #BA516A", "C# c #B8536D", "D# c #B65570", "E# c #B45772", "F# c #B25975", "G# c #B05A77", "H# c #AD5B79", "I# c #AC5C7B", "J# c #A95C7C", "K# c #A65D7E", "L# c #A35D7F", "M# c #A05D80", "N# c #9D5D81", "O# c #9A5D82", "P# c #965D83", "Q# c #935D85", "R# c #905D86", "S# c #8D5E88", "T# c #826694", "U# c #7E6797", "V# c #7B6899", "W# c #78699C", "X# c #706DA3", "Y# c #DF212B", "Z# c #D62935", "`# c #C43D50", " $ c #C34155", ".$ c #C14459", "+$ c #C0475D", "@$ c #BF4A61", "#$ c #BD4D65", "$$ c #BC5068", "%$ c #BA536C", "&$ c #BA5870", "*$ c #B95C75", "=$ c #B85E79", "-$ c #B6607B", ";$ c #B4617D", ">$ c #B2627F", ",$ c #B06380", "'$ c #AD6280", ")$ c #A96080", "!$ c #A56082", "~$ c #A26183", "{$ c #9F6184", "]$ c #9C6185", "^$ c #996186", "/$ c #956187", "($ c #926088", "_$ c #8F6089", ":$ c #8B608B", "<$ c #866390", "[$ c #826695", "}$ c #7F6897", "|$ c #7D6999", "1$ c #796A9C", "2$ c #766B9E", "3$ c #6F6EA4", "4$ c #6D6FA6", "5$ c #DB2531", "6$ c #D82733", "7$ c #CE3140", "8$ c #C93445", "9$ c #C5394B", "0$ c #C14359", "a$ c #BF4B61", "b$ c #BD4E66", "c$ c #BC5169", "d$ c #BC566D", "e$ c #BC5B74", "f$ c #B95C77", "g$ c #B85D78", "h$ c #B65F79", "i$ c #B4617C", "j$ c #B2627E", "k$ c #AE6483", "l$ c #AC6686", "m$ c #AB6888", "n$ c #A76787", "o$ c #A26487", "p$ c #9E6488", "q$ c #9B6489", "r$ c #98648A", "s$ c #94648B", "t$ c #91638C", "u$ c #8D638D", "v$ c #8A638E", "w$ c #846592", "x$ c #816695", "y$ c #7D699A", "z$ c #7A6B9C", "A$ c #776C9F", "B$ c #746DA1", "C$ c #706EA4", "D$ c #6B71A9", "E$ c #DA2531", "F$ c #D82633", "G$ c #C43C4F", "H$ c #C24054", "I$ c #C14358", "J$ c #BE4A61", "K$ c #BC516A", "L$ c #BD586F", "M$ c #BB5B76", "N$ c #BA5C76", "O$ c #B95F78", "P$ c #B8617B", "Q$ c #B6637E", "R$ c #B56580", "S$ c #B36783", "T$ c #B16885", "U$ c #AF6986", "V$ c #AC6988", "W$ c #A96989", "X$ c #A66A8D", "Y$ c #A56B8D", "Z$ c #9E688C", "`$ c #9A678D", " % c #96678E", ".% c #93678F", "+% c #906690", "@% c #8C6691", "#% c #886692", "$% c #846593", "%% c #786C9F", "&% c #756EA2", "*% c #726FA4", "=% c #6E6FA7", "-% c #6872AB", ";% c #D62836", ">% c #D32B39", ",% c #D02F3E", "'% c #C33B4E", ")% c #C23F53", "!% c #C04358", "~% c #BF465C", "{% c #BA5D76", "]% c #B96079", "^% c #B9637D", "/% c #B96680", "(% c #B96883", "_% c #B86A86", ":% c #B66C88", "<% c #B46D8A", "[% c #B06D8B", "}% c #AD6D8C", "|% c #AA6D8D", "1% c #A66D8E", "2% c #A26D91", "3% c #A06E92", "4% c #996A91", "5% c #956A91", "6% c #926992", "7% c #8F6993", "8% c #8B6994", "9% c #876895", "0% c #826896", "a% c #7F6898", "b% c #7C699A", "c% c #7A6B9D", "d% c #786D9F", "e% c #766EA2", "f% c #7370A4", "g% c #7070A7", "h% c #6C71A9", "i% c #6873AC", "j% c #6674AE", "k% c #D32A39", "l% c #D12D3B", "m% c #CF2F3E", "n% c #C13E52", "o% c #C04256", "p% c #BE455B", "q% c #BD4960", "r% c #BC4D65", "s% c #BB5069", "t% c #BB566E", "u% c #BA6079", "v% c #BA647E", "w% c #BB6882", "x% c #BD6B86", "y% c #BD6E89", "z% c #BE708C", "A% c #BC718E", "B% c #B9728F", "C% c #B57290", "D% c #B07191", "E% c #AC7191", "F% c #A67092", "G% c #A26F93", "H% c #9E7096", "I% c #9B7095", "J% c #946D95", "K% c #916C96", "L% c #8D6C96", "M% c #896B97", "N% c #856B98", "O% c #816A99", "P% c #7D6A9B", "Q% c #766FA2", "R% c #7470A4", "S% c #7172A7", "T% c #6E72A9", "U% c #6A73AC", "V% c #6376B1", "W% c #D02C3B", "X% c #CF2E3E", "Y% c #C03C50", "Z% c #BF4055", "`% c #BE445A", " & c #BC485F", ".& c #BB4C63", "+& c #BA4F68", "@& c #BA536D", "#& c #BB5C75", "$& c #B95C76", "%& c #B9607A", "&& c #BC6882", "*& c #BF6C87", "=& c #C1708B", "-& c #C5778F", ";& c #C97D92", ">& c #C77F94", ",& c #C27C95", "'& c #BB7896", ")& c #B47696", "!& c #AE7596", "~& c #A87496", "{& c #A27396", "]& c #9D7297", "^& c #9B739A", "/& c #947098", "(& c #906F99", "_& c #8C6E9A", ":& c #886E9B", "<& c #836D9B", "[& c #7F6D9C", "}& c #7B6C9D", "|& c #776D9F", "1& c #7470A5", "2& c #6F73AA", "3& c #6C74AC", "4& c #6875AE", "5& c #6476B1", "6& c #6178B3", "7& c #D02C3C", "8& c #CE2E3E", "9& c #CC3041", "0& c #C4384A", "a& c #BD4259", "b& c #BB465E", "c& c #BA4A62", "d& c #B94E67", "e& c #B8526B", "f& c #B95870", "g& c #B95D78", "h& c #B85F79", "i& c #C3738C", "j& c #CD8091", "k& c #D18695", "l& c #D18998", "m& c #D08A9B", "n& c #CE8A9B", "o& c #C9879B", "p& c #BB7D9B", "q& c #B1799A", "r& c #AA779A", "s& c #A37699", "t& c #9C759A", "u& c #98749C", "v& c #95759C", "w& c #8E719C", "x& c #8A709D", "y& c #86709E", "z& c #826F9F", "A& c #7D6FA0", "B& c #796FA1", "C& c #7370A5", "D& c #6C75AC", "E& c #6A76AF", "F& c #6677B1", "G& c #6278B4", "H& c #5E79B6", "I& c #CE2D3E", "J& c #CA3243", "K& c #C83446", "L& c #C4384B", "M& c #BF3C50", "N& c #BB4157", "O& c #BA445C", "P& c #B94861", "Q& c #B84C65", "R& c #B7506A", "S& c #B7546F", "T& c #B85D76", "U& c #B65E79", "V& c #B7627C", "W& c #B96681", "X& c #BC6B86", "Y& c #C1718B", "Z& c #D28897", "`& c #D991A0", " * c #DE98A9", ".* c #DE9AAB", "+* c #D895A6", "@* c #CE8EA1", "#* c #C88A9F", "$* c #B57E9E", "%* c #AC7A9D", "&* c #A3789D", "** c #9C779D", "=* c #96769E", "-* c #9578A1", ";* c #8D739F", ">* c #8873A0", ",* c #8472A0", "'* c #8072A2", ")* c #7B71A3", "!* c #7771A4", "~* c #6F74AA", "{* c #6A77AF", "]* c #6778B1", "^* c #6379B4", "/* c #607AB7", "(* c #5C7BB9", "_* c #C93143", ":* c #C63648", "<* c #BD3D53", "[* c #B9425A", "}* c #B74A63", "|* c #B64E68", "1* c #B5526D", "2* c #B55672", "3* c #B75F7A", "4* c #B5607B", "5* c #B6647F", "6* c #B86984", "7* c #C5788F", "8* c #E4A1B2", "9* c #ECB7C4", "0* c #ECBAC7", "a* c #E4A8BA", "b* c #D898AB", "c* c #CB8EA3", "d* c #BC86A2", "e* c #AD7DA1", "f* c #A47BA0", "g* c #9B79A0", "h* c #9578A0", "i* c #9379A4", "j* c #8C76A2", "k* c #8675A3", "l* c #8274A3", "m* c #7E73A4", "n* c #7973A5", "o* c #7573A6", "p* c #7172A8", "q* c #6E74AA", "r* c #6C75AD", "s* c #6878B2", "t* c #6579B4", "u* c #617BB7", "v* c #5D7BB9", "w* c #597DBC", "x* c #C73346", "y* c #C3384B", "z* c #C23A4E", "A* c #BA3F55", "B* c #B84158", "C* c #B7445D", "D* c #B64862", "E* c #B35874", "F* c #B5617C", "G* c #B3627D", "H* c #B46682", "I* c #B76B87", "J* c #BD708C", "K* c #C87E93", "L* c #D18999", "M* c #F9E0E6", "N* c #FAE6EB", "O* c #EEC2CE", "P* c #DDA1B5", "Q* c #CC91A8", "R* c #C18BA5", "S* c #AE7FA3", "T* c #A37DA2", "U* c #9A7BA2", "V* c #937AA3", "W* c #917BA6", "X* c #8B78A4", "Y* c #8476A5", "Z* c #8076A6", "`* c #7C75A7", " = c #7775A8", ".= c #7375A9", "+= c #6778B2", "@= c #657AB4", "#= c #627BB7", "$= c #5F7CB9", "%= c #5B7DBC", "&= c #577EBE", "*= c #C3374B", "== c #C13A4E", "-= c #BF3C51", ";= c #BD3E53", ">= c #B6425B", ",= c #B4465F", "'= c #B34A64", ")= c #B24E69", "!= c #B2526E", "~= c #B15672", "{= c #B15A77", "]= c #B3627F", "^= c #B16380", "/= c #B26784", "(= c #B66D89", "_= c #BB728F", ":= c #C77F95", "<= c #D08B9B", "[= c #FBEBF0", "}= c #EEC6D1", "|= c #DDA2B7", "1= c #CC93AA", "2= c #BF8CA7", "3= c #AC81A6", "4= c #A17FA5", "5= c #987DA5", "6= c #927BA5", "7= c #8F7CA8", "8= c #8879A7", "9= c #8278A8", "0= c #7E78A9", "a= c #7977AA", "b= c #7576AB", "c= c #7176AC", "d= c #6C76AD", "e= c #6977AF", "f= c #6779B2", "g= c #627CB7", "h= c #607DBA", "i= c #5C7EBC", "j= c #587FBF", "k= c #5580C1", "l= c #C2364B", "m= c #C0394E", "n= c #BF3B51", "o= c #BC3E53", "p= c #B3435D", "q= c #B24762", "r= c #B14B66", "s= c #AF5370", "t= c #AE5775", "u= c #AE5B79", "v= c #B16381", "w= c #AF6482", "x= c #B06986", "y= c #B36D8B", "z= c #B87290", "A= c #C17D96", "B= c #CE8A9C", "C= c #D895A7", "D= c #E5AFC2", "E= c #D79DB2", "F= c #C891AA", "G= c #BA8AA8", "H= c #A981A7", "I= c #9F80A7", "J= c #967EA7", "K= c #907DA8", "L= c #8D7EAB", "M= c #857AA9", "N= c #8079AA", "O= c #7B79AB", "P= c #7778AC", "Q= c #7378AD", "R= c #6E78AE", "S= c #6A77B0", "T= c #657AB5", "U= c #607EBA", "V= c #5D7EBC", "W= c #5A80BF", "X= c #5681C1", "Y= c #5282C4", "Z= c #BC3D53", "`= c #B14560", " - c #AF4864", ".- c #AE4C69", "+- c #AE506D", "@- c #AD5472", "#- c #AD5877", "$- c #AD6585", "%- c #AD6988", "&- c #AF6E8C", "*- c #B37391", "=- c #BA7896", "-- c #C8889C", ";- c #CE8EA2", ">- c #DDA3B7", ",- c #CC95AC", "'- c #C390AA", ")- c #AF84A9", "!- c #A481A8", "~- c #9A80A8", "{- c #937FA9", "]- c #8D7DAA", "^- c #8B7FAD", "/- c #827BAB", "(- c #7D7BAC", "_- c #787AAD", ":- c #757AAE", "<- c #7079B0", "[- c #6C79B1", "}- c #647AB5", "|- c #627CB8", "1- c #5D7FBD", "2- c #5B80BF", "3- c #5781C1", "4- c #5382C4", "5- c #5083C6", "6- c #BC3A51", "7- c #BB3C54", "8- c #BA3E56", "9- c #B74158", "0- c #AE4662", "a- c #AD4966", "b- c #AC4E6B", "c- c #AC5270", "d- c #AB5574", "e- c #AA5979", "f- c #AA5D7D", "g- c #AB6482", "h- c #AB6788", "i- c #AB6A89", "j- c #AC6E8E", "k- c #AF7292", "l- c #B37797", "m- c #BA7E9C", "n- c #C78AA0", "o- c #CB8EA4", "p- c #CC92A8", "q- c #C892AA", "r- c #B387AA", "s- c #A882AA", "t- c #9E81AA", "u- c #9580AA", "v- c #8F7FAA", "w- c #8A7EAC", "x- c #8880AD", "y- c #7E7CAD", "z- c #7A7CAE", "A- c #767BB0", "B- c #727BB1", "C- c #6D7BB2", "D- c #697BB3", "E- c #647BB5", "F- c #5F7EBA", "G- c #5B81BF", "H- c #5882C2", "I- c #5583C4", "J- c #5184C7", "K- c #4D85C9", "L- c #BC3951", "M- c #BA3B54", "N- c #B74059", "O- c #B3435E", "P- c #AE4663", "Q- c #AC4865", "R- c #AB4B68", "S- c #AA4F6D", "T- c #A95372", "U- c #A85676", "V- c #A75A7B", "W- c #A75E7F", "X- c #A76283", "Y- c #A96A8A", "Z- c #A76A8B", "`- c #A86E8F", " ; c #AA7293", ".; c #AD7697", "+; c #B07A9B", "@; c #B57F9F", "#; c #BC87A3", "$; c #C08BA5", "%; c #BA8AA9", "&; c #A782AA", "*; c #9F81AA", "=; c #9781AB", "-; c #9180AB", ";; c #8B80AC", ">; c #8981AF", ",; c #827EAE", "'; c #7B7DAF", "); c #777DB0", "!; c #737CB2", "~; c #6F7CB3", "{; c #6A7CB4", "]; c #667CB6", "^; c #5D80BD", "/; c #5982C2", "(; c #5683C4", "_; c #5284C7", ":; c #4E85C9", "<; c #4A87CC", "[; c #B73D56", "}; c #B63F59", "|; c #B4425B", "1; c #A84C6B", "2; c #A7506F", "3; c #A65373", "4; c #A55778", "5; c #A45B7C", "6; c #A45E80", "7; c #A36285", "8; c #A56889", "9; c #A56B8F", "0; c #A46E90", "a; c #A57193", "b; c #A77597", "c; c #A9789B", "d; c #AB7B9F", "e; c #AD7EA2", "f; c #AD80A4", "g; c #AC81A7", "h; c #A981A8", "i; c #A481A9", "j; c #9D81AA", "k; c #9281AC", "l; c #8C80AD", "m; c #8880AF", "n; c #8681B0", "o; c #7C7EB0", "p; c #787EB1", "q; c #747EB2", "r; c #707DB4", "s; c #6C7DB5", "t; c #677DB7", "u; c #627DB8", "v; c #5F7EBB", "w; c #5B81C0", "x; c #5385C7", "y; c #4F86C9", "z; c #4B87CC", "A; c #4789CF", "B; c #B73D57", "C; c #B53E59", "D; c #B3415C", "E; c #B1435E", "F; c #A45071", "G; c #A35475", "H; c #A25879", "I; c #A15B7E", "J; c #A05F82", "K; c #A06286", "L; c #9F668A", "M; c #A26D8F", "N; c #A06E93", "O; c #A07195", "P; c #A07498", "Q; c #A1779B", "R; c #A2799E", "S; c #A37CA1", "T; c #A27EA4", "U; c #A17FA6", "V; c #9E80A8", "W; c #9981A9", "X; c #9181AC", "Y; c #8782B1", "Z; c #7E7FB1", "`; c #797FB2", " > c #757FB3", ".> c #717EB5", "+> c #6D7EB6", "@> c #687EB7", "#> c #647EB9", "$> c #5783C5", "%> c #5485C7", "&> c #5087CA", "*> c #4C87CC", "=> c #4889CF", "-> c #458AD1", ";> c #B53F59", ">> c #B2405C", ",> c #B0425E", "'> c #AF4461", ")> c #A15173", "!> c #A05577", "~> c #9F587B", "{> c #9E5C7F", "]> c #9D5F83", "^> c #9D6387", "/> c #9C668B", "(> c #9C698F", "_> c #9E7094", ":> c #9C7198", "<> c #9B7399", "[> c #9B769C", "}> c #9B789F", "|> c #9A7AA1", "1> c #997CA4", "2> c #977DA6", "3> c #957FA8", "4> c #927FAA", "5> c #8F80AB", "6> c #8B80AD", "7> c #8880B0", "8> c #8682B1", "9> c #7E80B1", "0> c #767FB4", "a> c #727FB5", "b> c #6D7FB6", "c> c #697FB8", "d> c #647FBA", "e> c #607FBB", "f> c #5C80BD", "g> c #5784C5", "h> c #5187CA", "i> c #4D88CC", "j> c #4989CF", "k> c #458BD2", "l> c #428CD4", "m> c #AE4461", "n> c #AC4663", "o> c #9C5579", "p> c #9C597D", "q> c #9B5C81", "r> c #9A5F85", "s> c #996389", "t> c #98668C", "u> c #976990", "v> c #976C93", "w> c #997197", "x> c #99759C", "y> c #96759E", "z> c #9577A0", "A> c #9379A2", "B> c #917CA7", "C> c #8F7DA9", "D> c #8C7EAA", "E> c #897FAD", "F> c #8881B0", "G> c #8582B1", "H> c #7D7FB1", "I> c #797FB3", "J> c #757FB4", "K> c #6E80B7", "L> c #6A7FB8", "M> c #6580BA", "N> c #6180BC", "O> c #5D80BE", "P> c #5982C3", "Q> c #5684C5", "R> c #5485C8", "S> c #4E88CC", "T> c #4A8ACF", "U> c #468BD2", "V> c #408ED7", "W> c #B0425F", "X> c #AD4361", "Y> c #AB4564", "Z> c #A94766", "`> c #A84969", " , c #A64C6B", "., c #99567A", "+, c #98597E", "@, c #975C82", "#, c #966086", "$, c #95638A", "%, c #94668E", "&, c #946991", "*, c #936C94", "=, c #926E98", "-, c #92719A", ";, c #94769E", ">, c #9479A2", ",, c #927AA5", "', c #8E7DAA", "), c #8C7FAC", "!, c #8A80AE", "~, c #8780AE", "{, c #817FAF", "], c #7C7EB1", "^, c #787FB2", "/, c #727FB6", "(, c #6A80B9", "_, c #6680BA", ":, c #5882C3", "<, c #5287CA", "[, c #4E88CD", "}, c #4B8ACF", "|, c #478BD2", "1, c #438CD4", "2, c #3D8FD9", "3, c #AD4461", "4, c #A74969", "5, c #A54B6B", "6, c #A44D6E", "7, c #955980", "8, c #945D84", "9, c #936087", "0, c #92638B", "a, c #91668F", "b, c #906992", "c, c #906C96", "d, c #8F6E99", "e, c #8D709C", "f, c #8C739E", "g, c #8B75A1", "h, c #8A77A4", "i, c #8979A6", "j, c #877AA8", "k, c #847BAB", "l, c #807CAD", "m, c #7D7DAF", "n, c #7A7EB1", "o, c #777EB2", "p, c #717FB5", "q, c #6D80B7", "r, c #6580BB", "s, c #6181BC", "t, c #5D81BE", "u, c #5A81C1", "v, c #4F89CD", "w, c #4B8AD0", "x, c #488BD2", "y, c #438CD5", "z, c #3D90D9", "A, c #3B91DC", "B, c #A64969", "C, c #A44A6C", "D, c #A24C6E", "E, c #A14E71", "F, c #9F5173", "G, c #905D85", "H, c #906089", "I, c #8F638C", "J, c #8E6690", "K, c #8D6893", "L, c #8C6B97", "M, c #8A6E9A", "N, c #89709D", "O, c #8872A0", "P, c #8674A2", "Q, c #8278A7", "R, c #8079A9", "S, c #7E7BAC", "T, c #7B7CAE", "U, c #797DB0", "V, c #767EB2", "W, c #747EB4", "X, c #707FB6", "Y, c #6980B9", "Z, c #5684C6", "`, c #5386C8", " ' c #5187CB", ".' c #4C8AD0", "+' c #488CD2", "@' c #448DD5", "#' c #3D90DA", "$' c #3B91DD", "%' c #9E5073", "&' c #9C5276", "*' c #98567B", "=' c #8C608A", "-' c #8B638E", ";' c #8A6691", ">' c #896894", ",' c #876B98", "'' c #866D9B", ")' c #85709E", "!' c #8372A1", "~' c #7E77A8", "{' c #7C79AB", "]' c #797AAD", "^' c #777BAF", "/' c #757CB1", "(' c #727DB3", "_' c #6F7EB5", ":' c #6C7FB7", "<' c #6880B9", "[' c #6181BD", "}' c #5883C3", "|' c #4C8BD0", "1' c #488CD3", "2' c #458DD5", "3' c #418ED7", "4' c #9C4F73", "5' c #9B5176", "6' c #995378", "7' c #98557B", "8' c #96577E", "9' c #925B83", "0' c #89618C", "a' c #87638F", "b' c #866692", "c' c #846896", "d' c #836B99", "e' c #826D9C", "f' c #806F9F", "g' c #7F72A2", "h' c #7D73A4", "i' c #7B75A7", "j' c #737BB1", "k' c #707CB3", "l' c #6D7DB5", "m' c #6A7EB7", "n' c #677FB8", "o' c #6380BB", "p' c #6080BD", "q' c #5C81BF", "r' c #5883C4", "s' c #5584C6", "t' c #498CD3", "u' c #458ED5", "v' c #418ED8", "w' c #985279", "x' c #96547B", "y' c #95577E", "z' c #935980", "A' c #8E5E88", "B' c #806897", "C' c #7F6A9A", "D' c #7D6D9D", "E' c #7C6FA0", "F' c #7A71A3", "G' c #7873A6", "H' c #7577AB", "I' c #717AB0", "J' c #6E7BB2", "K' c #6B7CB4", "L' c #697DB6", "M' c #657EB8", "N' c #627FBA", "O' c #5F80BC", "P' c #5386C9", "Q' c #5188CB", "R' c #4E89CE", "S' c #418FD8", "T' c #3E90DA", "U' c #925880", "V' c #905A83", "W' c #8F5C85", "X' c #8B608A", "Y' c #7B6B9C", "Z' c #796D9F", "`' c #776FA1", " ) c #7671A4", ".) c #7573A7", "+) c #7375AA", "@) c #6E78AF", "#) c #647DB8", "$) c #5E7FBD", "%) c #5A81C2", "&) c #5783C4", "*) c #5585C6", "=) c #5088CB", "-) c #4C8BD1", ";) c #498DD3", ">) c #458ED6", ",) c #8D5B86", "') c #8B5D88", ")) c #766EA1", "!) c #756FA3", "~) c #7271A6", "{) c #7073A9", "]) c #6E75AB", "^) c #6C76AE", "/) c #6978B0", "() c #6779B3", "_) c #5585C7", ":) c #5088CC", "<) c #4B8BD1", "[) c #488DD3", "}) c #3E90DB", "|) c #8A5C88", "1) c #885E8B", "2) c #86608D", "3) c #856290", "4) c #836492", "5) c #6D74AB", "6) c #6B76AE", "7) c #6679B3", "8) c #5286C9", "9) c #875E8B", "0) c #855F8D", "a) c #836290", "b) c #826493", "c) c #806595", "d) c #7E6898", "e) c #7271A7", "f) c #6F73A9", "g) c #6D75AC", "h) c #6878B1", "i) c #4D8ACE", "j) c #4A8BD1", "k) c #478DD4", "l) c #448ED6", "m) c #418FD9", "n) c #3D91DB", "o) c #826190", "p) c #806393", "q) c #7E6595", "r) c #7C6798", "s) c #7B699A", "t) c #796A9D", "u) c #647BB6", "v) c #617CB8", "w) c #4F88CC", "x) c #4D8ACF", "y) c #438ED6", "z) c #408FD9", "A) c #7D6595", "B) c #79689A", "C) c #776A9D", "D) c #766C9F", "E) c #746DA2", "F) c #7071A7", "G) c #6E73AA", "H) c #6A76AE", "I) c #617DB8", "J) c #5C80BE", "K) c #4C8ACF", "L) c #498BD2", "M) c #468DD4", "N) c #438ED7", "O) c #3F8FD9", "P) c #3C91DB", "Q) c #91567F", "R) c #8F5882", "S) c #816190", "T) c #7D6596", "U) c #78689B", "V) c #76699D", "W) c #746BA0", "X) c #726CA2", "Y) c #706FA4", "Z) c #6E71A7", "`) c #6D72AA", " ! c #6B74AC", ".! c #6976AF", "+! c #6777B1", "@! c #637BB6", "#! c #5E7EBB", "$! c #5C7FBE", "%! c #5A81C0", "&! c #5584C5", "*! c #5385C8", "=! c #4D88CD", "-! c #458CD4", ";! c #3C91DC", ">! c #8A5B87", ",! c #75699D", "'! c #736BA0", ")! c #716DA2", "!! c #6F6EA5", "~! c #6C70A7", "{! c #6B71AA", "]! c #6973AC", "^! c #6775AF", "/! c #6577B1", "(! c #617AB6", "_! c #5D7EBB", ":! c #5B7FBE", " , ' ) ! ~ { ] ^ / ( _ : < [ } | 1 2 3 4 5 6 7 8 9 0 a b c d e f g ", ". . . . . h i j k % l * = - m > n ' o ! p { q r s t u v < w } x y 2 z 4 5 6 7 8 A 0 B C c d e f D E ", ". . . . h F j k % G * H - m > n I J K p L M N s O P Q R S T U V W X 4 Y Z 7 ` A .B C c ..+.@.D E #.", ". . . $.F j k %.&.*.H =.m -.n ;.>.K ,.'.).!.~.{.].^.R /.(._.:.<.[.}.|.1.7 2.A 3.4.5.6...+.@.7.8.#.9.", ". . 0.F a.b.c.&.d.H e.f.-.g.h.>.i.j.k.l.m.n.o.p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A)k@B)C)D)E)*%F)G)g)H)h)7)u)I)v;J)w;/;Q>%>h>w)K)L)M)N)O)P)$'$'$'$'$'$'$'$'$'$'$'", "Q)R)O+P+l+#+5+S)S+T)k@U)V)W)X)Y)Z)`) !.!+!t*@!v)#!$!%!:,&!*!&>=!},x,-!3'O);!$'$'$'$'$'$'$'$'$'$'$'$'", "R)O+>!l+m+Q+R+S+~@k@U),!'!)!!!~!{!]!^!/!^*(!$=_!:!U>1,3'3!;!$'$'$'$'$'$'$'$'$'$'$'$'$'", "4!>!l+!@Q+R+j@~@5!U)6!'!)!7!8!9!0!a!V%b!c!v*%=d!e!f!g!h!i!j!=>k>k!V>#'A,$'$'$'$'$'$'$'$'$'$'$'$'$'$'", "l!m!n!Q+R+R@~@S@T@_#'!X#7!8!9!0!a!o!p!q!(*w*&=k=r!5-s!t!u!v!w!k!x!#'A,$'$'$'$'$'$'$'$'$'$'$'$'$'$'$'"}; php-4.4.8/ext/gd/tests/xpm2jpg.phpt0000644000175000017500000000122010160300531016402 0ustar derickderick--TEST-- xpm --> jpeg conversion test --SKIPIF-- --FILE-- --EXPECT-- XPM to JPEG conversion: ok php-4.4.8/ext/gd/tests/conv_test.jpeg0000644000175000017500000000441507573467176017043 0ustar derickderickÿØÿàJFIFHHÿÛC    $.' ",#(7),01444'9=82<.342ÿÛC  2!!22222222222222222222222222222222222222222222222222ÿÀ"ÿÄÿÄ&!1QA"aqR‘ÿÄÿÄ!ÿÚ ?ü¢I®]ž’iíâÒEAª(¬!Ö¨¤°‡Z¢Ž–kTVšÒÂj4t´t°‡Z£¢ZÔ¥¥„.©%„:ÕVkTRXC­QEaµE:ÔVëWŽV‹TºrÑIaµE„ZÕt°‡Z­-5"‚j$2 Âj4tJÂQ£¢–kU£¤VëU¥¢–:­-¢.¬èèèéaµd":ÕVëTRXE­QEaµxå¨OÖ ¢°‡Z¢Ž–ëU#ZR(!ÖªBŠÂ-jŠ+uªÑGKA::XC­AZ: C­AZ:XDê´QXDê–ŠXC­V–‰ÒÂjÎ‰Ò E­AEaµE:Õã¤Z˜]?Z¢ŒXC­TH¤:XC­T(¨!Ö¨£!jŒ†Fæ+µ«3¦-HÔ‹5«:o©ê°‹Z±Õut꺬!Ö®}OWN«KÝ\´[ÐÒÂ'VIÒXC­QEaµZihµd":Õ–ëWŽQjat÷U‚F¤XC­T(¬!Ö¨£"Âj¤nE#r,!ÖªF¤27! j&-LLŹŠÂjÄÅ®®“ŽßÃSŠÿKu«SÕÛö¯ô?nÏ‚'W.£«¯QÕa«ž†4,XFêå`Ó­Œè«%h¬"Ö©h¥„:Ôi5 @‡Z¤RÂjñÌF5@ºvµ2¤*uª(¬"Ö«MÈ$nE„:ÔÈÜ‚GIkS#RpÂIº°ƒZŒx÷æøŽ“SÔ^kS„:Ôy««¤Å©‚ˆ–åÔÉc¯EÕdKsñ}ÆrãüÏ1ר՞–-ÂÆl}cÚn{r±aµs±›lfÅ„N®V&ìgDµ¨(¬!Ö«H¥„:Õ¤@‡Z¼sP.­L*:Õh¢°‹Z™$gé! jÖ1ÒFqŽ˜Å„Õ¾eÊy¯‡››ëУ0_?%ó•ú;?uösç×»ó}¾«èóÍš¹dç]2s¾Ï’ù5«9úŽUדÛ.Hu«šÕf!uf¤HkT‘XE­B µxí@cT §kS …AµF(Vºµ‹¤s޵tŽ˜¹âéi»û’·sã¿‹ùnxºPD·|k¶ióc]qÉï(ú½>yd™ë¾<ŸYËþ¼¹“¤Ïûyñy÷z7’þs‘Ë>|q—¯›öøûß±rQçF½-g·uË*®LZ`¾mî+3Þþ•óFwSP¡|úÕÏ+ºÍj³HkVk5ªÅ E­AHµE"ZÕˆkWŽb-P.­L"5:¢ŠÂj£¤a¨°‡ZºGHç‹u«¤®ØÞÓWÛ„­Ê ‰ÕÞn5+ž9øÕnOª ‰ÕÒdÜÉÇvTf7W^˳žÖÖf-jݬïk_~ÎOaµ6õŸÛªÖij«4Öij+4Ô@ƒZ‚‰'TŠXC­BDµxé¨NÖ¦#Qa ©*ZÔŠÂ-jÔnV#R¬!Óu•©\ånU„+t•©tç+R¨"uvœ•®óéÆSµ„N®½çüWîW=­¨ÌZÕ»•¾ÆÙÚÙ-jvÆÖëSk5ZëT‘ BêŠ+µ¨D Ö¨¤@…{xå¦NÖ¨ÄVº˜Dj,"Ö¨¢ ‰Õ‰jenV PDêé+R¹ÊÔ«u«{;bS*Â-jÞÎØÙÚÂ'V¶¶ÎÖÖëSµ±´@‡Z¤ŠÂ'TQXC­RHµI"+ÚI=¦òJ-X.•­AEa ª°‹Zµ†("u%D°‡Z¢ŠÂ-jŠ+uª;EaµD„.¨¢°‰Õ$VkTQ C­RIaµI"+ÚI=¦’L²òÊMd.‰­QEaµE„:Õ Â-jÔ1–¢Â'RAXDêH1Aµ$„ZÕHëT‘XDêŠKu©@!Ö©$°‰{I'´ÒI–RI–^aE®¿kTQ C­R)aµE„ZÕVëT`+Ia © ¬"Ö¤„°‡Z’ ÂjŠKµª),"^ÒIíå$™e$™e$™eÿÙphp-4.4.8/ext/gd/tests/bug28984.phpt0000644000175000017500000000115210164703713016230 0ustar derickderick--TEST-- Bug #28984 (imagefill segfault using a transparent color). --SKIPIF-- --FILE-- --EXPECT-- Done php-4.4.8/ext/gd/tests/createfromwbmp2.phpt0000644000175000017500000000213610574526535020150 0ustar derickderick--TEST-- imagecreatefromwbmp with invalid wbmp --SKIPIF-- --FILE-- "); } //write header $c = 0; fputs($fp, chr($c), 1); fputs($fp, $c, 1); //write width = 2^32 / 4 + 1 $c = 0x84; fputs($fp, chr($c), 1); $c = 0x80; fputs($fp, chr($c), 1); fputs($fp, chr($c), 1); fputs($fp, chr($c), 1); $c = 0x01; fputs($fp, chr($c), 1); /*write height = 4*/ $c = 0x04; fputs($fp, chr($c), 1); /*write some data to cause overflow*/ for ($i=0; $i<10000; $i++) { fwrite($fp, chr($c), 1); } fclose($fp); $im = imagecreatefromwbmp($filename); unlink($filename); ?> --EXPECTF-- Warning: imagecreatefromwbmp() [/phpmanual/function.imagecreatefromwbmp.html]: gd warning: product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully in %s on line %d Warning: imagecreatefromwbmp() [/phpmanual/function.imagecreatefromwbmp.html]: '%s' is not a valid WBMP file in %s on line %d php-4.4.8/ext/gd/tests/jpg2gd.phpt0000644000175000017500000000231210160300531016173 0ustar derickderick--TEST-- jpeg <--> gd1/gd2 conversion test --SKIPIF-- --FILE-- --EXPECT-- JPEG to GD1 conversion: ok JPEG to GD2 conversion: ok GD1 to JPEG conversion: ok GD2 to JPEG conversion: ok php-4.4.8/ext/gd/tests/gif2png.phpt0000644000175000017500000000121010160300530016345 0ustar derickderick--TEST-- gif --> png conversion test --SKIPIF-- --FILE-- --EXPECT-- GIF to PNG conversion: ok php-4.4.8/ext/gd/tests/xpm2png.phpt0000644000175000017500000000121010160300531016405 0ustar derickderick--TEST-- xpm --> png conversion test --SKIPIF-- --FILE-- --EXPECT-- XPM to PNG conversion: ok php-4.4.8/ext/gd/tests/bug38112.phpt0000644000175000017500000000063710456725164016227 0ustar derickderick--TEST-- Bug #38112 (GIF Invalid Code size ). --SKIPIF-- --FILE-- --EXPECTF-- Warning: imagecreatefromgif() [%s]: '%sbug38112.gif' is not a valid GIF file in %sbug38112.php on line %d php-4.4.8/ext/gd/tests/bug19366.phpt0000644000175000017500000000275010223750355016227 0ustar derickderick--TEST-- Bug #19366 (gdimagefill() function crashes (fixed in bundled libgd)) --SKIPIF-- --FILE-- --EXPECT-- Alive: create image Alive: Define colors Alive: Draw Alive: ImageString Alive: Send to browser Alive: Free resources Alive: Done php-4.4.8/ext/gd/tests/bug37346.gif0000644000175000017500000000004310427647767016032 0ustar derickderickGIF89a < ¿´°É, ÎÒ¶¼Ëµ¹ýÂ˲»ÑÏÁËphp-4.4.8/ext/gd/tests/bug24594.phpt0000644000175000017500000000550207707525713016237 0ustar derickderick--TEST-- Bug #24594 (Filling an area using tiles). --SKIPIF-- --FILE-- --EXPECT-- 000000111111101010 111111111111111111 php-4.4.8/ext/gd/tests/gif2gd.phpt0000644000175000017500000000137710160300530016171 0ustar derickderick--TEST-- gif --> gd1/gd2 conversion test --SKIPIF-- --FILE-- --EXPECT-- GIF to GD1 conversion: ok GIF to GD2 conversion: ok php-4.4.8/ext/gd/tests/bug37360.gif0000644000175000017500000020015610427647767016035 0ustar derickderickGIF89aK÷ÿÖÌÄÎÒÜÔÔÔ+w±òäÖÕÚäåÝ×±˜Žâ¾±ìáÖõçÙc¥ÕòõúöéÛêíö BsúúúÙÑËúëÝîòøÆÊÓÌÌÌȼ³ÊÍÔ¾ÂË÷îæÒÕÛÁÅÎÔǼ§«µÚÝä’–õõö£¹åÁ´j“²2‰ÉÈ´¬Ä§œÌ¹•™¨ßåñêÜÎâåëÈ­¢ñññÞâî²ÍÚÞéúóëOˆ²Is–¹½Å¦§¬»¡—ÈØä*ƒÆ¶ºÃ¯Ïçíííááá;kºÇÕ-f“ÄÄÄêêêåååëÒÅæéòݺ­ÞÞÞ²µ½ùúýÚÚÚ›¡¶öøûÑÖવÃþù󘞳¸«¥­±¹0»Õ½³ÊÎØÙÖÔëïøÓ²¦ãéóXixÂÇÑQ„¼¼¼ÞÙÕ¾³©t‡—ùöóäÖÊÌÆÁÚ·ªèçæ0„Æ—§éÎÁæÊ¼æÙÌûýþ»¿ÈéõéëõÖØÝÞàäé˽îïðÖµ©‡§¾ïÚÌæèêàÓÆ³²´«ÅÙçí÷ëéæÕâíþýúÏÉÄ ¨íÖÈÙÛßéëí´¼Ë³·Àáãæ$Qx,\„óóôÝáêïßÑ对ÆÈÎßåïãéõ¼´²šÅå4ÎÅËÙíï÷õóò-óõöíëé4‹Ëðîì2‹Ìöõó¶¹¾Ûáëçåã$m§–¢²äã✆~çîù¡¼ÑëíïÖÝçàÝÚßÛØýûúœ­º%}Àѹ¯ëíñéëñÍàïÙæña˜¨¯Á9˰®±ãåçâíöÁÀÀÛáíòÈ·œ±À¹µÏ¯£«ÀÛÝàØ´§°µÈ2ˆÆ¹·¸¥Ÿž€|ž©µÈÆÉ鯏2Î5Є¸ß=ŠÃÞåéÐÐÐ1=HáçñÿÿÿC”Îøæ×Ÿ²¿z¡¾ÂÜï]‚¡þï߬ÀΈ‘Ÿ5Ëõóö€„ãçóåéõåëõýýýáåñçë÷åë÷ýýÿáçóçëôýÿÿãçñ4‹Íÿÿýÿýýåçð/‡Èãçõìëíáåó½Òá’§·÷çÙ?…¹úéÙëíëÈÈÈûûýŠ °6“Õ»ÀÐóõóßëô×àç÷÷øÿÿÿ!ÿ NETSCAPE2.1!ù ÿ,ÿÿÿÿÿÿ H° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jÜȱ£Ç CŠI²¤É“(Sª\ɲ¥Ë—0cÊœI³¦Í›8sêÜɳ§ÏŸ@ƒ J´¨Ñ£H“*]Ê´©Ó§P£JJµªÕ«X³jÝʵ«×¯`ÊK¶¬Ù³hÓª]˶­Û·pãÊK·®Ý»xóêÝË·¯ß¿€ nøìÙàÈN̸±ãÇ#KžL¹²å˘3kÞ̹³çÏ C‹Mº´éÓ¨S«^ͺµë×°cËžM»¶íÛ¸sëÞÍ»·ïßÀƒ N¼¸ñãÈ“+_μ¹óçУKŸN½ºõëØ³kßν»÷ïàËÿO¾¼ùóèÓ«_Ͼ½û÷ðãËŸO¿¾ýûøóëßÏ¿¿ÿÿ ˆ2Áj(†"ÆÀxŒ0ÃóÈ0Â(xLcá:Ô’`ƒ}ñƒ‡>@ƒC&— ;eàÀ ì°XÆ4®,â]Œâ*:äÃNŠ$)$ —H ,ž¨2À KÜh× ñÄaŽ1i¥<ÐÃHŽÀ€“r©1Š4ßš"¿»ö0Â7w¥Æ°ÖRãÊ#Éæ iÞ¦ZÈsÅ€ÄÖ¢Ã3®\’°²ÙdÙo´!kõJ?H”™Ì#çf¬qÀén¼Ä¬<¯œÌ4¯¸²r¾e0üm5á ]•:Œ†Þ²'(ª‚O"#`‘`a÷©hÕøÂØ‘‰Ãii o£ŸSD1GýÀ|2À‡^$f` „„fP )$+™P†>0"ÃeHœ—‚„¼He2Æç‘€&̪ÿ$@ ˜p~€B5æ!Uà@ Ø0A ÊWÞõà_3lÊ TQ$  Ò`Öè„È`ñÃ.ÆPƒÌã~`±Q È ¸(‚!ü4©id±){€³`!3¤Ã?0ƒ !t!6(‚Ø€ @`ƒ&E€€1¬S(„ z0°ýQ)¼ØàŸdЉg,ã °†äA ð >…,lãEÀ%Dà @ÁcV8åR& ƒ6q éàAúà…0XCØB,lP¢ÒÈB0…y|¡kðPæRöðC8ý`Nx†?¾`ˆH› PAžaÿJPâY'‡i‚ÌíÒÒÔ¹”RÌ#P†ˆB:â‹fP¢ >c0 -BÅe šù,8ÍàW EÊ+d0©lÏàE(;$› Hlà…?Xc¸¶'BE0¥HYÂ(¬Xˆ5Ä@3pŠO H€ H.Ù€FÁH]Ê^0©DàiHÄ 2JUªjU»˜AÆ.ѱø1¬K©Åð‰gÄ@*°ƒ ÚŠÓ? @ˆ‡š·®Tb~xMÊ7ö ˆI8A£ À&¡QœÂa Àü óÐCAÉ0²HñGžÑª€@g³Z„ÿ˜à0@q€ƒT µLÁ„)ÀpÏÍ&€ª˜‚mÙpÓZ6aóx“  2à&åb¨ä‘Yœ6@8À.D€œÊãªUøÄzÐÑY×(ߨ0a¤A ø®N Pаô°âaˆ-õÊ”ïJ ìa¿&âº@8`Ûp ¬y­‘€\Lê®H°Pž #té€ì17ØB°@9%yS ã4À¨†]!&bŸ€Ax†)@À‡DèBm°*;Ø g¨±‘Û€5à£Á=æI*g ! àƒ˜±„r”à @X¤¦Ìf X#ÿ ¶B–qòŒ$4ø h3üÁ`‚fž€- ÐäÙ¶5¿ÝÕ°Ò 7ØhÎ1ù†vP˜ ¤ €Äp ˜Ù Ì8f‹èÌ n3NÀ@:Ò`.ŒRà LßC¶À³™à;P5°€íªO`‡ãN¹¸&ÀƒG¿:% ï3¾áF8£Ö™6…ðL„r´Á'Àª`„A‹b¢§L_œ€ÄðdzU²ƒ$†Ú×¾6¦[Àƒf{úÓHCwÍfÖ”Žo æm’gð@…¹G9œQ k×Ú d8$nær8k-¸È ë‹kÍÿf¸Hê<°i—#ÝÐB°Pk@ØÂÞ’èø§ÝÀyˆüØ@-Â*ÊTÁÕ*÷È7Ђ¨áåµfhÎ NO×ù§50êuÿ¼°Õƒ¹„ ï¤o$¾‡ˆ8Ôk]xãÚ.°þ­u{ ¾öyÁóKU:àr Ž„¹‚00³cä{vz9\à‚ks£9 9Å+ð6Ô½ãV(3ÄîÚ8Á¨J\ 9X¹øílÃCdézÆÓ)ÉÀŽ/@žqy'ùÅ öMàùDÀAWÆ. }K”TP½µü!€²»þõˆ=µií Ð m§9ÿøí1ŽÞk½ 3€€„!­ŠCmMpE$Ú°"0ÁnD˜ °p×çÏPÚ7kú¶¥ukðvÎ\°–g~f&xÏài+Ð pÌpÂð¡ Ø`RFŠ€WP kÀ àã`.<@ïUQgi'k´vmÝ€L€XÀÐ l' @w懅‘smàV`P J…J(° ‰Tc L0X@ð‚Ö\4¨“F,oúFTàƒ BØ ‘ º@0—g¨u’S€øÂ0[ EP°Ð 4àhæÿr6€Abd@,–F§o0u@Ð×FT }°m0py @,€ÖqmЂð‡€ÃÀ÷„Mg€&P @à kà`H,-P‰’H×l•viP{ùV mè kP{1׌A"¸ˆ€‡' DÇqŸV! O0‹J p‹YWÌ Œ@Tà ÃXt ÀcÇÈwv‡Bumè 9yÀQwÀN Û€ÀÞvÌ  •æm’p¿ ØPŽ€ˆ\ÐR¦Ÿ%€Œ ¨æò d’(ʈg.ƒ009ÿsTÐ ¥À…Z+òTN 5€àŠçgs`6¨¿ð(€³H…0À ƒ…S~· ýØv€9àæâwpþÐzó3¹)ƒµ¶0pmÒÈ¢€°u°À N@v€ œ€”ZçDp@PÌ@QÙ‘SùwÀ‰f‚W  ˜ˆ „Ð’-0„€ öVHà lé ÞÐŒ4× 9PЀRÿ_N€M~9wyIVàƒ•²ø‘ƒ· muîŠ×6r5@ -¹‹ànÐt ׫qÝpšµFSç Œ)ÿ@´p ³ ¹i~000•æ8 ÅPyPW‰MZµ 9~QÀy@~ÐrÖ S½ša–p£ù ÷p †ú À‚fy “ž'0™GŸÁO _Йh° Ÿ¨ƒŠè Þ 5{Ö’ 0iQ†ØS€]&{åÀ 9Àk™oþX{?ø“¨€]0 ™•5Yw}X¢Tˆ ÿPLÐÁ0’Cà ³0sùLÐ yp@tÄò X€t3Á óñ FpƒÏ0k¬ÙƒjØ…=Pq¥àõG)¢’ÿ iŽÁ`ÏpLP h~ǧÎk€>x À-ÉD@k)À£" 3iiÎÐ Ѐj؉=øšŽ–P› À‹P Þf~¯¸‘òù2(à ã¦Y"0-pšø‹è T€Ð’÷§œÀ ±™`qÈ–œ°Ú‰öIu - )ÖŸ€À !zy@¢S‰ ¡iÀݾ àŒÎ@oЃް~°Ä²Î uT  V-ð  pšÜ@œ0«ZŒ°vú¦à|pT0pæ' ‘ð¨TØ‘`¨ |ÿeXSð{’‹ð à4w³@iæ2Ü€0n\Ô×°¦ù§û§À k Ay1 •Q°„°UÚD ²•Tˆ–`€ 1 Q¶´ “ð T¢²þ >Xƒ°ei.iøƒG€µxµtAš­’—oø–ù–’›p Q³w—’˜ S•~ˆŸðOÐt*z` 逕EÿpP`o0sÒ8€ æRš—æ`} õ Ið·ß°x`q×Ö‰ —་ëZ €gmà˜ë{ë„wP ë ŸˆUP˜ÿ ¬ÕYh°³ÿ°›Pž³I.à à‹°{ær±µæ @ )Ug6* —¶ßY¼À¸¦„»°÷ËqV°4àUjfKèå0’ R ˆJð š@¦PÏ Er0 Ša#‡°ˆ.°žø h؟䲤#AVôë .™øªp¼y@à@ ý°§LZp >Á¯¸ÄIæ}H Äð‡äøÃa ”†³š… €„@Œ¤@‹@ NwªúƪwJ(G,þPnŒ°~ªÃÇ‹0º Q Ðm»†ð ‚¼–„LX@DÐ¥ÿ@ë Žø5`}z ¾XŒMŠñ à·ÿà•¤ Ë–àG 0,4qÀ°‹€°ÝàùªZ°€Ý@žQ ÕËÄf†È>hš)@L ë`’@g{ Ñ §àW³Ó&¬@À¦Ëˆ¤0 7þ ¿…á\xÃB ÿ‹Œ.@¥<H ¢®ÈÄm°¿J¶fˆ0š`oo‹SC MʇpÀ°ÓfÆú·ú;uʤpºƒ¥€ä,y° ˆÇ ‡Ðžð|~xhÆŒÁ‚p=³i ÌŒO° Üq@›ÐtÖ¢–ÿÊ ¤L:§§-PgŠšèØéÝÝ ±ZàÑçúðúpH¦ÔÇÜã¨Q– Ýcð½A6Jšù–Îìë €°Î7B„ý „BÈ^|m0pàÐJsÏ+ý ðýiPø±DpßuÍ  ‹J0?dзˆlc ºq¬-骵–ÙLP… 0u6m÷Pƒ°“×™èƒàÝ€²ÞPo H ‰¬›å°‘Q Tpfu½÷ˆ·`¬Ì ŽPÏ<„`´ÄrÜПŒà‰T°Í…âÍÆ€g4„µ žƒ³Lypì­âñíÈãÿ¨X¾å]n¢>0€©Îç qÞl‰§)¸0Aà¼gKÐ…9ðvþ¸çŒp~No P¾Ÿýió=‹O Èm½®Mð!U`lëhËû¤ÀÂ}šÝP¢+/<à〒ç@qk ~zžoGP Ԫꃞ¯p†®sàQˆ‘°í¬âÁÙâ¤ÝEl`Z:ßý·¬Èè¬ÍÞ}­KÐfŠV[¡{žÙÀر©µÎ‡¡=…0Pð»Æ òi¢œ`¬öäYWÐ Žh-k‡¤Ô)›s×* .€®Ù“kȸ.@.p­ b Ïdû”Jÿð L"]¢³¾²UXrÐá3 µzmrúë7Òâ[LðŒ@ÑâYk|m^Ùx@é ¡ˆ ð:gñù0Üy¸0‹ÁóÓ*Ð]‰0>_p-‰€C?žFß F¡Gðv.€ýõ6LŒÀ MKLp›m~VP‘ðêÞ‹XŠË –p©Y\æA›9ÓCŸoE?'ÏPÛ’`ÎxÎ ð}~{æ\Ô±Màâ˜`¯›çÐè³ø Éô-ñ `‚%`õ ñ ‹ æ¢Õ›ï  €7btÏ€¬©¤\ymUkáèM¾¿ÐûJM¯¥ÿ ß²Nhg`-}ù n-ÙÊùÆ ÷ë$<  ¥é ÓÎ ¢þvi½•rüäKšx°RÎàA„ &´IIˆQLøWñ_ 4øcBE!E†üváÙI”R8cÙ²%–AFΤYÓæMœ9uîäÙÓçO A…~«ðL’³R4°8ó¶C7gœ6°ÄÂd{B+æ9"©ÍB°aÛ´ùõ0b7BFH¤Q_§´Öyƒò¤,+]º„IKë_À&\ØpE2FžqÃBeÔn4˜,-µa©7 ⎴hÂ×°¡:@Â,DMÔ„dÖVc¢1U´–üf÷ÿ½X¸íusóaàÁ…'NüÛ,T¸½å ²Ô ,KiÜŒ`$M¨¬³ÒÝ»$+ E—“àtˆ'±ˆì¢¢F8ü%¥Øî7")R0)Ð{ocŠp@ 4°"#¸x¦g9‚–8Éa¥ª(XÊ…5žl…;rXƒ ´Xƒ ˜8ÇðÄ[H}žˆH‰O(bÏ=ø¹"À¡˜©Í.Üœ!-À¹–øæ@$“TrÉœž æ$RÀ¢€A–ª*È0²ª^ÃÄ‚º¨"‚VY¥Gî !È$q`¡¯Ê’¨€™ªpMD£“¿À6ü(DD -8Š*NÑÿIFutÀ8´"…n(ÀÀgºÙ€¨° ¡,ºÁ €‚yäA)„¹ RDȈ‰è‰V 1Üz 1"øë °­G–ºabüë­€:µöZl«`‡qXò&Šæ2]Ô¨6঑ º$ì™Tp«:Zm• È@bƒr€+$ñwÐC!­qfê# y4j`bý „?m+G¯Þ¡ ‡Å‚²õøcg‚€™gTrÆ… t‘A\`© ž«Ë°*Âxï5y]­÷Tc–;ÖØ`ƒ 1xa€  “$†KBY»– ÿ¸ÙRÖ·A  ùk°5„qò‚iLaz*Ó ¡á7ÃôhÚ-‘W@y è‰WŽ3|ŠV» )qFÀÃóGÛžqàêÞ¸Á`)« $lÎ;GÅL‡† Ér=¥åHà ðâfθۆ ž‰!#yÕÕÝõ…&„6jÀž©"ò%x£Š J馱¬<—~úàxaA½:ˆîä(\FʯáN¸sxWmˆã™ pÏê"îfšú€ÞVÇèC° ·mrå»ã<à Ô#`ºÛP(QXJ7.€6g4‚8N»<ÉË-x†Ô§ÿ: áPC H5“`Éà @`¯iå$³ ”‡¨A@ˆž}øÃœôBYËÔ ¨l $Ž,à4·ÈÎU¨Ç3ðA…- EMžqÁ4`℃®ÀÖ¦dˆÿ”‡Ð ØíxÇ´r=ÂB):ÐNР%H£pîááÅkа"ݵ1€&hš$ÿ<4\ÁP(¤V P”²„rTá h><¦ò‡3ãé ˆ- pk­î(Â-ե̚DÁÀ–»æöHx\f±cÚ@'™ôŒ$Ì-P ò<á`Âlâ°~†+{“êP…9`‚ézcénÜ"  ¨ÿ\©³Naà¡×²Ó» `á鮿nÔƒémTg¤ И ÑSäZà»þF0®—Ó—` Ç•B¥µ:q xa¤ÂúCNà±o؂ޕàK)äœ>¢¹7XøÈ3ýŒ;ÔjÔ¦°@l‘[Ë`ÒHÌŸÌ!ø¢ÐÙ’&¬@6gj#v÷œã=]¾NºC+)æqt£„üFªn¬–µrÃÇü¡c”€ =}å2¼_Zäèj÷pŽ…QŒ{cSyHÁ"N‹-ê*@'Hvì²®Gî QøÏÀNí«@%`|‘ïÑ‹`œ/y/)Å º‘‚5,>[§°,ÿq·$b‹7ÿØ7^ ë¹×G˜ÌKÖpo4F¼­Ïìƒ+p<5Ø;‚kà tŸ­I\Ý÷WÀZµ Š?* [Ö¸i/l—0âœÞ()¨_\Ý:7 Å‚@H?lƒŒ?z°wB?y†YØÈ‡p:—ð-À’—83NH"»?¡š¨ .¸žp‹ @ûãKP­€¼K$Wa¶™¨X›hñ7ª0½Ã €˜’´ã@;z#`ð.à "»èü[ P×&V¹¹.¼gP ñ—„æó-Ø7hB 4 gØ €œœK.ÿìq N@»éI€ ’):X-Ýy¡lªá Xƒ°‹ & =—h„#è3Î9;™B€ñÙÙa— # (GÂË&É£°«Š(XDFôœ ¨@ {¥l*x3é¹ÐD(EÀ¢¿q˜p<ù ÂZ…Ëó˜{iC +h:ul( <è‰Hz`?7bŠg¹4éùHfø¥y2¿°D-Lže¼À5è¹ ”Ié1„t£çY[(H°‰+ J`M›g°‡y³ +¸°…ª¶J#J§üš{¨w@ þi„p ?ˆ:2…(Š+&:èÊ›úª¨ASL+—и0œ’m[˰A²±,np²è[ÐH;š(ˆ€FâË®lµ¯1²Z•DFÞ ¥ºr‰ld̯ù†õ³ €a`†ëQ¥gŠÚKôÊÎ!Šjd€jDÃ|‰ÿÐ6ƒ‰TM9„Y[.8‚Ax¾ °JêéÁMš+!µü`#£MÉÉÞ˜’;c n°KäÄ–Š:„ب¶ÒÃN…a˜P4ÎùB‚r¨%h Øš–·)N X‚ôLп¨/«:››žy< ±¯0¼ÿ(?¨0ÑEíPž@’±ªíR5°%|D‚Ûð”àl °@– êôPE–oлºñÙ˜ž ° (ûb‚#X(—„Ý€‰”Q$ʼn>'`Ò+øË§Œ‹òÍ ÐÅ(‡ä HR.µ‰´® Åé!ƒišg¸5è†8ÿåqr*Ò (É.Ó À„ ,¡µ–{ ¡gÀ0 t¹€–-Uì &hÆ9MRfH½sÐØÃ‘Å“À $°¡ÿiÓ(P™DITN­P0`ª9 >²¸VòÑr +•¼|ƒ HíTä섉¸®$Fê1ž{¨ÆXˆŠ ¹PCl Ë„U$E¶Õ2?˜±B.”0|ì-Ô½è†#8"¤hJbõP¹¢(ÒΙ¼)ÜX3U3ÊÁÅ(P½ÔÌVýnÕ4 4 …ò"‚rHQÉ·½è€ÉÀ‚wTWÕ]h×<¹[- €0Ü`‘Ê©”#x*VMO×i×ÿËÑšš“ø†s(•¨”+e„pžàЉENT˜¹·ÀG°#w@H•„¥à à ÐÚ€ÂÖ“eLó+ó³ðLú9 *‡6 ÔY(Nˆ‚ÐÒUО518ÐIÏÙ¸L6ºÇØ o0½ÆxÕ¨Âo85·€_°6ƒP0+,  @X)Ù F /l³#È=Ûôì¼3¸‚`¼‘ƒ]h°éùR¬("©|m‰F„R 9\xŒá9°À 1¥ž xÌ›„A°Y ­íÄ\F,µ(ÚÏ]Ý]PVê!»¥6hɦ)éÿÈS×¹*ø 30Ø"øÊB”˜½6£5—è†pƒáeLŸ!@ÞÝÙ¢ûñ¡$ËoøæÙ †\ˆÌ^gì‚;á ey¹‚£ÛF³È¢‚È– `_§l8’²Pð…]2¡]ÜÇê?8üÕÃT'ÿ…Ç*`¶ªk&MJ^æmÝÎÙ]É]Z¾ ~`µÛÞwñ§åõ^ Þl|饊õjÉ@Tf<¾;ÏE¸‚‰Ã ³]ˆÙXÞpØÛ¨ÐÙn=d&=Ú>‰¯a%·«^žZ(èá#Ö51˜Õw)1h =R⪹ɡ­—ÐÿÎâ"«‚\“h¼q-;Ú²šÄ¨XJ¾`‰ec£ë,"Âi•Ø% ˆ˜d‰5Øž–(…ãôcÆÓ\`’¢«-/XãkÉ1£-M XQ I¦>òS5£Âµ­•ž^Ë|tae‰ÃâQî°/Ò;Va^0P´#F; üØ[,(·Z6:tÓ;¨Á›] çý!ÞTàêå7"iŠ>æ"£vuWBþbR"#PJ_…]hYÚ$¨E>ªÔ €Hj8«a’ò…a8ÜÅ£pȃAØ€jh¨..Sxã·¸ 8`—e£W^žs5T°kÌà¡+8ä;º‚ f–@„î1T1†kÄ^L¤+_oÒ-É%s˜ècÀ6. :šÛS*PÐ pìUî€"øko™ÌnŒ€õÅnÌêîÕ²¶š¡ð>³ hmó*à¼0°`l«*È쌃ÎËï ê‚À;/;€‚(#`…j„à—/Lð ·Ð´î&!à–d‰<ˆ#~ðˆz=¨S@…äžžC`†éî†Üñøþ ˜”ÒÔ vqÀf†Vx#*eÇn# ôíàëîñÝ‚ ă["Wn'»P XòÝ–Æ7‚)ßmf Ò½à†RPò+ÿl!Ѐ…ê£ ùòÇnüBÝ ØZ6ó,>!å6ws¸î5lÚ 9os:ŸaЖ@î=ë È$/ætÌõ‡hÉÊ;tD?ÛgÐÛ½pG=tö5‚0%¶t‡ný¥tNÿè{ uäWGõ‰} Ðò‹ìWTÇf7¨¬V?õWW×8Ä—øÛZÇf`Ó\§õ]‡Õg Óõ`¯å^°¶ŒÛôc—d0ÄŒ£‚Joö]„0vj¯å8hëlŸöm÷×gxɼÐöp—d7Xƒ<`s?w6¾‡”/pw÷l¥ÛRz÷ãHÿcË÷,†€Eplx‚/xƒ?x„Ox…_x†oxÆ !ù ÿ,ÿÿÿÿÿÿ H° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jÜȱ£Ç CŠI²¤É“(Sª\ɲ¥Ë—0cÊœI³¦Í›8sêÜɳ§ÏŸ@ƒ J´¨Ñ£H“*]Ê´©Ó§P£JJµªÕ«X³jÝʵ«×¯`ÊK¶¬Ù³hÓª]˶­Û·pãÊK·®Ý»xóêÝË·¯ß¿€ L¸°áÈ>K̸±ãÇ#KžL¹²å˘3kÞ̹³çÏ C‹Mº´éÓ¨S«^ͺµë×°cËžM»¶íÛ¸sëÞÍ»·ïßÀƒ N¼¸ñãÈ“+_μ¹óçУKŸN½ºõëØ³kßν»÷ïàËÿO¾¼ùóèÓ«_Ͼ½û÷ðãËŸO¿¾ýûøóëßÏ¿¿ÿÿ(à€¿=3ÁðŒòÂ(xÀ³Ç:ࡃ+KÈ×®L3€RàP8p(ŇŽÞµܰ;3&©d&RlñÀPò¢†>ñPI$AÆ7*=sCK, Š’dÚˆ 0N> æ÷P¹S<<#§?<À(Áó†ÉàP&™— ‹'ž¨©fsŒã&N-!ç£sò`D\ŽÄOÏè ãŸJ^Òd†† Ï¢6}#¤¨>óQéGKôÿc ,Ð,Àé’e¤j†L@*MB´ê°A0³ƒÁãÏ3Ô$#Š­·& ‰¡Š(²¿ºô£ÃvDÇrôJ Ϙ#Ê3 m’ÈZ­š®d “ <ÃÀrÞ3$’L°Ä7©’ÁL !Q¤üÈ¢îº$SšïöPÍ”ò²Á©K¤à€Î`)tìj@úM–m^tÃ!ŽÓ'ÃIB©kµ¯tõ B$îu-KD XLÀ kDq Î4â Ð’ éÄYÑ77@:Á%8@#Ã7njÄ/pµm/Bä\…ØJ „¼´3œø1ˆ`  ݼm…ÓZÿIîDVûè+ PóÌ2B’ë»HL1Vq$ªºÎ´¤½ª?ê ;·ÃŒÎŒ÷¶U TàN·r‚`ñе@œsÞÍ„S@ àðÆ FPàyÖãœ$J&§£_Bd–“9F¸ TÐBÞ°@ƒRœ†.…8ÏX€# ¢-#riW @ à©'²Ñ0X¼HFF•QQË TõÔ¨J½Ä´¨8‚¤<Ã[DÕ$ÑRh!få°†0ðmÈÞ@°ä¸ñ•vå²hÐ &^xFÖe’=¬!*Hc2ìP3äb#A5¦ °ÁÀvUž€Àÿ¨W­·Ð ´Ý©¸“'ZNäÀªrÆTUŽR¬árÂqC9]èÌ•s4€Aªk jUS`”wÅZ»ùÆ ø!ÞX0 4À[ˈI¹ÈÑ4¡zH@½> ŠÀ6ˆEXæ>÷"ˆ` Ò>TM.€ ¨\Û,OQJX‹û›=æÄVÀ± 1­½03ŽÎ9NÐ ´®äŸ7½¡…„Ã…Œ¸òhi uN`Àmá`BÈiF€£¦wSáÈàaP€î%0ÐÝãm;Ýÿƒ=»X'(áß…ÈÙ®­>¼ 9‘dz–bõrÆÆ¾A„FäàÄcÿ\×pÖ´—pë7@ÛnР·²Íô)­NÃ' 5‚%@À  {ºG%Psw&pp¾0|0qWÕ/7áIàw 5yàp9€7ì%}p£˜§?€ßÐ6ø2P¶F–Ï2—?¥@oŒk0Sy°ƒnÓ#ZƒSjåBUƒ pý62à [ /pv`v¨°  zöÛpÂ÷€EàÕ¢>5ñ qÀ  ,2 Ð €=‚"¸h#¥ìÕ ZÀ ãå *o„ôÏp±¥jk°_ΰC—?Qÿ ~¢u7ú“ðçP‚æ„àTWX@‘0…²‚-àY g§{CÏÐ=@ Û`& |"€€303=^1±-¶°†©Âu9@¦‚u(RTP­ÔkðmD,è‹ð‚·Qˆ‡‡û…F¢6C9@\£ÅoL€y³?¢ v„ƒÀøóN0 †Ð?À YÐ v °{ßÀ ±H Yà ÂÇ&P ™IËíq’*pQ@ŒÝ¤ˆÉ(nùÖJŒ°¬À çö oDcØxV¤nÿUCDw”W GàBäÔ1 À9J³ÿP-õN+ 3ðf`Ò‹_0* €àY(h0w"P% Êt(£Ð«"ÌP^¨‚„à`”ÈjÈX‘=†ƒ˜¨j‹p)D’)@Çß°û…V9­e4'@NÎÈJhtyƒ4<ø®DP„)@Dp© T0 #PØÀ*€h@ ‰0wlઠèPe8¯sßÐ(Iáó(q°Rmd=cyx˜(n”¶ðtKÀ‘ßpæ !ùß°u„Ѝ‰¬„B8pä¨<%eN4 'H\tTƒ}Þà> ÌÐ\ÿ`@ò €  ™h÷vlð1Õ²&ñ þ@@Ùö($´ƒ°00Kd™—L·)ZüÓ›Þ°O·sm™nq©÷€œ­äsì…VŸ&Rýõn¡õ–åŽÄey.4Î`WÑ× 0³à `G)€0š"`_pk€‡2 Öhßpdp6ùù(¤pƒ@‰2 vxT ÎpR †‘Q@@߀ïDƒ(—êB¥@z­¤j4 dæ'Rk ~á°´E“±õÞ”ÀhÔÿ)ZÝÀ € û˜d×ç £ ,ph oöA¡R¢ðÏZ Ëÿ÷( 8y7öW‡)@y=&Oì(}ÁÅ¥/1DåP©ð ¸ñ EèB0@â†Ry9É£R‚ “G7.peœ“ ˆédÝ @( “¢Ìð šI*˜ £p€" ]0 :‚3Ó8x°ªcUÀ,“*HðpïgNHšМ‹ÖVV‡7tªgdWVð ³?–æù¥ˆ.–Z[¢Ö1c*sÜ@¡•N³Jõfˆ.”`‰ÙLðy³•N0€v`i° Љð§cðeGM L^³+{gôiP½­¨¢u°HœuHêBL@"ºh§fƒ"ÿÈi!ÈtøRKsÚ´óêRØc×ùR€˜p³Ž¢ÕV™'L ®N†?C³˜†Ç ¶Pé9±Y;±ð§vGv»Gö`ñ¸g[ÀScöPøÙ-’Ðs.û²]*OJ§›TðtÒ7Z9À^­6V`/ï €à…Ø›îG®ò¦ªg5ކG˜ Úp”«ã¨°œc‰@C“œ@xœ I` {*Pp0º{ÖŸP|Oô( ƒÖ†up4¶E¹Ê 3›¤‰z{x°‘ ˆÝ c%ó3û£K»ñ ¦Nï…Œ8ƒÜeFÿx¼ø3Cƒzød#å·ðRùæ~L ÐTàßÀ^º—^pµ8w`ûºk *ðó½Â·Û ÌPl8,¬@¤ßVnʤæB@h‡¡ÇÉ«¯zx©Ô© ‚{j„Ð#ùRZ€N.Gùê œ&s3Äož kyÛz }yFâ;RÈé ÿs*1 5àö P°Ä,Àp7üºfÇ3 gÓzªrVRA`² µƒ·zÝ4·t‹œ°xôÁ s¼jL!|©9ðÂQ€Ø¤.È™Csæ´æRÿõÆÞp¹z‚-ÕoÀyЭxÿ™4´ÐˆÔ´jtÎ Ï  àç°.jsÅ0j `0?{3îP¶À ˜MuÀC0 õ1t»hÜ¿†Œ8ö~ì Ï3Ìz¨®·l™Dk¼ÑnÍØ9R,e„ ®58J.Ÿ»~kÙx¨?p)°X ÂB'ÀåPVpv@@lʯÛÖ°†@A‡ }Ç B¤R uà9PwT®dÁ/ ‡QÐÕ×coIáÆhéVÜч˜ð  e°£¯aî„ n[‚ªÖÇ/ôœœÀÍy þÿÙŽ°o Gîw`j?vJ` ÏUpïÏ^ @ê‰Ïl \ ôÒ-‡ð‹°u£Õ2HÆ»,‚§ÄCÌÁ”˜¼Xp}wk‡LзÛøâ2$ˆ¼!ŠQÜ,nGÀd¨Ç@8ýCX°qÐ[ª’°§Tnð½¢°½Xà˜Ì–°DÏn¥¬µòžøLôp˜€*°)» vH³«“úÕù ‡÷JücÖÄŒ¼4[özxÝ‘nÝ Èϰ£6һчï‚ÞÐÜÓ§’@èúãj ëþ _­M5Óÿ¿;„[b°ï܈aÀivÀóŒÏ 0%  îPö` iDZ`J±Ýcu8–JÊà*nkœ½=vRºýÂ.7–fŒ³»“ªûs¥¶ËÝJl„’S¦Èܹs¥j`Jy04`À2 FDþ°•6‡°npOWFà¶òUmp} ™ '°äТœÝÔQLc `¦¥ÀŽÞ@ÛÒçLð¤3×åÉA8Àcv¸ˆm‡õê«/Lol„ÀÖg”„ ¸ªv»qI°Èst@Ý1TàÒùÃi§n€yÿ Ðâý ߀4Pуã| þP]ôÎåàúôžPŽÏt€6@@ÑG–⺽Œ,»œpX¤l~æä§æ¸üÁÂÌà*ZV&'Ô‹þ ¦Ò6gUQ‚ªVÍ"¹ø#@qÀÞP ‹P¸Ï°Áq UPh3œîˆpN}îøà Å fu›ÈØŒ kpGÚ¥Îç$(ë@xnª›ôž¼ÝÀ5Pו§¦IZ˜gá4 ºñ I€<­´ÍÈh×§Ns,u40C Ù$3d„mCÎéñ «ˆî¦¬îE`äÿ@„¦‚00®f.Ró&Èž4évuÊþ–5ðæ"UåÉÞ6ÑÇn¯È¨‡_ªW¶ÐE¢5Ö{½ày8Âñ–?ápË1èo’@p*’Àééíéùèò/~êVJš[Z¾4¥@CTçRyÀ~}=–ÀÛ¦!¸÷pÀ\À©SvhºIZ~Ìh“G'm4LP¸¹­ :Gðdg¹.ÄF …«Âº«öœÞåÀ ›]ê.êpíÎ #å­·[4~ÞYTлi-RH ?íRUV,ëÜk°žïB‰ÌìSvDß10Pi=Z@PÜ!ÿÃVU_;TÊÂ"n„Fn&›tòI'Ÿ©n pvŠÂ¥Õ(Øà½øD¡‚(™@?þø»Ç:4°G ÃV±Á†LøÀ„h#@ ]ÜH-°¸hf´h ¤Œhèp.jÿ„ŠÙ¢ŠƒŠA醊@¤á‚p“(Gµ`ñ(ÿ¡¥C=x†Šõ‚ ‡‚œ‚B(Ró¨ÀˆgÚ8Ëú ÔuW^{µŠ‡ož!¤nhˆ$‰6ð¢pŽ " ¶s’‡ &(s¿ žy†ÿ ‚‘@…PPE\ì |áB”n0ø1!,`xƒ Ò¸8â ÜœádɨüAõ!N.¨/ªoÜpë  *SM°ë7H=‹ ¾ñgƒwj¤-–í1 žhábÛ³ØÁW˜c–ù» yÆŠó$½À½Õ¨ˆ§+™@W=™À¯kËiãÌmk£ I\a꩟ÿ¦ÎÅî, *ê€ %á ´àæ¢(x f*7Ž ‚ €|UÚ¨HñÔ4‰Ö€gΠÑgF$ ‹Z¸1‡âøË¡ƒeS˜Àžž9¡l‘{fÐC}ªC„`­ALF+Ò\ˆ‚-ðnr1*@d2ù“D[¼ö“$%¨žúƒ!ÔU€ÝU €“4¨ƒ8¦<¸+ TÓy¶gÞØ`ÐP§º‡ %ot* €‰—§z&ˆ 8Ƀ‰¼¢ÂØmˆ`X!*Z0pîý]e$ 0Å BÀ3p–nt@q£c`aö"‰'¥DÈ6V€A¬9ØÁžÿ`BQ8GÊ´;mÝ#0úiBð„·H€1t@ 4!"&t HA74p‚m@P@ ¤Ò À໩ òe…5Œo*ߨCܬâ²âsß8P\`EQH Àó‘n dMYBîÁRŸs`í(h«9KÁ``AÄ â!ˆûÀ&¾±«o˜‚aØ (`ÂÀ´¦Ó–$ú# *„à ( Ú ÀÊ0¾ˆÀ]ꀗ•Ï¥¨”üA 0Âj“Ê=hq8\ Bd×¼‘*ßX„¾BË»€GÒ !(äª#4'H@–’’ÿpêŽÛä&wZàg˜GXfHé-áˆì¬á3iNkC*€‰g¨¡ °B4‰ †˜Ðƒ ÔÕ€? ` ÖÜ0eDõ‘â|f-éH•8h‘IߨÀO\@¹Ýƒv«)žQ·—HäܰYn†ÀÌâ¢Ý¤iM«âÌÁ±4°B âr€—ùJ|h@°ÁKòÇ €3‚@ Dâ\žLýãÝé “°Ê=.«<ƒ‹Xg‰y‹Ð‚* 0‰‰l䯩j rqÀ3Œ%œ§5X Mýú×|ÚK Öh‚,&P&(뮪DÃÿHªRËá†baÀ'…÷fD•9Þ p•oT´*3r@Öª‚8 aB}Á„3"ÄuœèÆ3„¹‡x#2lqij×gHpcTز°†eID­¾ª‚& ]übžüÙ§à”j (QNÁ¸Yi¨U^ùéñ¤$E# «†CT!œ9ûÀt×ûß"×, @ÂA¨ (¶'ªÝ•)0! €dÒ@ñ†—¸ÿÐVí¤ˆ]hÀ_ÁXØ.°@l"g D)–ðŒ àõ<ÞˆBX;bóJÁ"Ây°ÀÖŠZh„7”³NA†*ÿ¨A7*|-HMxUšTS™3ø¢9&°$©¼ágÄ*0ìJ«A¹är›{%pî"„Í žƒ 4–W¦è„ ñl÷„L˜òÔPÀU©èÁÆ£!ܼ'"„nÊ36p¬£ˆæ ¨€gÜ•=ZÔN j•3:ïD4· Á/k s ‹´î"ñ„)?A TyÆhí$‚+ˆxÔWy”7RÀÄ Ž±>ÓÖ=u*©‰TbØÓÏ&áé9Ç=äÜ„}ÅŒoH@¶@Ä"ÜPk§•ãâUÂLQS¨ ŒAöLm^/‚ á@co›ÒÄá<¨Âÿ8•…á[áaÙÁ>°} ‚„0ðƒâ3°°Å¬P @än?€Á”Û‚ÐR}àƒ(3„"pàÆ£þXúí= °G ÕAuzì™ Í 'úVÜa³Öoˆè:!>$`i).à‘Æ ZÀuÕ>ð%øAØS&b@€ÑE\›1¦`àÀ!®‘å »è{·ÊÑO½1 ŠQ¡ë&Š%œ£˜€$Ëä€ut×›»&Ÿ`Hª`¢ |対?Cƒ`p‰Q²¨< HÈYl0àm¾Ç¾áÏ3BJq„‹tc —3ÿHˆÂ:²î4nâ~˜¬>Bð‰Éó€*¨Ðï¯{AÏwYDª ²Ž |D5{ôÿÃïµ—HT‡«™C XAð+Db O»ÖÓÀ "`€¾ª‰‚ÆšSx—[Œ!XTˆ=m±ŠCà™ƒH+˜»[  ‚%H?ôSû9¡ÀÅ ‰¦›K¨ø†¤z/;¾À0¾ÿ ϪéK´<Ê€PJ„"H´ f€œ(‡C°…o¨‚Cx6¡Ø€ B¾ãx *À ãHŸ™é„qˆ¤rà„'ã. c•uë$”ŠI8…g8;ÿÆP;€BªX‚> )àÖC p595ZQ.¡Èe¢€íó=8‚7ÚþK¥Y*`pb(¸·hrÃÅ€ƒëûC©•€Qƒ8¨!°*Ü Xñ P5Ñ{Ââ‰5€ ê›™ ©,GdÄX¿øÏ²©ð‡x0%‚)8D´´TI³ðœÚ“ €ŽiÅiƒ Ó9DÈYB ðÃ^Á‚7Pƒ]LšF|š3œš&PùaÃc\ „ºÞûà ìŒ03°'¸»a (€¡ÓÆG»‡²Hg(…5 0R`HGŠ”®žÿ ŠƒÊøƒ+Àƒü &3 ¸§¼ èÈ1¨—ä¨R°m1‡Y¨¿#0ȃ–üËõ’’n˜#HЪ—¬“¤XP‚Ç$KFT·€z‚WŠ*àHÿz‚1øÄ<„MmI‚møÇãÜ iSMƒý'9‚F¸ºuCú°Ó‚sXÌþãͳô©èP!h˜3ÎIÞQaH‚”İá[¤Îâ ‚Ì!Á( °Ñž…2DÓ\‹„ªè‚U€DƒS€R¸ƒ*ȃCˆ‘Ê3Ü¥Zfh €(ÈXš:…1@G`tÙÁ-´'`€ªˆ€0PŒÆÐP(½.ÀÛÁ,íÝÞ™AÎ5 ‹3.Là:€[(€ôM+Ї®û,°‚·“m HS( ‚Y°ö¸Ælä_™ù†o2Ñmº‡°ç.^À€¼ ý,A€Çªè‚4pT2€Ògà‚pt® °\Ög°Ê¨€è8â§iÄ.ä´ ØÔMÆH(‚è…R"Î-Ä¡œía;=fŒ °3pNà„2vÿ"ð.‚šHU8ÊõŠàFC€"(%(­¹è‘#Øöbm<…¢eŒhX(pE†‚KÓ*— °Åµ˜ `®Š{ÐdLF<æL(5‚ÃÚ „.dÿœ„Y­ c](Æt è.(†5°]p„)xe8¬ øÑ;„=Qwh®pAÀ€@Få?ä -vÁŒ) £Ty Î"°fÌÀc=¶ŠèäDÀŒƒµÓ¥4Š 0ehÞT1h^ ýf`ZáDH¨oþæ1pÝ÷ %Å(g@…´fŒ„Ú…ÄîŠNp¶S7À4ˆ¸…ÛUoƒŒ€Õ¥ÇD¸[hK߆Àꨀµãoÿ†‰ðVÄcŒà]PpÑF዇bdW@('˜@& ׯ²-ì [°g÷V„+è¬è5ea‘šHnqm¬‚0žâ>ÈßN;I¯ø†P~¶Ó7x¦ r!ÅI°c÷ÞpæbxÀ&˜p;u&ç¸ðÿ+—Ãq&-öír¶€°ˆ1éVœògñ4ÿÃkÆ bѦ_胰 smìïÁó<‡Â^“_€цÏ]HʡրRÐëóÜEÂ*(p °.·c027i7xn!ÓÂN—C=ØpH쉞`æöb Puž€­VÿÃoÐò÷ä€U&-*CŸÚgè¾ €SÞuœþõ`¯ ˜ó‚ÛvÆž_fG¿*àsy°_¯ 8îj_Ë–-hÜlO?P(änçzxiE÷Ì~ŠJw9ô‡†Ž°oÿíW.ZçàohÈà„eÇ÷ØKÜ÷óÂŽgXvðË…€ÿVA JCx($ƒ¢ê~wÞWÞtogéÜ[‹Oø±Vö&­Ë¸‚cê €.da¬’‡BSðz a€çëÞbŸXí!’„éù™ç2M(dù†ƒ;“„>&°:z¾û¨V(ð80l"¥¾€‡I‰€=©ß»Oo8x—w“~F›Aø±¶NPÐ4À :¨Œ¥^¹§ÛgÈÙÈŠŸ{ô«c8H„?(ðŨoÓöâo„œñ{Ã_¸o8ƒthøë¶¡öi´éÓ̽.°ƒ>PÀù>] y/æP“q N?ý…Ãø9Oê)¶ÿ6éC€yI9‚È·}|ó(Èýù¦âÖjê1NdâG?/ðÝÿm`»ïvž‘®èG?˜…t¨~ …e&Wh7èãØ€âî':L€‚gÿa÷b}KF8øõ§¶o‚÷ üƒ „ 2lèð!Ĉ'R¬hñâÃg89ÃÆ"G’,iò$Ê”*Iòaö,ƒ@‚‡ 8±ò&Μ¿­Á⬛:‡-jô(R‹ÌPÁ”9ðLI§RC7g).<«êõ+ذH™Ah*“€¢1IJ5zHK7,Lzµ­k÷.Þ…b HˆI0‘ˆ+<ò.I‹J#,ÿnìø±Ê-8U@G L7Gtä[fœG“.ÍP( Nüa‚±éÍÏ6À·¡Eìܺóêé¢Ú)œ"^¾í~üm3g\‹3o^µEÊgEȱà¼0ˆ#yæ^ïî=§&Òÿ–úÝ.­ yrø;ïþ½H'~¤ƒ€…øbŸ](Å)€~ øºÐ§@4±Û€SÝ“ƒm;48a€÷x1Þ@ha…S‚A#4×!‰Þ}ã…Sh]ÑG‰HÑ„´8csßè’"fŽÐX”l2âŽAšv‚_ fÂí yÓ7äÇ’QŽf_¬‰`Ã.Žh"eJ-AW\ŠYÿ‘2 Q„ ˜ð“ŒIR/50ø&lPär¤É–,àV§EÏÔ  …ŠÕž¾ ‚k,`¦¤¡ùsG˜‘ZšT‰˜y… Œîbrp)DþB*ªFeºi§!G`¤:+­G™¢‚™»´ŠÖú+°+u’Æxt|*¯®²,³ÍŠt ±±J¯¼Šê,¶ÙJdJÒ5 ’&ŒÁ( †õL¥ÚªëÑ"˜† E y&@úºëê{(ÝÔ€ q@¯í{0³]ø;P‰Ø0î§&¸‰0Å´ žLX ¯Ø`IÅ!£j JPÇ"`¨"»lÿ¨)î´J½À‚/ë\gš:uF²øÂ;½äª2%Xó‹Ú°åÑQygeg" ',€,5×-RíÔ™"èÊÆ[w}ö„9SWîR/ÔhË >å*ÁEp07ßú•ù³šdmvß…_÷ ¢•%fEþønψ±¶‹!Dzk¾›•-M° ùm>zl“¯öG¡ìrÀœ¤»þX*ØMGê6ˆö:î‘a‡Ý‰ ¬ ¹ ß&%;•È9¿|^òhä2?}[ßÔ}|òÔkÏVâ2ÑqEÛ‹ÿÕ×±‹)ã«?Õ —Ùúñe‹Ï)R‚ãòëÇ™Ì Èþþ¸’¸«0f¨À“D€*HÄ9À‚{-°‚1NÀØÁ«ÈŸG’.ñM 8p†Ð$ψC¾Ô/x¡ ÐCëZ’{âR*r¨C‘<ãè:Õ“¨Ä%2±‰N|"£(Å)R±ŠV¼"³¨Å-r±‹^ü"Ã(Æ1’±Œf<#Ó¨Æ5²±n|#ã(Ç9Ò±Žv¼#ó¨Ç=ò±~ü# )ÈA²†<$"¹™€!ù ÿ,ýýýýÿÿ H° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jÜȱ£Ç CŠI²¤É“(Sª\ɲ¥Ë—0cÊœI³¦Í›8sêÜɳ§ÏŸ@ƒ J´¨Ñ£H“*]Ê´©Ó§P£JJµªÕ«X³jÝʵ«×¯`ÊK¶¬Ù³hÓª]˶­Û·pãÊK×è³guóêe‰w¯ß¿€ L¸°áÈ+^̸±ãÇ#KžL¹²å˘3kÞ̹³çÏ C‹Mº´éÓ¨S«^ͺµë×°cËžM»¶íÛ¸sëÞÍ»·ïßÀƒ N¼¸ñãÈ“+_μ¹óçУKŸN½ºõëØ³kßν»÷ïàËÿO¾¼ùóèÓ«_Ͼ½û÷ðãü„¨ ßäƒ~¤‚þ!(þô¥_fÄ] >B/´`à” fø (FÜCa…Ud(â]$á·‘A`„ˆß,ÁHd„þ ØØ7U|Óà!­„“G#Î8#‰ BÀ Ú˜˜‡0xh±AÀ€…3D,‘¡ÛÔ°àe áN èø]B0È@ÎDr„5A`1Ž –ò 4´@Ù3þ$ÁŒ;‘DU$D’ÙÊà)8ÃHp‚E8)01HœÔÙÆ æANGä@‹d÷$ÁÃ=#~ÓôÿÒ‚™Ô}«Ï@ê 9lÐ ›»bAEtÃM ÈîêÌ `ÐË„‹QE#f¸¬Iì_tÏ@Æ] Dê4üÊ&X€ DáB8À^‰Á ~,íaÏðÀCµ "±xÞDIHøöܵ„3)tÃDÀî Ã\PÀ-G|°Ü›Û|pŠ=cDš .!‰$,ç]H0àD80’"’÷÷-:ÞƒE XÀ0ˆ WYtLtÓÍ•TÖÐÑÀ†SJkÐ@ bÏTÑä]÷´ìØXHÂÀËÏ 1)¸B¬±ˆ;ÛgDˆÏ8)4ÿ$›Þt EAvC¢`Á0˜[8'9ƒ=W¤Æ®è0Ê £àqÃ{耇{ AÕ7|ýÌCGÌ0 ôBw¿’°7ÝÜBo€PyoÏ¡p¤P‘ƒã»2ÑAÒ’nÀHÞ0Á´7ñ2Ò7”gÄÀ # …8àPÆ÷ß—!~ Àc:T¨û®0î³ÉH),Â3ƒãÈÜúÐêÇﺂž¡¶i VªÚ .`.,àÛU :@êË @Þ@†0ÀÓ@.q ˜%,¡ Ç'UŒ`O¹GÜ÷Œ5«cÏ‹X#nÁ„ET`RƒÌÿÆFLluè`mžÁéJX¾ŠX Öà‚s­¡ÌÃâ´e Z`©(²‡HÜì8¡×x‰lá[Ø‚!F¡¦@ÀÔªaÄŠÆÄoWÜ(À* ¡ ©Í€Ý(Å Ö2TàB‹”3Ž€ÅxŽãöÈ´ía½¨›lZ@Ño°ZèfĺmZ±ç¢BWƒƒÒ“Àò†ä¶Sÿ" ðH‡9t ~دj„Äúj˼`(‡¨@­ Ð.¶˜ÎÀ @/,\À„­Ö庑 ,¢´@¤ ÂEÅ@…@¯j¡’ «”Òš…Öa‰š%È4qQ˜#òî ‘ â> üJ Ø IHRX}.t»‘T–’Õ8‚жP4"è…T_ó fÜ¥{³¦ë`pV`M‘_D-k7y® Â‹Îøª´˜ƒdýh5î*`³$n¦ñ“=‹Aß@±G5èþ ¥À8vA*ØÂü‚™¸Á„#ÐB‰£)Ôê¼z¸ÅrÿËÀr§€µô:#©ë-ÜŽÀæuãQ°B qˆ‚À Šg‘a9Ë8¸¢èI·P3DеœVÆñ»[)²6"ËIà°ˆà Ð`#^Mšä`6å@Æñ¢œÅ¸Û u-—Å(Dî£AȘРWà€ÐX4 ÷ZK%ã'ßHB2YG4,P€ðµ2#P tÅO¨Lå•(„BòëIÂÚ„Uó cˆÂs¿šmgp£½ó…u7Þ»XÙÂRJsFœrà‚lí{øƒ¨‘ W$ƒÈÀ…Ä^ ܃¤Ú& H]ƒÖ”oÀ ›”ð¹ºpÛÍÿ¸WIi~‘:ËqX…jøàÝÕ4°sy1ãÂ͉˜„ ëd…>+ øò€Ý  RÃ8qëÕÀp¬EN–!caßQÀÍ¡‹…FÀ¬šf“AQä{²a†¤œ¡B ™3BÞ‚ÔˆÒ>W“¿,oν:'æ•‚W $|S:Ösa5°ÞðAé:8¶²O |:û&ùÚ—åņ¬F¡q™¾²°rP ŽÖ™ æ¹°sókZÔÀ:KÓîg¼[’Œ bü`°1×aàÖ .›ŽÿÐ5x“¾çràò€€A¯"+7¯FÏ÷µâ6y†ÿ¢Dm-ac"O}á˜@ \ÙP/Y±¼чy Ý€lK paJ“aÏH°,ŒÀsç"HŽ#,Ôu€y–cͲ€)@,V ¯ Ï 0uÆ}$Pö}3PG3Q"Ë5„p c§~ñ Z€Fç:ð0˜pÀ ¢Dàpp£A ¢+»BkàzlB€×TR=ÇZk@VÎt%pÝ/TâzXà§çx°°¥ U\*„BÀ‚:U 0-Y–§7Ÿ¶ •~.¸GL°UÈXœÐ~‹å@‹À_q7äpv74ò RV„³1YFTçÿ/4k»‚mèÂZ nZÈ®× & ÐðÏ Ð RÀ}ÀPŠ6å}ùi1QäÇ6Äz-X‡ß¦Ê·Gt·3ÈwêòSaÆUˆûAQ÷,ݰõÆ&¥ ZñÂvÌ3…5{¢•ê¥C×v^Å_  ð ² °P†°$epBe k4ž e( n´S0m ¢&»âQ²‹´H‡çƒî'aÞ`<¥ n¨ƒq·yP€_›#4wZ߯U‹õU¦Å&åbsV<·¸QKƒA" ¹À:@R0%T$¹lR B&ÉŽ'¤W눜‚Åõl.‘\ª£zÿƒe‘´Üö4™&,Täefrˆçæ·°üLJ@QD¸Q|ömLp}xJ}—mûF]ÎÔQxȉQ‡VÀ ª v5’0Y?pBÀ0't &Y0iBÙ ž À€0‰îX`sÐÏ x£0I³;0 Q´è g7Tú(N4Ð)ß9€„ªS-ß`Ôø”šÁ`–ˆéræ@[1Eçr‡ŽH¢…kú¦ %NQ€WÒ£PŠiTž€Bn™’(4p—7õ"Ô’R`†€œ+¤—0º¤ßÐ Ù•+öÆ @iטÁB ‹Vÿæ09€zŒåµXf fB‡ã/ss¨ù\(—CòóoÀ²‡JÃÑøPÇã ÿØ»B70p9ìˆø0 fž@S—  3`ó`>ìp ì0†G|eK?°* Å HàPZÄoÞYL¿Qð„tȉ ‰ßF]4œpû!÷ %— ¹T•6–t„ßð\UoÞ ‡Y4¦%güùql’Pè²# Om$™  ¼`2plè03ð¥i„e050 ø0R0óPO=Ðl¶i(Q" °qõ¸Uö¢0Šs§G80Z@˜ÿ©v×Ö‡.àÉ”+Dp'jâ€pwŒa$ ÉwÁ„Ÿ Ï¥©E¬¹+—ô+_¥|ÖÓsá Rˆç/  ãè €# ]0 ó>e°M Ê>ª Ø`c° «P3P ¢:C&ÑÓò†ÉÓ7ŒI¨ô5pVé× œPK÷GûF£7äÌ ”w)v‚'K€û’;°/S¹o§jŸ©i‡ÌÈ&1œÐEÉsªøæ@ÌR.L04 ? ¦ó`Ö@ÌÀ Ó ¹ Â`¹0# _€" l`€  S=@“#±!¾¸:DPzˆ¥r/J4@ ]îÿ’~E3MzeÀkñT°™4—Dp6iCB<ð?{W8Z€•y¯Êø„®³M$ƒ$"2–.94p’ðbjBó0 -4   @ `&€lÀ€E0w»·t» …OKF –L(è@…§™´È˜tˆ`[¥Ð¨Ž7£’ë žÔu.œ@H.ÈRZr„l—‘b@NË“¨¤®³‡ü©gi RšcE¤k#)lç_jBR×@± P¼ P» w ²u«¼|{·S­~µ>¡"-·¢X€TaÚúŸ@Aœÿ€¨Å”àÉðrex‰ÛJƒ€YHõ!º)’ð ãÀ ~b9¢£µ“Æ ‡‡Ÿk ‰EȺExÔRž*‰å™5ÀðЫ°0Ó`ûp P¼Å›%°·W`ð0Ï+à­ñ ‚+àr%LàwÝ;t)@~@.P¹…S QÀ@å ‚S¹ÿxcóW \`{ÌÅ0D€j»']ƒ¤±µ±1X?ÇXª0ÌÀGp.Lóua4RWd Tàà2à [ £€ '`v ü¶ŠP,اf° c༠l€ ß·O•¶÷$ÜÿÀ Tø8ó‡5@ŒKPè‰x"‡“"väJƒ X? יđb¬`bBQKxQZÅÀUÉX`ÀA9ˆUëí÷T0‘ÝÀzèR ½pçÀ=ødT-€ Û@nû¶gÐÏ€ ”@ _`¼¼»30¢·T $˜*Âhƒ{™r äU„¸ŽËpbžß¦8Q@™µÆÜ¾²ç Fêú ­V^Ýðð'+B^€3»ñ£…W›€Qà:àPžs2æQ¾b]¾ ÌZ åò s =0ÏPfͰ¶œÏ0=@ =E°·![ 쀆{ÿªuñ dÀ”•6mÀÀÝé‚1ìȳX8“ô”ZZ° ¯ ,˸¿¥(ÐQpÐgw˜0{£…9 _Ï Ô…\°1°¶‰à× àâÅ;`6gš  èðk¸ÏP"œÛ/’N%÷éЕ·0Ë–ò­ F¥«{¤ ‹P-=0û³x{„rŸ 5¤jçF;ð£­ã¨ƒ°ë–¸?Œp¯y˜ðuPy°`4€—ÿâGÀ8T@ )Ïð[–.UÆK*Àâ  Á` Œ #0Sª``ð ϰUp?)ÓL°ïeï©$>Ù,@­…sv!WLŒŸþ€@£}ê§É;{e¥° ïðG"¿¿Ô Óôdõ¹Gì[¹Z ðN n€^Zä>ì 0àÿ”Œ½¼dL±­ó½°•ÜP˜l®Á @"‹tÀ¶ tšS€› ñ ;`ø‘!K€õ._é|A\%‡?Ž.ÖbŸ…øÈ(öDÔÂâÞ³—¯Àb ´bPïAü»GÒÿ5vô¤àÞÇšTŽŒª1÷ ´‰=œÏ@+ ñ ŠŸàÀ¦ðí  ÿÅ Ø8€@ äI ÄŒ¡=LÜ"êßÅ‹„ðhñÌãÇ%ç¨`  g)U®d™’'NÎP¶T‰¥[© 4œ¤éÌ›dÒÄR*À¿oxëù3J·žŒÖpšI“ª)õªðÑã=,)´j€ÑìY´iÕ®eÛÖí[¸qåš IËF:@¥É­€›oT¸µì¶áпNR‰ó¦Ê Ïþ=«sèÙ7És1>ë…Aƒ€*ºì4h°;6l @p&ák$TùqbÿQ¿µ S×ë35 QÑB…jÖž4K1¡B!€Iä+mâ\³3ºÏÜ”â˲“ÃÏÜhaÚÅ òÞtH.“S,S´afä÷•Ü`ÒÜßÿ„Kˆg–k¥F.ð㺔`¸àBc hù§-ºÁâHa"¯L«{žq"atQAÂðâØ0!Ø^£Çš0ªy@¢*i¡Ë~»gN(Ø €loBg8‰dH˜pAÞ¦£†ÒC°€8z¡‚Á¾™Lƒ5º[©› î @K•º©á6Ϥ"3S"ÂžŽ¼šàÀF´ðGD@tÐg@y†ÛÜÿ…ö8Ùà0¨‹™lFº¡àžoÜÐ ŽA1ò‡‡g2°c@Š9 (l¸BÖþ¨qV è æ‡ˆ¤ùÍ£%(@ - jIbÏt H–A,)  xš  €ª °ð"@Žˆ‹H@B–  r‰ÊŠ:y£«ß8“7Bµ÷^|Ù"Qï(ø`™ä\ A²q³Â‚‰zÿ©ãK7$óßN:jÀ @$qÀ™bTÀX]›õckø¢‡Æù(8"`hnÙb{r!&i¥ë†‘08o®C©?k) ¾@Ÿ¥ÛàÏÉÜ$:HyF(š\ðà l‰âÿ$ “VJ!ô ,±(E:_²Ë”À=½‹äƒ¬ib$1ýÉÁà4ÐM NV0ÒQA Ê)g‚ THÄ:ùxq°&‡B®)Њ–+À…˜[n©€æ(¸<ó”lra½(°úÖ™(±N:ñˆ–X=3ñiÉ…z¡ ‘–°ÐÀŸ %ŒŠ(xoÉ~ã×™Ö33ûyè5#ã›´¥ `¬\^#³íS †E0"äh³;ñ';LYBp+±@—_k˜‰" N¨`¢”$5G9” ‚sÀ’R7êä¬`B ŒWТ˜’tJQ‡‹´IU¡¨ÄGÿƒ–4ì° —@p%uã9`S7‘„]ÉË Bˆ¢wCê ’žL˜€ 0%ËL%Ê´’RT`3É3‘Ž´ på°‚ ÀDÐÈ4¤! À¸ZY` ,óŸJŠT€˜4 Þ“ QŠdEI¢žAŠ Pà85a‚? p/q°qCÛœ‘‚8ïÀ€t à°B"'aº&XÒŒ¸Cž>6æi@‘9$%ëÂÃlU`w=h·ˆø„®n9ìÄ!Àp‚C¡ð€ E$" a°8À0ȯg(9ÊÈšQAšÎ)…3òЛÿ8ã\‹pC¸‘8ìo š´\@ŠÉÔáxà$3ó7do†TÄYNx ƒ‰é÷Ø@Áå@Ä’&áØ€ú§aW åaJùÐÁ”ËÖ0ÅÊ 8±“ vCL„T Ïð‡àÚàHÀ4a8AK9€0d±4ò£ÃlñÀbu£l< \À Ð (I̼á7܃úÜLJ³@À ú“I ˆ€‘{¸A((רþ±Ñ™p"2ö¼UÌ¥Ï Q +~) 4©5?Ѐ) ªC±¤@„åkÙ‚:’½¨&M`QŒDÊxÝЂ oÈK ÿ@‚\1— „4ô˜éüð‡"˜€sm Šó˜œÉ¬(~˜…A¨Ñß9Ì7H¡ÄÐÌ«Qª˜ÇN&ë<É-Ði–0!SÞ ZëÛýœ¥–„ [ ÐÞ1aòTÉ9€!……RPíky﵃¶&8¾Ô»äYüAƒFhêÊ9ü†#ìã1—£ å(F™Í\£ 5&(#`@ õ”¿¥À üϹ ¢pF:ðuÅö›Ñík¡ÛB‹ ªÄuyF9]FàÅ UžXnÑjQÇ[3…©'DPi@“àêÅYžFäáÌ¡ÿ0±¾\ï’Ìàüë#¸£ÃI3Ãdp„ìrp¤˜h!„XЇüYÞnχ|è<l 9ëw™‡ HÖ+ß B’@Þ•½-ß0‚½ÏD¾PaÁ”ÂàYQŠlÂÛdëÂnR+ vhœü‘8Ø$‚5c88P&ha…JA6¼Á„??- §^@õŒCô"áúÐ/P ¦Œ[|`sƒF“sÃŽ^á·ûþx'!-ñÊrh±¤òÇ …ãðÇ®¯Î¾rà =XôÐá 8À.¢{E  hÇL²ÿ©aun@ ÏAÓÍòŒ{(ùSü”©Pü³|ƒ‚.«)Þ»’<0Cç'ïl yÈs&:À@Üé»oè  KÊoô¡ô§§l¬°fô¦YŒÍD ‚°?è¬ÙC €â*@Þº­EØ€¿ÉªEø>JÛ!Â7ˆ9Äã‚äÑ“$aã“ÀÇãFø™Dº7·šˆ ü¸çÊ¡>@Ó£?]K>^{1€P  …]x=;t‡:Ѐâ@6¸;¾‡!A‰B[„˜è*ð‡:°9kª€»ú—p)„<7X5°›‹:‰´(˜ÁÿÉ`¾²é‚ø/˜ûs,X¸@@%@4 @ƒN˜Œ{°*XŽC³‰d‰R~ŠŽ°Ìð y¡•ƒÄ•Kh è7rÛ„+tn(.5S°À5ús5¸C“jûã„ØÅ]|(¸½„»"€³¸‡J …OŲѷèàJ*¤–È{ Æ mQÆ•3K—m¹ `A, S5=èƒ <<½ øˆ)¢,+ˆ%àÅP‚À×@(7ÄFèñ‡ ¸»q/äà†(‘#‚C%~52°91  ¾è xÄ%›„ÿNèl[‡³uô$3 ‚XˆGy†)P©„ l´…„hœ0AŒU {0¯à!JyÁ—„(wਔè†û:> (…Á ¿d\²Qq؆'€ŽÔ5"è„ CûÓ‚øC^|Gh8ØP„10€žÄ!IœPÓ ÊÄMä•”(…Kˆ: <¤÷Ã7À@æ©ËPƒ€Sp ¨€Y̵E`M(<Œ„xl0ɬlSHƒÎ6€Ëè‘>ø²rë¡p[ðšè9g ‚}´ÌòµZ N@C³8„§8Ö5T¨¿<là„Á3+Ѐ`€hD„ÿ'@ÆäE%¸ƒÐ_S9Ø-ÓÄ—@HÍ•€1!.l70ȪL*½èÄ¡HÁ&LC‹ã‚Z¿P{†.pæD Ã„³"Ѐb‚YÀ†@”ÇÅ<…Ƀ9Ëð$›oX!ã„뼇¹L‰†µ,±à„£(PZÓ‚ª( —ü@(ˆÍx«0Pz¸}Ï„³?+p&PÇäE?Є‹8-R:(‚Ê´Ð| „ Y‰Ö±ËTD¨`Í˯ ÑÑz£ÙÇ@8?º*˜„Ó°€_@ÑÓsDàÏ]T‚`ÀKXNP„UàI$‘½ÊŒ8ФÿpXîôâ„%(SèyšDQPµ¸@HÊÅ„;è\¬C(…yäO¨‚€9ƒ+Ð:µ—:ЂòwbÒ:˜ˆÐ´á΋T|yØ‚²n„DfðSyƒÀ‚ܼ:I€ÝE?ðªNƒÎ-bUAyXZ‰¼BÒ”H? F¶<¤·ÔU{‰ÉnÈõ”BfR 8+¨CIЂ'@Tf8 èƒÎJSe ”@'<ÅRØ·†“¥Ò,W„Ââ„E€Ã•ûfx†Òàïò€k=½6X‡’”Gz4´0€ˆÌR9€Ty{ÀPU¼Æÿĺ¾šÀ[ør˜ÐJˆØeÅ MO)ÄR€Ø7àµ7ˆJÊ’„5Xl@n=‹Cà~Eˆ!F ¨¦ƒY¿g@’ qŽÁ&ÁžW¬H¸ÁÆSˆ'0à¹+X‡ @—Ý%áÜÊx‚'¨è0ˆ„×Uƒ¥ýBèQ…4‹:(,> û`Ǽµx ˜4ed†o°2`€[è7ø/]J8,]ÌÅD'ˆG°ÝسÐPp_ м‹{Xƒp(¥…AŒí(h˜¸ Š×Í ZXŽVÅøC@ð°âÙ¥­uø…_ðƒXÿAOØÖ'°„³hû€=ÈÕÕ• 7 ´Œ¹ÚQ/ø†°8–gm^¹ Èè”ÂI`†7ˆ„s€ À€V³]û "`&Û^<T0‹ ƒœMˆ!X…ûõ^¸€€ßè… GˆNëØc!Y`fàÓ1ä7'ÓÛ5=j_1#+¸??@yDDÄ´  ‘D(ˆ}`«šà¨[@%Ж×SXôI"p­­¿‘Ü€5hÇ|‚M@+LÐ߯,H€˜«Ô,|†"ó~a¼}âH5…5’\TX9c8Ô]Dã½ÿ=°³} E°-ör¨ü‡‰°¹ÕcÓ$ x ®Ã6Xu¸VI€Ç­ Ÿ‹0Ùghã„8ƒUØc>N Z–С‚²pw8Ý ô¾I¦Ó[„¬C½`’4I%h5¸T3GF³] àOV‹8'J“þ$(ûÔYŽÎ"Rf+Ø€måE 7Shd-¢ƒ]ØÐ^N‹{¸¾p¢ó ñÝg.P5 ‹IÑ`εWuL%èŒè‚qƒe–ƒ4Îf¶Z•èÃÌ0‚µd`(UvË%¸@þáYÔETöŒè„@ç×øƒ1á{^ E~Ÿ d±€dMhÿ~´hÕý&°RA&XÇ$†9ý¨Tx 4 KŠ^ ÒÇj²èTJJéž¼…ˆÊ68‡]d‚ýæ68å­tŒ€}!E•i´¸r† @«{é h¤–Âoˆ„V°i’ÜÖH ޾ºž.Ø^ŒŒ0P˜©`3ê©F‹:ˆ¯ä »=–qLkHœ-èj+ЇÇMeèê\sp †…Uþ‡Iˆ•ü,ž•룂,þ‡$À^~)Ul ì‡Ðà¬ÛJb€@0CåÏ'˜Ý`† xµ|Íf*Ä#üð‹š¥l),€šöê6ø…bŽGDèìr€ÙÿX}‚Àˆ Xf` –틨ƒ 8ÖR€7ä¿­þa5ã'ˆ¾f¼í á.x½D`؇çN‹C FÔ-…¸o¡[¸n*ÒVÈ¥‚€õjŸ–Ç'苘„”ºGXaõΈ"CÝ¿øïÇ[‚#àm\Ô%x‚_ ~v€2þmA¸11€ ÌEX× Ó½‡¶”ê W25Ðã6`‚H8Þg-U‚T숀˲Ñ1è‚Oš¯hK{®ñPc poö‘~I f-ÞþPïNìŸ]äK lÖqyû†(€ùþf¯.°FT+ÀLØoæÔ®qB° 5è(ÿ^–r%£r ¸r,É/òOí4´€Ã† S䮃M>ó>ùX5—70¨&àmR>äbæÏTvño8 7gFî8°5àoß@ŸòU°+s÷-".òèr³€qÓøƒ+à©t,ÀIÎôR²ÐkõtÁp3áí> S_É1ðÏ÷.”¸WY·(p„Rpó`Fô"'†cöõ/ F&'ð{(c/’ÔNöèé; 4à‚g÷tèZÐÞƒ´8˜©æŒä½oð´wQÓ„°yP©°‚ w_pè€ßö}ì‚Ó+Xçÿ~fðO+ÿÇ÷RB]P©H€ (t‹©Ýu€öÍìUA8ò³`½××`¯qÃŒøÐ¥xˆz ¸,ƒu)Ë)@vÓSqÝÅ~pñ³è„;uÝ‹€wƒCPÆŠt˜'%ÓUð‚Y˜G˜¢| ŸÏƒìî€(X…)(M°›½1Púwƒ8¸‡F ãŽzRê„8ì05oR±\.(°…`()0ÈÑ´00…98ê 7‚ ¸ÐKº‡(0°sØ€Ö0 6–‡3fÿ¿Î_ûµ@yÓ;ÿð:5°ÎËW²¸ö„ˆ8Ïße&êÿÎï|¸PX‹˜)aIæ%ð@05ˆòÙï+ýë¬æd 0®ÑD€ƒÿƒ•âž„µÒP[EÂ"8f‡5èÞçÏ!=¸{ØÀGÏw†˜e ˆWM„.Li(BP¤Ä· 2lèð!Ĉ'R¬hñ"Æ…´*0 ð,#È"G’,iòdFº(h©à"lyÖ€€Ëœ Î)Ò'â·> ú`',¢lêô©Ó7U4´€jõ*Ö¬Z+žH”3QÌ™Bžå,« 9¦"¶à  “B 8Ø0åãÖ¼z›’º“ïÞÀ‚þK—pdÿÚ0BÖlKwU…XEE +°SWLáТ>óx4êÔª)b² !'Æ<ø@Ž,A‰¢O„«ðTš&L`Zmü8òäÊ­~“ØvRP¨j+[tDK[JCà€…ÓËÇ“/o¹©4Ï_Fw‚2L_]0N Óàƒžóú÷óïŸu’k9` ¦¸YC ÀBeuF"ø7!…Z8Qï¹D ÌÙ¸1eQpÐà…)ª¸"y®×Àö|hc‘\ˆÇ"=ú(˜?'¼h1h( "WÌw*'°ÖQJ9¥U}x•Sb Ù€6 H¤‘ÿ•ešyæE–•“ }dP[""@¡›E÷œ`&hê¹'ŸßÈõ•sµÑQÄ E !Ÿ‰*:¥öå”!‚øRÅ¢•ZZ)ºdÁ@ ²`É¥¡ŠzfW* v¬™1&ä9*¬±òèbK肘Y±y1¢¬½úÚŸ?¸žjA ¯é4Düº,³çA:l€e1†²ÍZ{­q}¨ÀRë’d6b;.¹…U¡ªÝ®) EpP.¼ñj… ¯Ipô”›ˆòúûïIϜВº«Æ& ¼0Ãu€Ý~ÛÒÁ,LÒ0ÆCô § ¤áŪÜv(›|²®%"Ì‘-ÁäÿîÉ1c< ÄØ d™†Ì=ÿë§@1ƹ¦¥ÏI—N,ŒÀeIVÄJ[­)‰$¢KA˜ÚRˆï^=6³zØ¡‚.1$òÇ× "° ¯dË=jiØB|oÓ97ß¡F`‡-6µ¬kÖ7â–òÀÁ Ï+ÂÅ%>y¢˜@xƒþ)åëù0áe¹Åž›næ ³<3ú¾†Ÿþº” Ì’ÎãeÁ”0ì¹÷è.‚›¥ ܺ ¯b¦¾KKõðÉ[˜3ßÜDã”*?½@ð<’c@=÷ûU€ÊªÕ‰° Ý›_^“„_¸ _žÿþj]辂6( ?þ«‘aÿ€YS—°cþ8Kð¯,q’ÃO¨ÀÂ`]°AÀ.¶À ê…^Ær‰‚X 9 rp^ÑrIˆæÔÁb@TÀÔ EÂ>Å^8¡È”Ä¢D%'Œ“ €@Ã’äB‚ÍLp8ñ"ß°Àz`bXà~E|¢D|¸ž!ŒÁ°Á˜ñ*(r‘!ÏXWK†à‹ˆ€ ؃º¨F…ô¡,CØ… D0“+àfok,"Ž4ÄQÃaÃ@uG(2-'{Œ£A®0>÷ ’†UH€!‡s›˜ô«‘Eì‚ `³ÄI¦%–$b2I°D`Q&2ÙEÉ> Êm, ° Æ Gl‘ÿ0Ï *e&Q¦Ë3±Ø€ÑÜ2—W»LY ° Œáo‹›1IV¶òEð£RœÍÁQ.A•/ÚU—‹m“…cKœ“ºð œ,ŒÀ×PX‚"ÈäŒØqç Y–ÅäÔÂ%>ø'iÅD` îP~2‹ßTË… ÐOáƒÃ5ÿ¸‹‰R4_ ZDp9ˆ Úìhþšs– ¥ÎJ(E%ÅbdLÏ×}íS¤»@€ ™Óó5IfYŒ5wQµ¡¦ô‡Òjæ7ÈTø 2ÈÆ.„!Ô©vÏJfùCBqéqÀ1X3uqÒ²šÎÜÅVüYЀcðä\ß×$´’5¯:CYð‡+´Ó¯ï{F÷I>ÃÂo`j9k>]H ¨•¬ð¼ .’aö|VJLH‰ÓÎf–R ¦`‚!’vz€‚ì˜ <­å¼` œ€ØÞm©÷ìÖd°„ƒ«Üå2·¹Î}.t£+ÝéR·ºÖ½.v³«Ýír·»Þý.xÃ+Þñ’·¼æ=/zÓ«Þõ²·½î}/|ã+ßùÒ·¾ö½/~ó«ßýò·¿þý/€lÞ€!ù ÿ,Kÿÿ H° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jÜȱ£Ç CŠI²¤É“(Sª\ɲ¥Ë—0cÊœI³¦Í›8sêÜɳ§ÏŸ@ƒ J´¨Ñ£H“*úŒ (K£JJuáf*$!âYÕ¯`à ÁãÙ³oq˜1òM¬Û·pa>cæÏ¬Ùo ìñh·¯ß¿!T°K˜ÌZ¯€+^Üp‡Â…¸C̸²eÅ-C¶k„Ù¡Ë CÃmaïÞf³þ°òhV´ë×FýÙƒpÚ¬ B¼>#¤¡-hÃN<§¿ uk?«PÂ?BT¼­kÑ‚G’«‹kß΂½8ÊŸÿ¨Ðâ_ ÜÚ¨1G@ÊÜãƒmíó›=2០(ß=7v ‘Ä=òHÔ3U”ž<üÎ83]$ñžõÌh°BPÏ$QE~Fà ‹d§w‡hi E©7Th °RÞ"7š0~¸ ¹Y|óMw•SJ§o^„l° Ý€-ºàôŽz¾rž‹´Y “C ëÿQù“Vì;w߈¥p#»è°æ_}³ˆ KÒëº50Ñr…­»óžfß`ÁM"ûlQÆC_…¼€ÌŸV Ú€²gèaD—3g<Ì,pF)Ö'@×|£ãÖµˆ­nPÁ}9ÄÎ…®0A&›È`‹°§$´  0úÿA…€•Ð2hD˜0¬²°BXØ€”÷•C`€ sFëÌ òËH½ú†„@³ ¤À Åó hà(ŸŸ(«5ÈH1(XŸ—„(0"~v9Ž-`¤~ÁppAEÜp&†ŽŽÃ#Ö FÆÐ‚ç+ÖÓDƒŸË.Aøî¬¦¼‘by†?‚ 70˜#$X M1»QÃ6) €­uŒE*°•I¹G XɃ Q–³”#6p¬]F‰çk‘ SE4m‡yšE–ʦ ™#ƒ@À ®0  äˆ&úºÁ‚Š~ùF@7ÿ+Æ>˜D×6ÍÒ‚AZî\X À1ÑY¡c¬ ˆP,yŽXÕ `hÄø8†½CÁh‹Ž•„ÜÜ‹X(€•ú“oì  ƒ&`4ŽVÔ¢‘Ä‚úOÅÜc·›‘Ö½`ðwaÆ»€P…²t'ªPI«öŒ%´¡E8œ7 ƒ^,T4 üúY¢>›øc‹ˆ@ÔTR¨ÃSoò”#Œ&@Qfµ_ÞpAü€³í@à~EWY9sÙ¥À ‘‚Ý xȹºä Œªš ’ Vbÿ Ånpb QÐ ä*ôk‚ó«€Z–‚äÿ¤æä”Tâ`Ù–¸Ô½BW6ôh´¤ÅB7`°†lÀœà­@`-lÁzx˜´YÐÐSì­ITù0äõ4HàëMI;+å` ƒ € ¼AįT0ÞP Zs « f¹3BXÌ[Š—#ª´+3®“œÍ܃å8.{[èŒ " ®u˜°R"¿ÖmÃ8̲@ìÒ6ø&•V{`Ôl™I€h¼™oWÂŽ{#D ×Jékô†ÜO d…_õ f¬ RÚ²f‹%B^P`Œ ˜ßiÚõæXR)ÝÀhP€âé¸áeÉÎfÝž%ÿ·) ‚m.в”žrÊ Ÿu@o™’ˆp±›\o0"c¦"¼6!÷T;ÏÐÀQùÙCc•Ý[Ô¨AíÍ7Òèãš½ŒfB¢°Ðe³B@3§µ£ÏRè÷`’ !8Õ‹Aq·xÆØ*\Êi2ßXÂУçÓ8@°,Vˆ¦Ãó‹â› „ú4É^v³O=aå¦ QðC( \ a”³ŽÏ!ÖàDM™]ÝÀQq¼1ô,þhÈÀƒ^¸«‚Qƒ²™mêg÷«ßØÀr ⽺½ÿЀ”£¼WŸ‹ÉÄB×A$(@j¨„WÜÁ$á7 À8²‘PÜy{[ûÂ' …5РgÝ89¶&û®é°µuyøŒƒ¯ukÈ4#´`õz}ÇЬZàçðp™?ºŽ£ÎˆRPa4XCM(râ•Ìh€\0Þ£Ÿx¿ò@ƒE¼Fª ‚xàŽ]Ôé5î å^Z·Á€ À hð¹3öŠ÷Ö€Ã/v#s÷²m€­bÅRDA®ƒ×Œ „Cä§ÆKÜýå8éLÇÀŽ Ê=ý™)öø&ÅAÖÀ˜0éÄba (,ÿ«2ôó¶ç'½m-½-'F3‚¥(1 haŸ0HA7b9K¥_àkD Ô1’àÕâDÝ@ eÇ!ß îñ{ÿäÂwý'Qu’]œ¢g€ðJÑ'}‘Ä +WBøò5‘®õqµÄ „°*Ï U°`E·yýç ïçLpwZ€w4€J(<ÔGˆmf†SÊ¥‚n``kä‹ÐQSÇ‘Ð1Œ0.@-H#?4¿§qpU@Mœpw (XP+è¹  ñ KžÝ€#ß·”yiæËÑvÀ )až³Äˆà¥sXV:¥–ˆ‡ËÙœ5JGqÒ@V¨£ á>À2ŒP¿v{°1(Ä¥tQÐX§œq YùlË•„€™Ž ïÓB@Ô3‹Ox £DK°\*ÿÖ—zè ø‰bÊaõZ9 ‹ŒT ~Œ1–Lðcê¨Éå  “ZÔå§p>†+Œbq@àYßfTeFªõfªP²šªÑpÒ^­Æ/Ú¥€{Œñ ¶Àƒÿd‘†Ê«€Ó‡¦´¬ÂЬP¬6W›Å¤› Õ˜™YPi˜+d­Ñ$'¹ÛÚ­AœàzßW¬FŒ¶’¸äC›1Tíê®O4%K€ð‘ôºß j%)¥@°;æy溣ßþpÙa R¬h  ~T­Ö}0p‹-À­ Û‡5+?êk)ÿ€õxž ñ0# @;¼p £0 #0 £P ½YúñQÙ‘Ei°þvšL ÷²1+‡@gPÄ\îx•X”馬@×0À™°¶k‹ª€j› ìP#0 • Fà ˆªG°–R«cÑÇ  —¢ÂX„šµ ñàŠZp6 §¯ ©]"D°$ $¹š»¹™ ° ž  2€8a›±p]‰Zš‰ò”‰('ðW„#—w%8šáÀaЏA2÷Š.€@òÇ/0€K€´à°8°¹Î«¹— [ð=ð[à 9úœK@GTÑÿT‰ÀU œ&ÅKrª¾CøýɄ£„oRgdf¸¨m¼ €}aÖ ø¨cà—€ðæÀ¼Ï{ÀePìà Óûðœê‡À §‹oàhQŒàˆ°;p„þ© X-ëwtûRÆ®ìuàkôd±PF>œÐ Àcæ ªðË›{ È@ œÇ=`,!F.I²0À̪ÜÅ" [Íãõ“æi˜ü2)]CU®À¾LÎ$½ [ÄÃüÌzs„q95@£:Ï4›ÈçX‹Ï)qXævZSÉ  #v±ã,Çä| eÎÃܹ¦­$ÿ{ÊTýqJwoP |ÌÑQ.r’€ª“Rº"†vñ ² :°ýË— ½Ð†±1ÓQyÊÿœÓ`F,Ÿw€÷Ó@m€ u.°je€H:@ áìÃ-ÇS=Ì7XúœfÁLP?-:wh|rz‹™È œð„ ;Ö/ X”€¥S>°Ã$û Éм ½è¼Ð=Ð%ñ @@Óy] (pJGpýÙ5qÈ}¥À wØÕÆ·õÉ1)ãËŸàúè0ÂØ4!ÔBfr‚‚P9µ €Ù™­¹è œ=é0ßÀøÑLÐ ò]ÿè¾@ÂÂä­€þ)Þ¿N‡¢oðÛÀ}—êŽ7ómÉ Ô@ÐÍMÇÒ‹ÇF<‹ì÷` xÝu‘¥ÐÌ8©œf–ÁX‰•ˆ¥SŠÅæ &ÔƒŒï­ß0C’¢€Þ‚€jð ÐP ¼ßÀ Âì߆€ !Ñd#Ûu&ËNj­À  ¹‡Ào’Bœ°# æ —ðÙàËÀ€âe š› RðÔ[½ Š`’`§–([ÈÖp;Î~¢\D ²€—- NNžP*=nþËR0Ð eÀÀ[p ¨Š`ÏÀ|ˆ¬•þ§_ÎÏÿ ÏXÀ‘fnÌ;ç— à èpГ^é½ èp æœ*þÒàa*1¾Q°}í¨œx„`Õ‡NþÀoûr?p ¯°™ç™ ° r| ?0˜ÞëRÀéš› e€¶sî °pÇñÐ÷@&áG8-:uZ|±´tT¬!Ö±.A`d¸88°NÍë»> }çÀ¾¹w>žž¹— hkÔK½ìì°I`«Ð Ž>Œ`¥0ð54꺳/þ–tQL,‚Kq°Èð2îÇì S#·í KN3Õ  ˜‹“~ÐÐ ? R€Íÿ› ÙïPÕkÔüÓîYj@Q} ”ò÷Á»DVšôñG‡ŽÅSšôH¢@¿ü¸¤®ñ/NÜ ¼0Î$ âKŽ2@ðð¶AüeïÐ;†€ #ð[0÷.ýUÔI eKw{ 7ê#,Þð†#XøKH¢ö§€ó(¸o€O5ƒõ7qVàòž è  #@ô @ 2pù Üæp˶eP c ԋ󠬑0XžZ«¾à³MÛX< _ŸXŸPÒâùÇü\. 3ïöªÀ3   ‰ G ø€_P îón;~° Yÿ0_àß= A‡j’ê³oqbw÷üG9 Ò  ž® Õðó f Ë äI°FoÊ®1Æ@ñƒÍL.3ÂJ˜0&§ÐŒ=ª=û×ÑãG ¿%ò̤I"´äqÖÒåK˜1eÎŒ‰ #&TH} ÙÓçO A…%ZÔèQ¤I•.eÚ´h çdค£š]_¾œ  Àkƒ4,®ˆ@€@´iÙˆ +"KŒ ùK A@œ“&=D¡âæ_À2mbáæF*oâðtÚØñcÈ‘%O¦Üø™>°ƒ4@kÑT¤ñª€€1dË®f³ºl³ÛàÆ „ÿ³oyÕ0éÀ¤[`gƒ&Þ ‹‹hxC«ãÊÑ¥O§^Ý:ägÚ\›§ Ǽ:éÒ¨ Á+4eǰ8%Ë6°WË)RÄÐì="# ï3´è€“F€s† & ( „¡ÁRD ĨÐ µØºë:ôðCCŒÌŸ$ñ€TÁ1NÐÅkJ0ù¤JšÈb¬ùŠ8ࢸz0Ü¢‚Hâ?+‰"8)…‰H4Ü`Ê)¥Ü@C-´ € K!o ED2Ë4óL3 ) \Àà #ž¹Cf1OT°äi(¡¤BvQM>˜–¸0*ÿ䡞ᡤ“Ô€!Š ˜l28,ºé¦â2µISM9% o8Ñ¢64SUuUVzs Z!žB(±€€®ŠˆBzhæ×0”Í/¡ìÚ!/6è ¿.µö%›8¹àºZõö[pÃýç›ERh ¸€  ¿°C…ÒTðâ("`F³VùtØQ¶‡\‚jAN§œ(üíZkIu¦ Üh#q+¶øâã¸`áF4“&ª©ƒ^¿j@‚H¤,6„‘.A4QC ðé™^xÈ ‰I)à”Ὸ±©ãAƒEê°c¦›vz²7 À¢%q€ÿÂ;9!‘Òºöje|ÙFŠLböä_ zj!‰‰MRc‚Ö(`á¿ñ’òÖÛ…RÈ;F8¡€œ(¸2Ë(háðiÆwœ(r9™Ú¸xÆ T€4¯½¢¡ ;ædՈ⎞¿“(g R˜0F €‚,s×v 7Xc -(o Æ|üxä“ÿ‚ áÆ™Fé„0-åDJVà YˆfU2¹D e12þ» }æ` ÁçKmr¦ï¾oð6×S,ò€¡xåP€Ádç N0#èJìpí<"8€ Î 0Œ@ 8`Çþ%ÿˆŽ '¹‡(p„hñc4°´ÆP†«Ä$‡Á Ö#@"²Wš{UPtP=èчÌc øÉÏ üad ŒÀ \@·†0œ@ )P7C0†qU÷àR8R ØO^“@`(¢d G:ð…üÉ 3 ¬€(‹YŒ_8Á„ ¼_c#I¦o\€ÌØA ,`4Xïd˜— ð‡ÎÑÃÖà z—Ì 7ìsÆŽƒAÒD8²ôTàž” Ôá‹{d/}Ù!œù' ø€# ‚0X@¨!‹;Wš‚Ì"XùñÁ3¬P€(ÿ`ÀR)EƒÁSœƒ+€…6€» ¹—¿dg;¥ã2<Ãà‚Ü †\r,°‘à3½"kD §¬F6&„ãR.è&( *DT¢ðæ7SP *°Âåhtxàt(Àp€&À ¨€"h ¢?Ùh .dá¨Ôìâ×)œ’ª\Ô:úS :¦–PŽ6XÁa À \úTk4À ø(‡M é’l ‘0 jW½j”N, 8j9¬°(¨ÀÚóZÊü P;Ã\„üÔMž¤@,æ«{å«P:qˆtôÁ (‡Y`®”¦òHY€LÎùSÿS(† )ç‚à-T Ò‡p&G xíE ÖÙWÔ¢V‡ƒ.D6y€¦ñJÒ`œ@·8æSð¸A…ÿÃÐï®d8*a` 4¸Ò$9ˆ:02µÓ.&v€ ×–µ çƒbÃÀÛ0Œ'n}ªè0GX6"…äMÁoS³£¨{ßûN;`€ kVf„Áz_¡yË[šÏ™À VÍiqœA…Ex¿žî…pˆg8à¿mÇ®\Þ? À¶Çpl’‚l@qf1j! †*ø÷¿fÄl?ìÒÓ¨²ÛT]±À©$‡ €Äi[|äŸÞ!N3ÿþ¯4Á߸k(¡6% æv·»À"4°é"YÌ?eÆ$ËäÂZÁbp”]j`¬LĶ {“sRøã¹sŸ÷Z…oHÍÿu˜ÁÀ¹k Ã†°h²¡äh„7RÀ Ø×Ï›öê7*ðŒ6 zÃm²‡˜ÊØÒ$â "C(Xˆ(§‡FІ9}ë®~C 㵨7Ì€@ b°Ãx0ØØÀPD”?'‚]¼¡#Äuµƒ%hØ×…u€Ip70Ø×B!ŒØ Ÿ P®ÐkǨ]àÁ™·ÍÇ ÕVà7 ”ð€‡«¸“ÿB<È[á…#ê0^Z'alÿ+ „@ãW‚0úI²œ Ì '9-Q… lÀ ô¤Èd+hA ×ø8Pðí‚«%çù 5q 'pÄ#q+€£J˜ùƇQ‚('BWÀDÏ­>CTzÛÀÆ"^Ø6¬ƒ`&É7›Ú %  ª°î3Œ¡ W§»QÁ >HÀf€¶gÜ@Ø¢ #”„\ ˆ´¯}ã~ðG 2‰`¬ÂÈu§<ƾÁ T€L4š­°ŽbØ‚F ‚À±¡x?!ã@”  ˆ+X¢ò³o\0×ah¡óhNê9ÿ€`œþ 4¸):¯!; ´g~Óºè=eu ‰Ft€ø¯ÁÒL‘èTG~òÍ'ªxЂ” VØ6ØÏ‹¦³Ý@ëKóúw—_ÿß2&¬—ˆà¿5ȸøÓ8è„x»®‰;Ø?\•Sð?°ø€R`¿mû£Ô¸@…hûóñ‹@4“*Є“±.Xø:4“}>šC¹‰(üƒ·ÜÁA…Os,a@f 4x¿|‚H‚è„0À¯€ƒ1x@¬BëЃ$©*X„ „ `_“„8@8={‰gè>È€®1ÿ°B8œŽ*8>èZp.8ÐDpA¤jƒ_Áxl¸¨:èLƒ®@ü‹CH”Œþ„*à7.”„œ1`„AL¼™K»'¨üˆ¨‚òœ1X¾H\ÅÆ€€>x†$`ë[‡5xƒLÜ0" }è.*x˜9X›gˆµ7dEe\ L8… ‚²³' ?¼87 „ ˜*@F0ø2ˆ'6ôŠ?ƒIXFt<Š.0pBó¨ÆQs€¸2d†à=GÓ(‚4HG€ S°!(«+ºö+¬X‡H`:Žó²Sx†(°ƒÿ€ÌÈŸ… ¸‡ÝKH&ƒ­’Ú€ø£Aè„«ÈÒ€P|Éè‚þÉös€n€¿Ô[½Ž˜„þbD‘<˜ J2pw¤É0ÔA$†{èˆoˆ1Ÿ$Ç+Є „É€ê3ÊA³L½:ðˆ.¸œ’¡ª›Ê—älã=¬»rÀÉAÄàp‚°” KL$ðÃsÇmsADˆìLT(™?ƒS°ËŒ4ƒt¿X`‚[l?Dp‡ŽðA>˜²1ˆÅÈg`L&Û®ˆ6ÁÊÉd;#ðˆShÅ‚1èƒÎLÇË+Jµ D-()£t€d;7ðKè‚;ù­ÿ"H¸Ø\FO£Í4ûE%Ð"(Âm µ_ˆ¿'ÀÇŽð1ˆrD€(Îe hLnSºûNˆL&ÛDb ¹'pK¨gAî\EX„l2¤Äè;ɤ‚$dÏŽ0…H5BÙ¹ø´Â{ O#t¥D}¨OÏC<õ¤øÍ#6`D,Ð8D•5 |%ˆóä6N †þü8‚;ƒ+0> ÃgjôÐÐÈ”ÌÝŒPÔy1K_ Î…CX¾ä7çLÐ%¾à*°¯yÍ C@„¥IÝDšóƒ¥ôLAÐΑ‹Òý ‚E°¾LÈY L=ÿìPÑóP SÄ €<8ÒÜÌÑí{‚Þô]‹²!`n¡ÓôX[¸À35­Ü>5­éƒ^i:ÀPCÝÁgX(/ 35Í ÀÒíCBý‡€Ï‘ÍT´ù€‚AhƒF%40QHÝ8ØÒލð‹3¹sÕ¶( XƒPMȘ[SõÜtRÓÐNa%A=€h‚vƒ*¸J|THE(8ÕÀš ½P©œÖýó/@ó(¸€d5dV`Tf Ð.x<Ó`5DWýû/ÀAE€ °¾nUSõFHíJÐ"¨A-¿>øUÿKEˆÀD´‚Qå8`†+йŸè(¸+ΜØò3€Œ3³Ø…¸hN#µh€C€‚„)9°€‚ÛÐYY–m>L(‚{=³X(Ø È2LË?¨àÔÖdì ÐW˜U‰MZÚCGðš3` è‚0Y1ˆ( ÕX1¨‚Ÿ¸Á®‘³`%Ûæ«Ø÷”[…Ë‘‡S™vs h#ƒŸ@><ù¿×R¾=S€Ó ’[( ~dcà ^ž‹°¹ã=’§J1hÕÀ§êWä€7ÔÅ^yp³yÝs)§Ý… ‰· ƒ¥©ƒ7‚\ö½:0 Ú¼íÞÌô'îeëÐÀšÓ°û `«ãQíqZH‚~¦•)‚®í‰Æû@;/S ^¸NØÝ®ù°=¶‚<Ä4Š€ahÓ¾º{87S8Ø…*Kú0  °Û¦¼X·8ûQ ~&î‚Q$Š€s\âºëR7£ƒ(î4€Ò¢x¤Õâÿ«Ó5yðè•ìœ×Û…º, Tà %Vcº‹hõ ˆ€8ö0Èb¢xÓ4èW=¾:Mxß¼€ ð§•‚õÔK×Eö–oð©ä©‚ ~Y¯I„"€Í£0…±ÍäoYå±. Ðg¢__TÞÁ@U,LÚa¯8û­e8ì‚~’€håE»PLöå¬Ö“Ä*ZϨddž=°zð ffÚÎ ±˜f+ŒXffN¾1Ðo®Â*¿àG^4E(Û=çûóbPÛ •çÔ–€€k^a³(*ÖgìƒñZç{1h»^ƒ¦=K¸¹€ ÿ€†3v,ŸE¶Z™º½iý€®`1(8äw` –Ü4H]²h©¯˜‘h^ê2 3™„c⹤'¦ƒÏµjwÂê2ùH[8ÅÎk]±®<¸µ…c|a°&â·¦=ЭgÈ\ÝE¾ëºs(k¾þhÀž=(°œÂŽ3B)âÄî91˜…½¦ëÇŽlÊë„YH‡Æ®kŒÆlžƒ×’]¯ 1(hÐm1˜ëÎá¥Nm’{Ü íÜLئ;Ì£í8ÂÛ¾ºÿ €]–º]pàÞî¹*˜]®kM+n’«=Ðå£bææ920]FI[ééÞ4=8…–:9xíí®6.öšÏiÑñVÝqþ ÓþìôƵÕuæ´ei~ï›((Ú×+ °o…ó(p3ÛRöokƒÎÛ!ö·o°óâ8æ³/í×Ý/€ì G²ç%çâP°ïpëƒä»‚gƒØL5ñ1êÖÝ…]8R`3”ö`‹]06ðëG2`n]°HKrã~¢]€#טS&§°Nxr:ˆò¹•ƒÿ²®ò¦1…'O…*‹Ùÿ¿ö/sŒ9…'P69`‹¶fs srŲƒH¶+`ƒª¶süÂsÅò ÷‘" r@Ÿ®.@éw  ÷`ßs_ðvwGwo+dÛs îzï¨m«Ã Gí~o§*€å.‚P8b,øŽê„ÈJ5ÑÑ wø^"ƒ{N9 w‹g§ \‰ïòŽo§ÿîŸyŽú÷ö…:FywöÒàe~wyvJ¬ûƒƒf§yw²ùó Z×ùÚñó¸‚<z_ZtMR»6ú_ªƒDHƒ4˜Beú_ê‚øgv¶D·úF²/8°…¢÷úFú†¸¤. KH´{¹Ÿ{º¯{»¿{¼Ï{½ß{¾ï{¿ÿ{À|Á|Â/|Ã?|ÄO|Å_|Æo|Ç|È|ÉŸ|ʯ|Ë¿|ÌÏ|ͯü€!ù ÿ,Kÿÿ H° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jÜȱ£Ç CŠI²¤É“(Sª\ɲ¥Ë—0cÊœI³¦Í›8sêÜɳ§ÏŸ@ƒ J´¨Ñ£H“*]Ê´©Ó§P£JJµªÕ«X³jÝʵ«×¯`ÊK¶¬Ù³hÓª]˶­Û·pãÊK·®Ý»xóêÝË·¯ß¿€S}öL°áà #^̸±ãÇ#KžL¹²å˘3kÞ̹³çÏ C‹Mº´éÓ¨S«^ͺuC®cïT,»¶íÛ¸sëÞÍ»·ïßÀƒ N¼¸ñãÈ“+_μ¹óçУKŸN½ºõëØ³kßν»÷ïàËÿO¾¼ùóèÓ«_Ͼ½û÷ðãËŸO¿¾ýûøóã}áP‹AìÐ÷À¦eÏÜÓB @à ? €Ð‚F$´ÈØ3þÄa †¢?AA2¶ƒ"¶è"’âaϸÄ!.æ"<⌂=sˆ-è¨#Iðð#€=CJé¢?U‘!“}ùã†jHébøƒe“´PqÎ]z â7ñ͘AÞL€„š ’D púõ -Ü‚…wâù IÜÓg_ lÀ7XHR ž À'Z ¼ræ7ð“)öÈÓo' IÜtÓmˆ(w¯û.ÀKÄj¶ @F‚P…'5Î5d»’Œ—4îø‘ÓÝÕ'ëh7=sì%Ìjd ̤=T-D¶‡(N»þ-$èÌûµ¯Ûî»)ô ëèRÞÃÌDÝ¢9:0®< Àx"…'±_ÝÃ4ÑS[§@ĤR&a„—² ÅÁ„1 âSžÔœ¹BÔ¢}9[pç hy©p^ªÂ¥~ru€HªÅZ7>t0,}ꩤ€)Ð]ýX$%L«'Kðˆ°Õ!l|$xÕWc4È\ ÿ$¡&†. ?ÙC @„x$"ÁEIfµ5Œà†²½„*Ra9¨2RÀ‡y3q ŒP¨qK‚c£ Ѽ=™;ZÐàmÈc‹È°Wíœ-ª€-ƒ/–¼à¡à$Tk óÀ*æ„iHèý Lð…jÈ`ÊXëò[3òw XCò Ë¡À!²E‘DT…¡Fb<„¬)x0f°(ƒ{  t!¼@ŒjìÊ_ƒ°Š.à5ø‚FÕL àÏp‚@€b7@,€ö.lp€†!Úxx~ i8^› ÏèÅr©#aǬf!ˆÂ-¢ ¼D{ÿý‡;×¢o¬[;Hí3@Š @!ü8l21RXâHƒ5PìDPšÀÆÌ°1ŒJC["°reG拤9H¨Ctê(}cl!"yˆªPêgTa»«QÍŸêM{ = Ù ²‡yxÂ8 P‡m|@D'¸"LñŒ/P‚¹ÈB¶Œì‚Õ  !ÒeõÄÁ„[Qàln¼¡´ êEÚÉ0‹~¶( öØæ—`Þ5ž‚Œ ²‡ô˜Æ3v‹BdaÐÆÎÀ3RÑJô@ñÑÆ ¤À⫹µò9D‘y´ ´¢3è Sk¹£Üt6½ÿ‹NÍÚ)ãªë?‹W2‡¯A`l# YÆÐ0i(ü@ ;= ÐG—çÕL9Ò ‚3rÛ—q "ý¢#bómS"UPoVPö‡ f@q†€ Ë0€ÆFvðPht ilP;×-4KP€Ñ—u ˜#< zÖ'sþ rÈy.o9ò FðKø I ¶@šÀ!M0Ø`0 vpgl x ’VÛa—Àbr£Y<ø—ç ?Ø"APW:2L¦U"ˆB4ñ&Ôu(` up@à @`,ÿhl8ƒQ‡ 7 ñ$;×ІQkÐ q"2—#÷@‡°¦T_’‡‡â‡q<;’å÷ º1Pp‰Ppa‰ p"`6 2ð4‰%€=¤‰q9yPI†‚'£˜ŒFbFø <ð„–À|`pa`Wl` &ph` 9a„•>†01ÄØYZ¡ÅŒîøŽ„Š ("ß81PtÄfptÀpE@ U`X8P3±ã ÄÈY€°Vù^²<+D®lû¶  p*·åàë`v “]›–A‹»@´É82}+"÷ppW8mb²…{Uð q«¸é—n a w˵‰dˆ¾* ŠB@ ¢çI÷V!½P$¡+lò ¦+·m`àÀ 'ð¸>Kºxc‰°eE`GÙ9Ìð­²KëÆ]Áë¨ÿ04Å«¸Ç‹ ¯+àl g †g°·kˆ0œéŽ•¢$¡#6¶À\€ÁÐB0wß‹ÏÀ j˜ã‹µ²P«}ÐP6I–¡P¨ZtÇ€D°€¿µk}Ùe)›þ¦;¶jÂsÀ!‡Pº \$ `m€+°‹€(ð( (pò‹r œu¼J0@ÂÀö ƒ:&4L` €ÃÅk=8{±mp¼¥lÌÆO<†P ð@ˆà@îx£Ó²H+!w& „Z¨3 à;ÿÐjÒŽì“j ëÁ}À ë0 lº*” r+ ‘ðmJðñklŠ€% µBÒ º¨‘ß¶®è1Lj?< r!0ñ -³[8â´µÖ#åZI*+ÁŠz°ð4@™,·|œ¸å€±± ¡Ã019ƒ,0A'ª%0Âù žc ßÊTè§#þ`ö¼á"²†/'ÒÇû°   / D˜ N`ÛðÍIHºëÉHŒmüÆtÚ‚Š0Àüq9L@(ðèHj´Bè%ßT]ÔìjFÀ ÒE²2}%$ãŠX8ª¼»—¤ÿ£’q€Å„‹“N@€0@ÆÕL­‡!KÐ TO€ ¡Œ-` * †CPð÷Ð 4Àp½!’}ÉèBÀ Lz&ÇOá6 þ± õ&Aë2$$ÓÅ%M$òLd@«< Š 5÷9(]šÀ =-(àB]Ͷ`°­‚°ÐØÌÆJpÏ  v †F· “p9íÕÉx<`«HJÓ™›# P&'+ È9ˆI‘÷PsIà†ŒÀ÷q@1÷×Ô àcˆ=¾VÁSØ`Ä‘ÍÆ(p ÔÿŠ-àk`&ÈøŽøÂfNÿë&K)£] ÜV×F"6ð€Ì(L¶Ê² L.oLФW fí½ÑÁ&Â-5 9;¾ÇÛ— ÍÝÆ~  q ¢ªP@÷ð4 ç°ÝÉ rÚKøÂ s¯¬#ß@LºÅúÛcAx% âÂBÀ(l;ÐÚS2‘¶p³ÑÑ`Žp’9|º0ÍnÌa —Ý‚l° ÅßÀ‰ýá%›g@‚ïØÎ¶`ûŽ+"åöÄ;PÞÊ dpíÑÙeû̧0 ahQpئë ÊÙŒ(%߸xW ñ %Ä ®Òäk"ÚÀ¤½3æxÿ¢ÑÅ ˆ‰$ÛCßà½ÐÅdµ*yΈßÉQ“ ò(PÍ;®ÔÎÆ~0à°µÆÖàŽÊ¢§’&P®<°®'§Öª¹®&•⪔zR$SŸ$è ³n‰¢Ì @àn`£® ÊOÐ=»Ó» ¨“`íÈŒ-Po.ŽèÉxßWkÎw0 4]®IsÆþ7 ÇT|°ˆŽ@¶ðÒàçpÍ¡<ʦ`¦÷Xlhà |®÷ã Ú-§’I[«õ÷°½ °Â`&¢á÷þ"g“«Ãa³Õ€ë°ˆàæqÿÊþFÌ 1 a»ˆ PÕ­¾r¢ UòR22è×}L±@à­üKôðˆ$ ïÂQûàa`’PV€‹°}ºÔÞÐðOPGÞ`0‹c(FÞ‡¨ÿþÐ PÎ’ŒÂoKï­½`ÞNÿŽ"µº1° K`à’@DPÆ.ÀÔLMÄØLÄ`d N°Cà íþ@DN_4«šÞx/P[X´º½ï%÷!‰ìȲ´ŸÈb® ϼÜÏp q m°@@ðõ‹ë¿ð ~P !ÀÐHl qgÏЂðónO kàåÿ\» ]aÄä 82\ …Ì ‡ÀéÐú.’Û‰¤·ŠÖAn;`#6Rÿø/̸|¶ßþ $XÐàA„ .dØÐáCˆ%NTØÂTZKÊ•›à悃!E¶)wA@9LÌ< âÉ1‘yÖ€€CVA øð^ Kž %ZÔèQ¤ÏxØãá/©QAcÆL€‘COµnÝzïP!Uª0ã!$H÷¾ ¥8³žqåÎ¥[×.Å.  @Y®ÍçHŠ$¼ÎƒP´ ¡…ž‚<â<ËpSA¢" î"|Fk )®¡‡~ rO«¿ U€±Ê£ÅZѱµÞAƈÿ!;âò·vóoàÁ…ÿ À $"—ëK8$É6+écÙòÉ&¸-ѬŒ“€ˆ0ÄBpãFöù¡-x`f¯B! ÐÏöÍ_#ö‚ݹcë}i¡w‚(0ˆ ÈbÀ8vØ¡@³t‹#ŽxƒÀ¾M<;ôÐÃ*YBçD’æœÛȈøE‰–³„ =Œx&Ë@€;cÆ)ú¶j™^v¶ ·úwxË–f¹c*ïàâ=Ê2KP„0ËÀvH°¬ðA½¼- *°*‰Û‚á­ë´óΈ˜¹`W<ñ0ÚhÐAQtÀb` ÿ{d:寇˜"&— ˆ$ŸB2Óúî ‚‡ ŠÂ=.‚á‚ [l¢’"CNçÓ‚C‚0¢Š$^ÃsW^ñtã ú\ñ°‹ý³/IôQT‰&bBåQqRà+xòð!xØ4Öùh#ðVö*×–S¹B!*<äHnÛ= ‚üŒ°¶Wzëî•CHv_¬(¥±–>a` gLTZj[°‚\ÝåÊ>w’hOÜ7s;dÝ·Ö8¶Cª0‚R{Cy¢üŒ_”Û "EŸè‡ .Æ#G:ä˜ÑÎgŒe㢖\Ê{¬%ˆCLãùhú†LbÞ‘›vú gJ –0Qvÿ.Ùê”$;Pv˜á1:Áó©2n‚8’(µt{CúíXw¨ÀƧë~ &¦‰Šôµz#I"©®¥ÿ# ',kà1 àÕvˆ•Œ È57 ùàÖ¼]w*ÀÔnÐíu¦½ýZ9„ªþÛ *ué‚Cڜƨ¢×œm¤‚ʹˆÜì­Ô@b‰%˜`C#byæ—÷‹Øã`` $Ôgó %¾'tîw _„%*ˆHq_I˜`Ì%:”pj`ÛëmA σ€Œ¬´úfxHBeÎ ` x@:ƒX` шnt tÁ-`PŠR L8Xÿ@¢<<@€Z€`NÛ‚Û!ìA“îŰC ÐN+là JxÂ/\à7ôÀuJˆ…Ò‚HaEàQ½ P!¸ëK˜@&x@& ÝGº‘À@ƒ B$´ … ¬a 4 Á68VàøU/Bø<â±o Ð 7ˆÅìyÈ@†Ocl™ ¹™~¤NEV(À²ˆÁ+ Œu® 1–0o0#Ò¢C,z=#U0}¾Àr8 t¼F&l Qè@Þh’^ЂÂZ4TŸt¤£.Cñ–;„À&{ø‘‡`a’\èŽGÿfó.Z@Äù6B’_d-Lð&Õ·¾'8ƒ  ™X°½=±èy¥°0K2°΀AQƒ(`€´ØÛPY¯gÐ&Nj«*4§L  ÕfE#ò ´â†"IŸZö AíË ÔAç b È'‰`ƒ ö1²o$¡ ±Ñ=S Ån4Âb¤Â¡7 Å7ެ“²å$÷äŠ]çYÓ,úT†Ü#@tŽ´°C—"¤}" ËЩ‚L¢JÄ X™‘a‹ ýKŠ&@pÜÔÎàD)˜€Æ ¸¡+„jBžAÌ  Ñù”CT€ }elBÔ@…r>‡ÿã{B,º¹¯CŒ1D4â?¾q‚øáä¾0ÅÓ&€Ã"A÷äF#°à&P € D *ašÆBÄ-B/<¶ jÅ< hnûzîKP=G&ƒÈÉ– @BK‡1t¡nÏØAz ù,Á²L'€¢^B>Æ]æ3üaöØsH!CÉ^‹öÎV¬`…È*g|ë‹QáþÑ Ðc¥Eˆèê£7h €HÑü çÁƒ—ZùŒCü(ÃP]‚üû7~9 ‰"ð¢Ap€¬ß9e÷Ž2â¹÷™V ÂZ¾9[498‡QÜ'I±Å.ÿ1é@Pq²*,pj­Ü“„î Mòlq¯:"Ô€E0¿õ¢%£ í†`…}YÎqqï­Ñ$/ÏÙißXE ¢°øÈ+‚f Œ&$‰ßvÁ=Gš"ߨAà”gIÛK «AJàˆ pBÐ(v€  £ø‹&ev3ýjݶÀ;€õÓÄPäz þa™Câ€BŸú Ox±¢½`ÔZÙ ©Ï²GÖ…4ü ¹FÀ*î pY¤:$0ဃœB¡%JPeg§[Ýö"¬q8P»³ˆ¨:’ux•1Oh':k.[PÄÿкn„'|Wš€B”é @Ü  g9%Ѻ͢àe ‰@ŽÑéÒ*\ä#çÐ7¼£ùQ[S¨Á``…‚³e€‚?b „vq`0É}þóâXWZ‰ 6ØÀhaÌ&Iú3ì;¬ü¾ãÑEŽpžßè[ç:E €Ðâ¹ ¢ˆEP¡ç8Œ Pð„Ypºç 1…¢ü¸ºë{çûB&á…(ëHå6 É̺P Р~˜ÅÆ^„#V'zÞµÛwÌgÞ³ ]N/9Ƀ@Ã*p]tƒs\ç—ÉõÜ5ÿú®÷! a¯|®m0Ïî "»;5ÿ¡14@‰°ní“ {äP¦Ý´m XÝ;žG€¦>6'¢ ˜HƒÁó\?ùãwöß?²S6é¼´°^„>(d c *þv¬³ â'ÿa}ÊK?šh?i!8ƒÈ;ˆCàz›US°Ø?ÿ«Àt‹;;Á…t @]ˆ3„¨‚4Hƒß»?°  |Ae³ ¼?ˆ¸TAÖC€°¿„80÷ ƒ0X,LBIƒ ÐÀïÂK¤ž;¾„°„N K8 TB0œ3që<ô³!B¬A_¸¼‡˜ÿ»û C9´²I1Ú!c0Pˆ–öK9 A‡è;H„›CCıgƒö£è>l¿3(/࿃¨à@ˆ€ZôŽ–²9ˆ€PƒûEgÌ&AÔ@¨‚Q"@¢+V<ˆ'ã€|Fo”¡o•’€jl¿DƒSŒƒlüFxPðÄët46Ô­wŒG~¤»ôÁ3øÃ~ˆD‚ØL¹°´Mÿá|ˆKƒ øÀ4¬¶‰NæL˜ÅšÌddlNë4ˆ*àfH‡è[Dw„ë O) x†î켇c OñDaÊL*dI`Oñt[ˆÏÌDê´Ïðì.ÐO”œNtóÏÚÔ{ˆÎöC¿à4Ðæ„fPÐ΋ÄÂtPæü1 ¥8ð… ´Ðád†o`?ŸD@mÎ>H \©ï,Qæd0HQHÏeQÉì=€Qô›DÎSH)¥Dƒ1°€ÎN0t]¨Ð!EM=HJÚIÏ^\ÒÈĹÀó<èF)íL¬R¬ÃÆ,EÍÐ…À#¸1PÒ/L<Úù¸ÿ+ÈÇ3=LÓ'-»u|ÓÃü, ü(´x²SÃü†­”–24˜Q?uJ<¥3€Â`,=Ô¬|ª”2_8Þ;€](ú”T²´GEÝ…F…Â+àA±ôÔœ`N`^`n`~`Ž` ž` ®` ¾` Î` Þ`î`þ`aa.a>aFÛ€!ùÿ,Kÿÿ H° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jÜȱ£Ç CŠI²¤É“(Sª\ɲ¥Ë—0cÊœI³¦Í›8sêÜɳ§ÏŸ@ƒ J´¨Ñ£H“*]Ê´©Ó§P£JJµªÕ«X³jÝʵ«×¯`ÊK¶¬Ù³hÓª]˶­Û·pãf|öL®Ý»5éâÝË·¯ß¿€ L¸°áÈ+^̸±ãÇ#KžL¹²å˘3kÞ̹³çÏ C‹Mº´éÓ¨S«^ͺµë×°cËžM»¶íÛ¸sëÞÍ»·ïßÀƒ N¼¸ñãÈ“+_μ¹óçУKŸN½ºõëØ³kßν»÷ïàËÿO¾¼ùóèÓ«_Ͼ½û÷ðãËŸO¿¾ýûøóëßÏ¿¿ÿÿ(à€O=#Š+7ÀÏ ¯äáŠxàÏ ÔE `H8Ï RHQe”Ñ¡8t8À41L=¨Æ=~ä aÑŒfô7ÜÁwŒz A¨Bª!`=sA €À?‚p^#Èñ‰þ¯¬S{. š.¨N5“ý1ÙØA'HDrí…2Ëέ«$—†iz|­ìrÓ…¬ ³@ZPkFûƒÅxF *Ð ø#°Ìø~ìç_íàÐæ6·%kÔb°€0¼`ƒ1ˆ t­k])H HŽÀÆþoÀ7¾jûÖåíNs €0‹_ àrÿÆw©U›[Õz|㩇°LàˆX„?ø@ ¬Ã m8G0pL#`Oz¬a€/Üb6Â+„8æLþ÷’Ñ‹T @¦ËŒý „ɦ¶5þoÊË=óšO  .(¨€ \€@…ÂP”£ V°E"ÒP:D<éIçôRqˆþ0ú h„´c½Ä‡àÁâU ¿âïÚͪZ!Ü;µßHµ–0I´ÁX€00 ¸¤ðGêÿÑ ðBð{9¬ŒÄ•³ˆO:\9 ‰úx8BBq§}øš9¿B‚k{a̾¼ÿj9_^FW "î°ŒÓÃ\ D9°Ð,Ü¢ZØÄ"êpÄ÷àbPå0¶pxUeU mu%D§^î±jT· pu³†Td \0 5p†¶Ésß 5`v%³`yÏÀ k—Kp¬7X€Î°Tð‡°[ a ß` }ð 8|Ì`vpS*°\`'ɧQŠï_š—zâÇ^þàB°V`Bàî·qóFn%6†Àræ’@Îà ¶þçdð ¦À Ï |à@U%Uˆð`€|uÿ%a» Y^œ§]˜f†U_cH‚&èb\¨Z-`¨·vʶ’p)7°o^a þÐ'|m@bà\¨Qô`UUJCà Pà@°kà\H-l™ˆu‡`Fà‚åfŠ©%Ô¨lðG«ˆÝÀ T`wf˜€ IÐãàˆ„àˆÁ(qC€, ò&(€öÐ ´PHÚÁlϘ‰÷†`zgØHF0ƒåv€«ØÎÀ‹{hš` ¦ˆíØŽ@ð€äYc¿âU°À ·P Ѓê¦-Б·;ÿP“-à:6æd.–kå`ŠòÖoª& sè àHGà÷¶þu0mð‘wb ’$‰xžU%pu¨@ÌPXàœP@´P‰Ññ -“q“;`}½c‹µ>É^’w^˜È^;PÔ¨—ì‘)à Ýà Tð”¯Æßp |Xé+`65’Á8E ,àŒ¿BkkùŠƒ°ù}Ý•gv†{YzÌРdžyÌ0›Œ¶ÞÈŠÎ@9c ñ 숕èy [ ŒÉׄÙvW'Éd‡ uàÎÀ ¥@Tà< [n¹ß@gq0ndÿЯ‰zˆ%}¨fH™fjàߨ L€Ð˜²Fœ xŒÀ 'ÅY@žu"pS‰àHPÐu%ÖZ‹EÜÐ gÉpHvGÕ¦ffmVžÏp`*xy ‘ˆY4 ò5ö9ø‰•€× ‰@òÐCðpÑetpSh€Ep±&„y<¹VP k)šÐPyÙÝÑ'™—d°®™‰êXXמ«˜˜€WÀ ,Ú¢é©GÀ bð¦À"ti¡0T†UEÄ©÷oëz©+0À t˜œ { ;‘åÿAŒ}­–¥X×ÌÀ¥æ¶$ ŸGðRÚ}ɦå°t! `p.°€J pU"µ –ÀgD¢Š¦”‡é ¾ ŽŒpn0“éáaA ¡ÿØ…d`}Zbð¥)€¢(!}w•hª¦¥j€mЭ’À!®áŠ%@€ÔScp Ñg–jH@¬HÝà Þ éºÖç< ƒ’ªl÷vi†åp˜Þ°˜­²UPÌ@o×¢ð+GØŽ’ O ®!ð mߤAjßÐ[s÷Š @LPòñ þP— p„)~ ÿ0‡ÝÀƒÀ ô™ € ]ðZ@ØŠ•BhiêJ ®J0 hpUóÈùº®uY‚^Ho w+Ë£©Q@nòñ t&ÓˆµçžÎà 0¤ð–NàÛ nP´ÜºÃuØê«(p±ãZïH W *F[å†V€ƒ7Ž9àå8ßp¶å5Ëh#šÝp ƒpUÛ- —«.€·YiU ` xå°!뵘mgPXˆ±ÅhË^Kàž½zƒÝ³^¥òff›jß ¬Øoþp N@º€DKœÝÿzÁ`_­Mð(€ û@ðzÀ•Zt SpšaŸÏ{›çP 0Y0àXáà@ªòF÷Ë^Hàá˜г. Ú«i€ œªX) +@5€ ¯Š±µKÿ  Se¸ˆ‹ ñ   «L²Ì Ò*­ T`–)ÔJòf¿Å^ß0L‰0 APüu\ PT - x¨J‚‹±JPùu5'Ù‡ƒÊÆ… à ÎÀ0“k@T €GÕ\ˆ’€ƒÞP  Œ7!1 àúàÄ¢j ÂáúÌ0¿À$SÿPÀßÐ  p÷ ”ÎÀ õÇ Lp@¿óáa´à.ÀŠ)9 ¦9“ QpV ªø­M+Â(p«ÀYhp“àÏÀy«Àm°Š¿Ú ¥ ´°¼Îç„p‡ƒpm©}pÊô(à¬Kœ’ S,®5@]À€Z\¡’Ûx›y¹‘ T0YûA¶»·e5à«,ª Ù\»êJ“P¸Z”US²™j’ÇKÊ¿ ›j¹Ãµ*É º°¶°õŒŸàÄðʃü*\U yü\rË^å‡à¥v4)Œÿ€¤ûÐ a BÀs +àŰü‘V ±¯j a að ¿[,u¼i†©i¹QPZpÄ8½Ÿêv °’ð‹°Õ|•¿àÑO€ €ëù n•ýК ѯû~ÔY‡°þÕÕ ñ €HI€¤€V@D Ñ M‹¾Oд(€`U` `Qgp²,!;Ω†›tè J Ä Ø¡’ÏP-à@ÅЭ-ê¥ð ¿à5p¿P»«(=<` |H‰PPÏÐr&(Ä)À ±—n†Úÿ` d€A |Ì0Ôiºÿ À‘`‚‹íK§ðXÉ¥EhÀì»<ÀÛLé yà À©ÒݤPïZœ’PçÀÊ?' Ð(à´OÒQ÷¶ÞXuÒOjA–XI  ‘P:ŒÚÀ°iÊŽÜŸ·o€ÏâŠÅ€ÞE×ß„Š{dPáiãéÒpL4œêŒÓU@àÇíè·¦ÊÊá ±ðÊ€ûÛJö 4HpÜOž sKÀø×‡Ó gªÑ’`ª®Ý­®MÍ~Û’P L;®à,:måÎ¥0Ñ×…j ÉÝJÆ,M€ÿ@ ’‰ŸmðæLÎæmþw÷,¸O@¡ “uå «p×Q—™hâ‡yƒ–‹ï7¯à)ÎÊøéÊáªM€'ÿ€ µ¦éC@µÁn™Ä¹)â‡îBà¬^ìå°Ñ=Èy0§ð ¦E·þÛÁuæ&•ÚbäÅ •ª²ýû¿àcJIjP&nÍ«Ž¦Ý*¯ü‘Àì ðì p»ÀàÑ šj®¥“;é P— ä'Kiy¹QÄPî혋‘àJ^ì’°S, ¯† FÙ€rpãQg©DP I°F@IŒÀ‹ž•áÊ®gìå Z0ÅOÿ +ûUðŽc åánØ…#ÚàP MZ¡ d ê.ZçpìÆ~Í2OzpSP­óaj>I°¾ ¡…ÁNcòʼnώ-àÐð- õâú‚`È]`ˆ›>]9¾—Ì=Ä0 ½àéëÒ€â’MëØÀ¦0ŸÍ± ërcÐç! þµõ¿ì«L Ð÷x +PÍGQþê!çn€V`±û ì#}ðKVpꜶمyÿ«œ u`û,‚‚ Û­NøëÞÇ¢ªÖG %€”U,€ "!ع/~ Ì¿Z(ÿº2K°‰ï¢Àú«á?™Œ°´ë+õÑ þLÆ`áß ¯ÄKù«„ÞÌüK|H*WÐàÁ6å~=yòk]ƒ­¡$ÄÅOýãá„!ϰÐÃÑäI”)U®ü÷M„g1eΜ¹CHqZøûFó")œ u††›{,•.eÚÔéS¨Q¥N¥ZÕêU¬(ŸÝ€ñ "‘´œsà5¢¤HO0^|Òä™IB6øsTV¦˜Ýóéó›=fBŒ$1Ò ”Aâø“9Ñ¢)Ü@À[ÙòeÌ™5oÞÜoEY³ÛH’:t¹„±,®UKÉS*B* 3æÿç“þ*ôåMó›¿dªT„ÇŽ@Œœyë6”[o¸¥O§^ÝúuŽ 0´±rÚ»W¥*®e;Á$¨0 B&* :½åûôwˆŒf@Ž ¢PŠQ·Fy ; 4ð@ùÉIºúî4+Ò"ï"°0É’B"@¬k‡ùBô •4 †¡‚‰tñEcÄj™"Á ÓŒ¨uT›0#FL‚ÀD*!ºê„ CD&gǨÀ ‡„èIF,³ÔRFJð"-ÁQdzXmBò0é1fS`&±îvhòÎq&À¢,  € haÀ- 5ôÐÌPaÿ"J˜eÆ$³6~9s­'\;©¹BúƒK®£³ï3‚!ÜÙaPù–jÏF\ðs 7!Q\sÕ•)]ðUîЂ‘Òtœh<òÔ²¥>™Ž+ªÀîf`š¯>Z¢— ˜I"‰ XõI6„r®güÄ€˜vu÷]]™ ãE~-áŽHœið;Q‹µ'ô1¥*œ]±ÓíΙ ø°Š^„hÁÚ™&pÆÜ¡öLwƒ ܹ^Cv@J{gÑ¢œîBƒÙŠ”ðAM•"èTDD¸B©‚aŸ@p‡‡$¡§˜€Â˜¨=]`‚âøXdª«Æÿm"ŸáW(¢(@Ò³ô9S‰',\‰M7é@àŠP hÞZ¥êìé–† ‹>µ¸ÀN«ü2>tQo®3~aŠrˆ4GÎñ1£Y¼@R%Sì8\Äå0¥Àg˜al¾oZâÞî ‚è$c]ÈööÆ…5h¨cêÁs×½©ÒØü_a7( )•„ %È~ÂÜ[ ëÍ@cm Ô+Dîû¶2Pïëw¾@ƒRøŽ²p\ð›²Ýã—¥*Ø<‘àE0T7€ ²t#(xÞDP„Û¬$¾› þÖvAMò‡PðÀVó(*°ÿ0vë['rÌO…óÃDÖ4T/_éT1 @*€tÀ³0 ¯ä@†•<£òpð ‡N蓾!t‹MäÍ!.° pB}ëÃB7Pƒì­PŒƒû†ˆ8›ÄýŠƒÊäÑ aEØZ w!'•|£d h€zŒ8iÈ@€[L*X7ˆÏ' 6P€¢°Ð3.7FL†Ìéi`ðXP‰gÀ1mhAEPø¥ä@Òà;µ!` Ò;lQH™‚$Uo°±ADÂÝÀÂúºÁ¸#“Ë„W8P=" ƒªÞl@€Äÿá,Ñ£T`K¨`Cð…^„—à2&ßBà1Þ ÁF¡Â6ƒnx£J#1ˆø0S ¸j Eò+"nb¨õÈ–0€•]hIÉ®gs¾IèE–€5Œ£ HBÙ—{”#X`Ä: @‹óJ8´„KT§2zÆ KØ |h¨5뵋¶©„q)É3Ä` ˜ÀºˆÑ3ñ*Pá(¬0ø "Ñ!zA˜^ÎoBñ#´Pƒmt`k B æŽÁ;嫌úÀÀÙÔK6 …nÆÐ 2•)áTD¤ØÀÿäé3 7l@ p߈à ióiAª`%šHÂ\ÝGhÀƒ:Ü¥hDJ±‰¤ôU·âÁ3Ý4_  ‡u“-€»–X %ሰ`¯†z†?x@…ͺ€OE‘ø2Ÿ1cŠÃXs´ºƒ' FÙÍnÝ‹Mg¾2AhXTo e ˜Ë‘S$"ƒ®,+„ Ѐ ü˜3ÊÚùÜÃ&×–†®,BjßàÁ"¨P ÷½#ÆL †FÔ÷¾ mp¯Ä§tBœÀ㮞‚^lb¶ÄLPü]Þp¸I`•…cgÞ ¤ðqÿ¸Jb(kƬ,®XP74q,X,SLˆlÉ@ˆBºx13`´~ŽÅI¦€ Hée<_Æ#Õüƒ xe†¢a }J$p‚éŠ>›Ð‚3šƒf,Hb ò!CŒð%ЀÁ&øg*ϣΊ)Ny” €6êøëT@”µÚ7z Ø•(i^sÃ& =‘}b†­H}ì«`‚ʳi˜Áj é/©MÑãÁ¡‚9€”7v"L ¼ñGI=I.:ƒ /Av»¥ò 0´v€5ˆ»žSæt)šZ´»gðàpÿ·‡Òc}»/šÀ#½¾FpB ·swÅ› À†$ }hcQé Í¨TÛ¨˜ß7êàÈ<ÍP¸O0Aƒ50˜„XÀºlqœ É~nJƒŠÔÐ?ì7*ßÐEWpäZåBa9J‘ƒ2HÁ@”s¬ÃæÔ‰è~ß´ BEįÃ6rÈôØ“¦É8ÜŠëír‘ HaÖsÞ‚kÈ À/âtìoÂì[<¸3š>$tƒkˆ ;,¤€W·{ÅŸ7À ²ihΠ@rd?Ãe¦é®õ¥†™À¹¨AJ»F0;¨|Å# ‚Ã5À š:È+ÿ yˆÝJ'€ú˜äÍ8BJA|.ÊY@µG¶%ò./äÝMgð-+~£ýÛX`@LîÁ•6‚õkÿ‘Kˆ±S·h ö@† ºXF:@bJ»h:#s4Nx)* <¦½¿QƒN94NÊ<£Ã:X„#p¼âs†ãS©Œñ†Rˆ‚ÆS¹Œq H4$±¿RC˸P¡«¼8¨-x½ƒ+€¼nˆ„ÿƒ¾õ¹€CXA(ã“ €Á7Aß«¼o¨€Ah¿Â#!oà„(8‚ÿXnØ€#B÷ò@ D18.ê 8?` Ô4¦qÿ—¢‚p(¦ØÉ8ðÂ÷€ôh€Ã:â2ô‡;ØdCgÈ&¨p5,& èB;ä+И7ߪ2+Ä\¢(ÈBCdšn  €<à§¢À‚¨»Hä+1`¥0€‚Ÿ› à$"|!h½5üÄ<€mˆ,¦q зU\¦Nð°!h(¨—)ˆ¿œD¶O$Š*D }ê'&h¯b¨`%0XF†.P±Ã€«0A6䛨x¾bê*£od¦oøˆqô•?@,ðZ#ÂCˆ*x¼jø€,ÀBté† ¨Ã|d¦* °ÿ8 #âBƒö(Æo( pÇwlƒ(؆5ЀÈƉ\&P0x6:âJœg,Æg è¬j$Š< [0ôɱ•Ĥp ƒ*@>’7àšb$BÀ&IMkŸ Ø °Ç (Ê1b;H‚…b1à:’‰¤–¬ÜÉŒÙBwˆ €•äʪH‚Pº7àĉ 8-C´¤$#ð „$€Ëê/øQb¨?°²›+Æ:p¾¬F/ÚCø$L݃8…º:(Ð+ʨ,ª$¡n(…Eø†oÈ-ÌŒ(`†Ît“û̧ôH‡CË¢pË!lMù©‚ÝHÌߢMÿÌD…˜ÊECä›AØJÞÜLˆj‰&$L:Á©«F,|\NÁ™ºÄ/A{5Ì ¸5PÀãÄ‚(píø™¢jF_øí ‚œŒÌO¼NÚKÏZ‹öžiãM  OCä† €FüD”' ËŸbÌ… Ð"´ì@8Pª 0KálP€ÐÄ‚ `M …1È€¢:ƒèÄOØÒDK˜Ð™à;ÄR„1Ø¿ÍÀvÜÉnÀU|Ñ]©MØ… ÑoX„©ÜI€MuSHy¢&} ÈÑO\½ûlÒ\1í;(à.ý ­j”<åÒ9…ÿe› Ž$4.%Îô©O*¨5Å•NÈkª@ðÓEàP6L¢¼SCÑù¢+ö;…€ù4ÄF ;B5”ŠÅÅ<€;‹ÔðöûD¸TLÍ0d¶!€‚Ú|Ñ8Èê<²EhÌOEPE£"°èƒS QZ Äw,€Á|U.ÑÓ@_°68a¨W Ñé,M,X„4õÕé@…6£] Ö"8€+@¥H}[Øãì'!„VY¥Xô;(%ƒÓY@M; q}=ª8 Ut½6ø»H…€MHSœ: ¸Õx•ŽË;£¨×s•%9ПËTS-ŠØÍ5ÿ`(88€]¨#&L˜O ‚INpÑŠ-Šü-åX»€Ö$XãÄ Ø’ÕŒ¸H›8Sb{U7À„Ü4 hØ™N™ à€ U::¥Ð|Õ%:ÈØ)eÚë°£=œ•(¨Iq}.(©Yª­ÚÃ"ð6Ø…@€mXFu½Á€g-[¬(Zfžè"Ëm5x8ˆZ»Í ]H„jb:’ƒÀË¥…³, *ÈÂÅMªžP\&< Øx}†?•ðÓÊÅ «-®øÍÎx}XØ×Ò匨¦fô•18€YZ8ËÀ€tˆ]ÿÍè¦ü¶-ú­Ò ÐP”Yà• á 4:’*6`Øo`¿<ÈÂm^«ÖX Á²]È×dõÕØQˆHXû^€¡àZ8Y(& ÝõÅ hÓRœ]Ù²%Ó`Ýüµ Ö,˜Þòדë…Æ‹þÞÚßuÙgØ„ ˆà¬˜àÐø,ÜC0Æ 4_ÀYØÞЉ¾ T@`‘ƒPØ(ˆavŠ®k¨!ð…P8EÝa"N ‹Òƒã-âõ­>̯+a&žb“àÞ+¢h¡b-æˆIà_ºØÞâžáï…“þã1æ_Ì0†ýAã)&c 4vãõ-£êI„Ü¥ã""†J8c=>á®; ø˜ã@nÞ°ƒ4H°ƒFaÞD.]1°€E怨ò¾I>á.ð‚°d @Þäüõ1Ð…=À„%&eW~eXŽeYžeZ®e[¾e\Îe]Þe^îe_þe`fafb.fc>fdNfe^ffnfg~fhŽfižfj®fk¾flÎfmÞfnîfoþfpgqgr.gs>gtNgu^gvngw~gt;php-4.4.8/ext/gd/tests/bug24155.phpt0000644000175000017500000000104510157773075016225 0ustar derickderick--TEST-- Bug #24155 (gdImageRotate270 rotation problem). --SKIPIF-- --FILE-- --EXPECT-- cc867fd65c30883463ce58d0341f0997 php-4.4.8/ext/gd/tests/bug37346.phpt0000644000175000017500000000063710427647767016251 0ustar derickderick--TEST-- Bug #37346 (gdimagecreatefromgif, bad colormap) --SKIPIF-- --FILE-- --EXPECTF-- Warning: imagecreatefromgif() [%s]: '%sbug37346.gif' is not a valid GIF file in %sbug37346.php on line %d php-4.4.8/ext/gd/tests/bug22544.phpt0000644000175000017500000000126610157773075016232 0ustar derickderick--TEST-- Bug #22544 (TrueColor transparency in PNG images). --SKIPIF-- --FILE-- --EXPECT-- 10a57d09a2c63fad87b85b38d6b258d6 php-4.4.8/ext/gd/tests/bug27582_1.phpt0000644000175000017500000000132710223750146016443 0ustar derickderick--TEST-- Bug #27582 (ImageFillToBorder() on alphablending image looses alpha on fill color) --SKIPIF-- --FILE-- --EXPECT-- 08287f8f5d406946009df5f04ca83dc0 php-4.4.8/ext/gd/config.m40000644000175000017500000003505010574526535014522 0ustar derickderickdnl dnl $Id: config.m4,v 1.120.2.25.2.1 2007/03/10 13:06:37 pajoye Exp $ dnl dnl dnl Configure options dnl PHP_ARG_WITH(gd, for GD support, [ --with-gd[=DIR] Include GD support where DIR is GD install prefix. If DIR is not set, the bundled GD library will be used.]) if test -z "$PHP_JPEG_DIR"; then PHP_ARG_WITH(jpeg-dir, for the location of libjpeg, [ --with-jpeg-dir[=DIR] GD: Set the path to libjpeg install prefix.], no, no) fi if test -z "$PHP_PNG_DIR"; then PHP_ARG_WITH(png-dir, for the location of libpng, [ --with-png-dir[=DIR] GD: Set the path to libpng install prefix.], no, no) fi if test -z "$PHP_ZLIB_DIR"; then PHP_ARG_WITH(zlib-dir, for the location of libz, [ --with-zlib-dir[=DIR] GD: Set the path to libz install prefix.], no, no) fi PHP_ARG_WITH(xpm-dir, for the location of libXpm, [ --with-xpm-dir[=DIR] GD: Set the path to libXpm install prefix.], no, no) PHP_ARG_WITH(ttf, for FreeType 1.x support, [ --with-ttf[=DIR] GD: Include FreeType 1.x support], no, no) PHP_ARG_WITH(freetype-dir, for FreeType 2, [ --with-freetype-dir[=DIR] GD: Set the path to FreeType 2 install prefix.], no, no) PHP_ARG_WITH(t1lib, for T1lib support, [ --with-t1lib[=DIR] GD: Include T1lib support.], no, no) PHP_ARG_ENABLE(gd-native-ttf, whether to enable truetype string function in GD, [ --enable-gd-native-ttf GD: Enable TrueType string function.], no, no) PHP_ARG_ENABLE(gd-jis-conv, whether to enable JIS-mapped Japanese font support in GD, [ --enable-gd-jis-conv GD: Enable JIS-mapped Japanese font support.], no, no) dnl dnl Checks for the configure options dnl AC_DEFUN([PHP_GD_JPEG],[ if test "$PHP_JPEG_DIR" != "no"; then for i in $PHP_JPEG_DIR /usr/local /usr; do test -f $i/lib/libjpeg.$SHLIB_SUFFIX_NAME -o -f $i/lib/libjpeg.a && GD_JPEG_DIR=$i && break done if test -z "$GD_JPEG_DIR"; then AC_MSG_ERROR([libjpeg.(a|so) not found.]) fi PHP_CHECK_LIBRARY(jpeg,jpeg_read_header, [ PHP_ADD_INCLUDE($GD_JPEG_DIR/include) PHP_ADD_LIBRARY_WITH_PATH(jpeg, $GD_JPEG_DIR/lib, GD_SHARED_LIBADD) ],[ AC_MSG_ERROR([Problem with libjpeg.(a|so). Please check config.log for more information.]) ],[ -L$GD_JPEG_DIR/lib ]) else AC_MSG_RESULT([If configure fails try --with-jpeg-dir=]) fi ]) AC_DEFUN([PHP_GD_PNG],[ if test "$PHP_PNG_DIR" != "no"; then for i in $PHP_PNG_DIR /usr/local /usr; do test -f $i/lib/libpng.$SHLIB_SUFFIX_NAME -o -f $i/lib/libpng.a && GD_PNG_DIR=$i && break done if test -z "$GD_PNG_DIR"; then AC_MSG_ERROR([libpng.(a|so) not found.]) fi if test "$PHP_ZLIB_DIR" = "no"; then AC_MSG_ERROR([PNG support requires ZLIB. Use --with-zlib-dir=]) fi if test ! -f $GD_PNG_DIR/include/png.h; then AC_MSG_ERROR([png.h not found.]) fi PHP_CHECK_LIBRARY(png,png_write_image, [ PHP_ADD_INCLUDE($GD_PNG_DIR/include) PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR/lib, GD_SHARED_LIBADD) PHP_ADD_LIBRARY_WITH_PATH(png, $GD_PNG_DIR/lib, GD_SHARED_LIBADD) ],[ AC_MSG_ERROR([Problem with libpng.(a|so) or libz.(a|so). Please check config.log for more information.]) ],[ -L$PHP_ZLIB_DIR/lib -lz -L$GD_PNG_DIR/lib ]) else AC_MSG_RESULT([If configure fails try --with-png-dir= and --with-zlib-dir=]) fi ]) AC_DEFUN([PHP_GD_XPM],[ if test "$PHP_XPM_DIR" != "no"; then for i in $PHP_XPM_DIR /usr/local /usr/X11R6 /usr; do test -f $i/lib/libXpm.$SHLIB_SUFFIX_NAME -o -f $i/lib/libXpm.a && GD_XPM_DIR=$i && break done if test -z "$GD_XPM_DIR"; then AC_MSG_ERROR([libXpm.(a|so) not found.]) fi for i in include include/X11; do test -f $GD_XPM_DIR/$i/xpm.h && GD_XPM_INC=$GD_XPM_DIR/include done if test -z "$GD_XPM_INC"; then AC_MSG_ERROR([xpm.h not found.]) fi PHP_CHECK_LIBRARY(Xpm,XpmFreeXpmImage, [ PHP_ADD_INCLUDE($GD_XPM_INC) PHP_ADD_LIBRARY_WITH_PATH(Xpm, $GD_XPM_DIR/lib, GD_SHARED_LIBADD) PHP_ADD_LIBRARY_WITH_PATH(X11, $GD_XPM_DIR/lib, GD_SHARED_LIBADD) ],[ AC_MSG_ERROR([Problem with libXpm.(a|so) or libX11.(a|so). Please check config.log for more information.]) ],[ -L$GD_XPM_DIR/lib -lX11 ]) else AC_MSG_RESULT(If configure fails try --with-xpm-dir=) fi ]) AC_DEFUN([PHP_GD_FREETYPE1],[ if test "$PHP_TTF" != "no"; then if test "$PHP_FREETYPE_DIR" = "no" -o "$PHP_FREETYPE_DIR" = ""; then if test -n "$PHP_TTF"; then for i in $PHP_TTF /usr/local /usr; do if test -f "$i/include/freetype.h"; then TTF_DIR=$i unset TTF_INC_DIR fi if test -f "$i/include/freetype/freetype.h"; then TTF_DIR=$i TTF_INC_DIR=$i/include/freetype fi if test -f "$i/include/freetype1/freetype/freetype.h"; then TTF_DIR=$i TTF_INC_DIR=$i/include/freetype1/freetype fi test -n "$TTF_DIR" && break done fi if test -n "$TTF_DIR" ; then AC_DEFINE(HAVE_LIBTTF,1,[ ]) PHP_ADD_LIBRARY_WITH_PATH(ttf, $TTF_DIR/lib, GD_SHARED_LIBADD) fi if test -z "$TTF_INC_DIR"; then TTF_INC_DIR=$TTF_DIR/include fi PHP_ADD_INCLUDE($TTF_INC_DIR) else AC_MSG_RESULT([no - FreeType 2.x is to be used instead]) fi fi ]) AC_DEFUN([PHP_GD_FREETYPE2],[ if test "$PHP_FREETYPE_DIR" != "no"; then for i in $PHP_FREETYPE_DIR /usr/local /usr; do if test -f "$i/include/freetype2/freetype/freetype.h"; then FREETYPE2_DIR=$i FREETYPE2_INC_DIR=$i/include/freetype2 break fi done if test -n "$FREETYPE2_DIR" ; then PHP_ADD_LIBRARY_WITH_PATH(freetype, $FREETYPE2_DIR/lib, GD_SHARED_LIBADD) PHP_ADD_INCLUDE($FREETYPE2_DIR/include) PHP_ADD_INCLUDE($FREETYPE2_INC_DIR) AC_DEFINE(USE_GD_IMGSTRTTF, 1, [ ]) AC_DEFINE(HAVE_LIBFREETYPE,1,[ ]) else AC_MSG_ERROR([freetype2 not found!]) fi else AC_MSG_RESULT([If configure fails try --with-freetype-dir=]) fi ]) AC_DEFUN([PHP_GD_T1LIB],[ if test "$PHP_T1LIB" != "no"; then for i in $PHP_T1LIB /usr/local /usr; do test -f "$i/include/t1lib.h" && GD_T1_DIR=$i && break done if test -z "$GD_T1_DIR"; then AC_MSG_ERROR([Your t1lib distribution is not installed correctly. Please reinstall it.]) fi PHP_CHECK_LIBRARY(t1, T1_LoadFont, [ AC_DEFINE(HAVE_LIBT1,1,[ ]) PHP_ADD_INCLUDE($GD_T1_DIR/include) PHP_ADD_LIBRARY_WITH_PATH(t1, $GD_T1_DIR/lib, GD_SHARED_LIBADD) ],[ AC_MSG_ERROR([Problem with libt1.(a|so). Please check config.log for more information.]) ],[ -L$GD_T1_DIR/lib ]) fi ]) AC_DEFUN([PHP_GD_TTSTR],[ if test "$PHP_GD_NATIVE_TTF" = "yes"; then AC_DEFINE(USE_GD_IMGSTRTTF, 1, [ ]) fi ]) AC_DEFUN([PHP_GD_JISX0208],[ if test "$PHP_GD_JIS_CONV" = "yes"; then USE_GD_JIS_CONV=1 fi ]) AC_DEFUN([PHP_GD_CHECK_VERSION],[ PHP_CHECK_LIBRARY(gd, gdImageString16, [AC_DEFINE(HAVE_LIBGD13, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) PHP_CHECK_LIBRARY(gd, gdImagePaletteCopy, [AC_DEFINE(HAVE_LIBGD15, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) PHP_CHECK_LIBRARY(gd, gdImageCreateFromPng, [AC_DEFINE(HAVE_GD_PNG, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) PHP_CHECK_LIBRARY(gd, gdImageCreateFromGif, [AC_DEFINE(HAVE_GD_GIF_READ, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) PHP_CHECK_LIBRARY(gd, gdImageGif, [AC_DEFINE(HAVE_GD_GIF_CREATE, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) PHP_CHECK_LIBRARY(gd, gdImageWBMP, [AC_DEFINE(HAVE_GD_WBMP, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) PHP_CHECK_LIBRARY(gd, gdImageCreateFromJpeg, [AC_DEFINE(HAVE_GD_JPG, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) PHP_CHECK_LIBRARY(gd, gdImageCreateFromXpm, [AC_DEFINE(HAVE_GD_XPM, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) PHP_CHECK_LIBRARY(gd, gdImageCreateFromGd2, [AC_DEFINE(HAVE_GD_GD2, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) PHP_CHECK_LIBRARY(gd, gdImageCreateTrueColor, [AC_DEFINE(HAVE_LIBGD20, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) PHP_CHECK_LIBRARY(gd, gdImageSetTile, [AC_DEFINE(HAVE_GD_IMAGESETTILE, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) PHP_CHECK_LIBRARY(gd, gdImageEllipse, [AC_DEFINE(HAVE_GD_IMAGEELLIPSE, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) PHP_CHECK_LIBRARY(gd, gdImageSetBrush, [AC_DEFINE(HAVE_GD_IMAGESETBRUSH, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) PHP_CHECK_LIBRARY(gd, gdImageStringTTF, [AC_DEFINE(HAVE_GD_STRINGTTF, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) PHP_CHECK_LIBRARY(gd, gdImageStringFT, [AC_DEFINE(HAVE_GD_STRINGFT, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) PHP_CHECK_LIBRARY(gd, gdImageStringFTEx, [AC_DEFINE(HAVE_GD_STRINGFTEX, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) PHP_CHECK_LIBRARY(gd, gdImageColorClosestHWB, [AC_DEFINE(HAVE_COLORCLOSESTHWB, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) PHP_CHECK_LIBRARY(gd, gdImageColorResolve, [AC_DEFINE(HAVE_GDIMAGECOLORRESOLVE, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) PHP_CHECK_LIBRARY(gd, gdImageGifCtx, [AC_DEFINE(HAVE_GD_GIF_CTX, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) PHP_CHECK_LIBRARY(gd, gdCacheCreate, [AC_DEFINE(HAVE_GD_CACHE_CREATE, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) PHP_CHECK_LIBRARY(gd, gdFontCacheShutdown, [AC_DEFINE(HAVE_GD_FONTCACHESHUTDOWN,1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) PHP_CHECK_LIBRARY(gd, gdFreeFontCache, [AC_DEFINE(HAVE_GD_FREEFONTCACHE, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) PHP_CHECK_LIBRARY(gd, gdNewDynamicCtxEx, [AC_DEFINE(HAVE_GD_DYNAMIC_CTX_EX, 1, [ ])], [], [ -L$GD_LIB $GD_SHARED_LIBADD ]) ]) dnl dnl Main GD configure dnl if test "$PHP_GD" = "yes"; then GD_MODULE_TYPE=builtin extra_sources="libgd/gd.c libgd/gd_gd.c libgd/gd_gd2.c libgd/gd_io.c libgd/gd_io_dp.c \ libgd/gd_io_file.c libgd/gd_ss.c libgd/gd_io_ss.c libgd/gd_png.c libgd/gd_jpeg.c \ libgd/gdxpm.c libgd/gdfontt.c libgd/gdfonts.c libgd/gdfontmb.c libgd/gdfontl.c \ libgd/gdfontg.c libgd/gdtables.c libgd/gdft.c libgd/gdcache.c libgd/gdkanji.c \ libgd/wbmp.c libgd/gd_wbmp.c libgd/gdhelpers.c libgd/gd_topal.c libgd/gd_gif_in.c \ libgd/xbm.c libgd/gd_gif_out.c libgd/gd_security.c" dnl check for fabsf and floorf which are available since C99 AC_CHECK_FUNCS(fabsf floorf) dnl PNG is required by GD library test "$PHP_PNG_DIR" = "no" && PHP_PNG_DIR=yes dnl Various checks for GD features PHP_GD_TTSTR PHP_GD_JISX0208 PHP_GD_JPEG PHP_GD_PNG PHP_GD_XPM PHP_GD_FREETYPE2 PHP_GD_FREETYPE1 PHP_GD_T1LIB dnl These are always available with bundled library AC_DEFINE(HAVE_LIBGD, 1, [ ]) AC_DEFINE(HAVE_LIBGD13, 1, [ ]) AC_DEFINE(HAVE_LIBGD15, 1, [ ]) AC_DEFINE(HAVE_LIBGD20, 1, [ ]) AC_DEFINE(HAVE_LIBGD204, 1, [ ]) AC_DEFINE(HAVE_GD_IMAGESETTILE, 1, [ ]) AC_DEFINE(HAVE_GD_IMAGESETBRUSH, 1, [ ]) AC_DEFINE(HAVE_GDIMAGECOLORRESOLVE, 1, [ ]) AC_DEFINE(HAVE_COLORCLOSESTHWB, 1, [ ]) AC_DEFINE(HAVE_GD_WBMP, 1, [ ]) AC_DEFINE(HAVE_GD_GD2, 1, [ ]) AC_DEFINE(HAVE_GD_PNG, 1, [ ]) AC_DEFINE(HAVE_GD_XBM, 1, [ ]) AC_DEFINE(HAVE_GD_BUNDLED, 1, [ ]) AC_DEFINE(HAVE_GD_GIF_READ, 1, [ ]) AC_DEFINE(HAVE_GD_GIF_CREATE, 1, [ ]) AC_DEFINE(HAVE_GD_IMAGEELLIPSE, 1, [ ]) AC_DEFINE(HAVE_GD_FONTCACHESHUTDOWN,1, [ ]) AC_DEFINE(HAVE_GD_DYNAMIC_CTX_EX, 1, [ ]) AC_DEFINE(HAVE_GD_GIF_CTX, 1, [ ]) dnl Make sure the libgd/ is first in the include path GDLIB_CFLAGS="-DHAVE_LIBPNG" dnl Depending which libraries were included to PHP configure, dnl enable the support in bundled GD library if test -n "$GD_JPEG_DIR"; then AC_DEFINE(HAVE_GD_JPG, 1, [ ]) GDLIB_CFLAGS="$GDLIB_CFLAGS -DHAVE_LIBJPEG" fi if test -n "$GD_XPM_DIR"; then AC_DEFINE(HAVE_GD_XPM, 1, [ ]) GDLIB_CFLAGS="$GDLIB_CFLAGS -DHAVE_XPM" fi if test -n "$FREETYPE2_DIR"; then AC_DEFINE(HAVE_GD_STRINGFT, 1, [ ]) AC_DEFINE(HAVE_GD_STRINGFTEX, 1, [ ]) GDLIB_CFLAGS="$GDLIB_CFLAGS -DHAVE_LIBFREETYPE" fi if test -n "$TTF_DIR"; then GDLIB_CFLAGS="$GDLIB_CFLAGS -DHAVE_LIBTTF" fi if test -n "$USE_GD_JIS_CONV"; then AC_DEFINE(USE_GD_JISX0208, 1, [ ]) GDLIB_CFLAGS="$GDLIB_CFLAGS -DJISX0208" fi else if test "$PHP_GD" != "no"; then GD_MODULE_TYPE=external extra_sources="gdcache.c" dnl Various checks for GD features PHP_GD_TTSTR PHP_GD_JPEG PHP_GD_PNG PHP_GD_XPM PHP_GD_FREETYPE2 PHP_GD_FREETYPE1 PHP_GD_T1LIB dnl Header path for i in include/gd1.3 include/gd include gd1.3 gd ""; do test -f "$PHP_GD/$i/gd.h" && GD_INCLUDE="$PHP_GD/$i" done dnl Library path for i in lib/gd1.3 lib/gd lib gd1.3 gd ""; do test -f "$PHP_GD/$i/libgd.$SHLIB_SUFFIX_NAME" -o -f "$PHP_GD/$i/libgd.a" && GD_LIB="$PHP_GD/$i" done if test -n "$GD_INCLUDE" && test -n "$GD_LIB"; then PHP_ADD_LIBRARY_WITH_PATH(gd, $GD_LIB, GD_SHARED_LIBADD) AC_DEFINE(HAVE_LIBGD,1,[ ]) PHP_GD_CHECK_VERSION elif test -z "$GD_INCLUDE"; then AC_MSG_ERROR([Unable to find gd.h anywhere under $PHP_GD]) else AC_MSG_ERROR([Unable to find libgd.(a|so) anywhere under $PHP_GD]) fi PHP_EXPAND_PATH($GD_INCLUDE, GD_INCLUDE) dnl dnl Check for gd 2.0.4 greater availability dnl old_CPPFLAGS=$CPPFLAGS CPPFLAGS=-I$GD_INCLUDE AC_TRY_COMPILE([ #include #include ], [ gdIOCtx *ctx; ctx = malloc(sizeof(gdIOCtx)); ctx->gd_free = 1; ], [ AC_DEFINE(HAVE_LIBGD204, 1, [ ]) ]) CPPFLAGS=$old_CPPFLAGS fi fi dnl dnl Common for both builtin and external GD dnl if test "$PHP_GD" != "no"; then PHP_NEW_EXTENSION(gd, gd.c gdttf.c $extra_sources, $ext_shared,, \\$(GDLIB_CFLAGS)) if test "$GD_MODULE_TYPE" = "builtin"; then GDLIB_CFLAGS="-I$ext_srcdir/libgd $GDLIB_CFLAGS" PHP_ADD_BUILD_DIR($ext_builddir/libgd) else GDLIB_CFLAGS="-I$GD_INCLUDE $GDLIB_CFLAGS" PHP_ADD_INCLUDE($GD_INCLUDE) PHP_CHECK_LIBRARY(gd, gdImageCreate, [], [ AC_MSG_ERROR([GD build test failed. Please check the config.log for details.]) ], [ -L$GD_LIB $GD_SHARED_LIBADD ]) fi PHP_SUBST(GDLIB_CFLAGS) PHP_SUBST(GD_SHARED_LIBADD) fi php-4.4.8/ext/gd/gdcache.c0000644000175000017500000001160610170316233014516 0ustar derickderick/* * $Id: gdcache.c,v 1.5.2.3 2005/01/09 21:05:31 sniper Exp $ * * Caches of pointers to user structs in which the least-recently-used * element is replaced in the event of a cache miss after the cache has * reached a given size. * * John Ellson (ellson@lucent.com) Oct 31, 1997 * * Test this with: * gcc -o gdcache -g -Wall -DTEST gdcache.c * * The cache is implemented by a singly-linked list of elements * each containing a pointer to a user struct that is being managed by * the cache. * * The head structure has a pointer to the most-recently-used * element, and elements are moved to this position in the list each * time they are used. The head also contains pointers to three * user defined functions: * - a function to test if a cached userdata matches some keydata * - a function to provide a new userdata struct to the cache * if there has been a cache miss. * - a function to release a userdata struct when it is * no longer being managed by the cache * * In the event of a cache miss the cache is allowed to grow up to * a specified maximum size. After the maximum size is reached then * the least-recently-used element is discarded to make room for the * new. The most-recently-returned value is always left at the * beginning of the list after retrieval. * * In the current implementation the cache is traversed by a linear * search from most-recent to least-recent. This linear search * probably limits the usefulness of this implementation to cache * sizes of a few tens of elements. */ #include "php.h" /* This just seems unessacary */ #if PHP_WIN32 #define ENABLE_GD_TTF #else #include #endif #if (HAVE_LIBTTF | HAVE_LIBFREETYPE) && !defined(HAVE_GD_CACHE_CREATE) #include "gdcache.h" /*********************************************************/ /* implementation */ /*********************************************************/ /* create a new cache */ gdCache_head_t * gdCacheCreate( int size, gdCacheTestFn_t gdCacheTest, gdCacheFetchFn_t gdCacheFetch, gdCacheReleaseFn_t gdCacheRelease ) { gdCache_head_t *head; head = (gdCache_head_t *)pemalloc(sizeof(gdCache_head_t), 1); head->mru = NULL; head->size = size; head->gdCacheTest = gdCacheTest; head->gdCacheFetch = gdCacheFetch; head->gdCacheRelease = gdCacheRelease; return head; } void gdCacheDelete( gdCache_head_t *head ) { gdCache_element_t *elem, *prev; elem = head->mru; while(elem) { (*(head->gdCacheRelease))(elem->userdata); prev = elem; elem = elem->next; pefree((char *)prev, 1); } pefree((char *)head, 1); } void * gdCacheGet( gdCache_head_t *head, void *keydata ) { int i=0; gdCache_element_t *elem, *prev = NULL, *prevprev = NULL; void *userdata; elem = head->mru; while(elem) { if ((*(head->gdCacheTest))(elem->userdata, keydata)) { if (i) { /* if not already most-recently-used */ /* relink to top of list */ prev->next = elem->next; elem->next = head->mru; head->mru = elem; } return elem->userdata; } prevprev = prev; prev = elem; elem = elem->next; i++; } userdata = (*(head->gdCacheFetch))(&(head->error), keydata); if (! userdata) { /* if there was an error in the fetch then don't cache */ return NULL; } if (i < head->size) { /* cache still growing - add new elem */ elem = (gdCache_element_t *)pemalloc(sizeof(gdCache_element_t), 1); } else { /* cache full - replace least-recently-used */ /* preveprev becomes new end of list */ prevprev->next = NULL; elem = prev; (*(head->gdCacheRelease))(elem->userdata); } /* relink to top of list */ elem->next = head->mru; head->mru = elem; elem->userdata = userdata; return userdata; } /*********************************************************/ /* test stub */ /*********************************************************/ #ifdef GDCACHE_TEST #include typedef struct { int key; int value; } key_value_t; static int cacheTest( void *map, void *key ) { return (((key_value_t *)map)->key == *(int *)key); } static void * cacheFetch( char **error, void *key ) { key_value_t *map; map = (key_value_t *)malloc(sizeof(key_value_t)); map->key = *(int *)key; map->value = 3; *error = NULL; return (void *)map; } static void cacheRelease( void *map) { free( (char *)map ); } int main(char *argv[], int argc) { gdCache_head_t *cacheTable; int elem, key; cacheTable = gdCacheCreate(3, cacheTest, cacheFetch, cacheRelease); key = 20; elem = *(int *)gdCacheGet(cacheTable, &key); key = 30; elem = *(int *)gdCacheGet(cacheTable, &key); key = 40; elem = *(int *)gdCacheGet(cacheTable, &key); key = 50; elem = *(int *)gdCacheGet(cacheTable, &key); key = 30; elem = *(int *)gdCacheGet(cacheTable, &key); key = 30; elem = *(int *)gdCacheGet(cacheTable, &key); gdCacheDelete(cacheTable); return 0; } #endif #endif /* ENABLE_GD_TTF */ php-4.4.8/ext/gd/gdcache.h0000644000175000017500000000550007631420004014517 0ustar derickderick/* * $Id: gdcache.h,v 1.2.14.2 2003/03/05 16:04:20 iliaa Exp $ * * Caches of pointers to user structs in which the least-recently-used * element is replaced in the event of a cache miss after the cache has * reached a given size. * * John Ellson (ellson@lucent.com) Oct 31, 1997 * * Test this with: * gcc -o gdcache -g -Wall -DTEST gdcache.c * * The cache is implemented by a singly-linked list of elements * each containing a pointer to a user struct that is being managed by * the cache. * * The head structure has a pointer to the most-recently-used * element, and elements are moved to this position in the list each * time they are used. The head also contains pointers to three * user defined functions: * - a function to test if a cached userdata matches some keydata * - a function to provide a new userdata struct to the cache * if there has been a cache miss. * - a function to release a userdata struct when it is * no longer being managed by the cache * * In the event of a cache miss the cache is allowed to grow up to * a specified maximum size. After the maximum size is reached then * the least-recently-used element is discarded to make room for the * new. The most-recently-returned value is always left at the * beginning of the list after retrieval. * * In the current implementation the cache is traversed by a linear * search from most-recent to least-recent. This linear search * probably limits the usefulness of this implementation to cache * sizes of a few tens of elements. */ /*********************************************************/ /* header */ /*********************************************************/ #if (!defined(_OSD_POSIX) && !defined(__FreeBSD__)) && HAVE_MALLOC_H #include #else #include /* BS2000/OSD defines malloc() & friends in stdlib.h */ #endif #ifndef NULL #define NULL (void *)0 #endif /* user defined function templates */ typedef int (*gdCacheTestFn_t)(void *userdata, void *keydata); typedef void *(*gdCacheFetchFn_t)(char **error, void *keydata); typedef void (*gdCacheReleaseFn_t)(void *userdata); /* element structure */ typedef struct gdCache_element_s gdCache_element_t; struct gdCache_element_s { gdCache_element_t *next; void *userdata; }; /* head structure */ typedef struct gdCache_head_s gdCache_head_t; struct gdCache_head_s { gdCache_element_t *mru; int size; char *error; gdCacheTestFn_t gdCacheTest; gdCacheFetchFn_t gdCacheFetch; gdCacheReleaseFn_t gdCacheRelease; }; /* function templates */ gdCache_head_t * gdCacheCreate( int size, gdCacheTestFn_t gdCacheTest, gdCacheFetchFn_t gdCacheFetch, gdCacheReleaseFn_t gdCacheRelease ); void gdCacheDelete( gdCache_head_t *head ); void * gdCacheGet( gdCache_head_t *head, void *keydata ); php-4.4.8/ext/gd/php_gd.h0000644000175000017500000001353310736114307014415 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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 | +----------------------------------------------------------------------+ */ /* $Id: php_gd.h,v 1.44.2.5.8.5 2007/12/31 07:22:47 sebastian Exp $ */ #ifndef PHP_GD_H #define PHP_GD_H #define HAVE_GDIMAGECREATEFROMPNG 1 #if HAVE_LIBTTF|HAVE_LIBFREETYPE #define ENABLE_GD_TTF #endif #if HAVE_LIBGD /* open_basedir and safe_mode checks */ #define PHP_GD_CHECK_OPEN_BASEDIR(filename, errormsg) \ if (!filename || filename == empty_string || php_check_open_basedir(filename TSRMLS_CC) || \ (PG(safe_mode) && !php_checkuid(filename, NULL, CHECKUID_CHECK_FILE_AND_DIR)) \ ) { \ php_error_docref(NULL TSRMLS_CC, E_WARNING, errormsg); \ RETURN_FALSE; \ } #define PHP_GDIMG_TYPE_GIF 1 #define PHP_GDIMG_TYPE_PNG 2 #define PHP_GDIMG_TYPE_JPG 3 #define PHP_GDIMG_TYPE_WBM 4 #define PHP_GDIMG_TYPE_XBM 5 #define PHP_GDIMG_TYPE_XPM 6 #define PHP_GDIMG_CONVERT_WBM 7 #define PHP_GDIMG_TYPE_GD 8 #define PHP_GDIMG_TYPE_GD2 9 #define PHP_GDIMG_TYPE_GD2PART 10 #ifdef PHP_WIN32 #define PHP_GD_API __declspec(dllexport) #else #define PHP_GD_API #endif PHPAPI extern const char php_sig_gif[3]; PHPAPI extern const char php_sig_jpg[3]; PHPAPI extern const char php_sig_png[3]; extern zend_module_entry gd_module_entry; #define phpext_gd_ptr &gd_module_entry /* gd.c functions */ PHP_MINFO_FUNCTION(gd); PHP_MINIT_FUNCTION(gd); PHP_MSHUTDOWN_FUNCTION(gd); #if HAVE_LIBGD20 && HAVE_GD_STRINGFT PHP_RSHUTDOWN_FUNCTION(gd); #endif PHP_FUNCTION(gd_info); PHP_FUNCTION(imagearc); PHP_FUNCTION(imageellipse); PHP_FUNCTION(imagechar); PHP_FUNCTION(imagecharup); PHP_FUNCTION(imageistruecolor); PHP_FUNCTION(imagecolorallocate); PHP_FUNCTION(imagepalettecopy); PHP_FUNCTION(imagecolorat); PHP_FUNCTION(imagecolorclosest); PHP_FUNCTION(imagecolorclosesthwb); PHP_FUNCTION(imagecolordeallocate); PHP_FUNCTION(imagecolorresolve); PHP_FUNCTION(imagecolorexact); PHP_FUNCTION(imagecolorset); PHP_FUNCTION(imagecolorstotal); PHP_FUNCTION(imagecolorsforindex); PHP_FUNCTION(imagecolortransparent); PHP_FUNCTION(imagecopy); PHP_FUNCTION(imagecopymerge); PHP_FUNCTION(imagecopyresized); PHP_FUNCTION(imagetypes); PHP_FUNCTION(imagecreate); PHP_FUNCTION(imageftbbox); PHP_FUNCTION(imagefttext); #ifdef HAVE_LIBGD20 PHP_FUNCTION(imagecreatetruecolor); PHP_FUNCTION(imagetruecolortopalette); PHP_FUNCTION(imagesetthickness); PHP_FUNCTION(imagefilledellipse); PHP_FUNCTION(imagefilledarc); PHP_FUNCTION(imagealphablending); PHP_FUNCTION(imagesavealpha); PHP_FUNCTION(imagecolorallocatealpha); PHP_FUNCTION(imagecolorresolvealpha); PHP_FUNCTION(imagecolorclosestalpha); PHP_FUNCTION(imagecolorexactalpha); PHP_FUNCTION(imagecopyresampled); #endif #ifdef HAVE_GD_BUNDLED PHP_FUNCTION(imagerotate); PHP_FUNCTION(imageantialias); #endif PHP_FUNCTION(imagesetthickness); PHP_FUNCTION(imagecopymergegray); PHP_FUNCTION(imagesetbrush); PHP_FUNCTION(imagesettile); PHP_FUNCTION(imagesetstyle); PHP_FUNCTION(imagecreatefromstring); PHP_FUNCTION(imagecreatefromgif); PHP_FUNCTION(imagecreatefromjpeg); PHP_FUNCTION(imagecreatefromxbm); PHP_FUNCTION(imagecreatefrompng); PHP_FUNCTION(imagecreatefromwbmp); PHP_FUNCTION(imagecreatefromgd); PHP_FUNCTION(imagecreatefromgd2); PHP_FUNCTION(imagecreatefromgd2part); #if defined(HAVE_GD_XPM) && defined(HAVE_GD_BUNDLED) PHP_FUNCTION(imagecreatefromxpm); #endif PHP_FUNCTION(imagegammacorrect); PHP_FUNCTION(imagedestroy); PHP_FUNCTION(imagefill); PHP_FUNCTION(imagefilledpolygon); PHP_FUNCTION(imagefilledrectangle); PHP_FUNCTION(imagefilltoborder); PHP_FUNCTION(imagefontwidth); PHP_FUNCTION(imagefontheight); PHP_FUNCTION(imagegif ); PHP_FUNCTION(imagejpeg ); PHP_FUNCTION(imagepng); PHP_FUNCTION(imagewbmp); PHP_FUNCTION(imagegd); PHP_FUNCTION(imagegd2); PHP_FUNCTION(imageinterlace); PHP_FUNCTION(imageline); PHP_FUNCTION(imageloadfont); PHP_FUNCTION(imagepolygon); PHP_FUNCTION(imagerectangle); PHP_FUNCTION(imagesetpixel); PHP_FUNCTION(imagestring); PHP_FUNCTION(imagestringup); PHP_FUNCTION(imagesx); PHP_FUNCTION(imagesy); PHP_FUNCTION(imagedashedline); PHP_FUNCTION(imagettfbbox); PHP_FUNCTION(imagettftext); PHP_FUNCTION(imagepsloadfont); /* PHP_FUNCTION(imagepscopyfont); */ PHP_FUNCTION(imagepsfreefont); PHP_FUNCTION(imagepsencodefont); PHP_FUNCTION(imagepsextendfont); PHP_FUNCTION(imagepsslantfont); PHP_FUNCTION(imagepstext); PHP_FUNCTION(imagepsbbox); PHP_FUNCTION(jpeg2wbmp); PHP_FUNCTION(png2wbmp); PHP_FUNCTION(image2wbmp); #if HAVE_GD_BUNDLED PHP_FUNCTION(imagelayereffect); PHP_FUNCTION(imagecolormatch); PHP_FUNCTION(imagefilter); #endif PHP_GD_API int phpi_get_le_gd(void); #else #define phpext_gd_ptr NULL #endif #endif /* PHP_GD_H */ php-4.4.8/ext/gd/gdttf.c0000644000175000017500000005542410170316233014256 0ustar derickderick/* gd interface to freetype library */ /* */ /* John Ellson ellson@lucent.com */ /* $Id: gdttf.c,v 1.16.10.4 2005/01/09 21:05:31 sniper Exp $ */ #include "php.h" #if PHP_WIN32 #include "config.w32.h" #else #include #endif #if HAVE_LIBTTF && !defined(USE_GD_IMGSTRTTF) #include #include #include #include #include #include "gdttf.h" #include "gdcache.h" #include #ifndef HAVE_GDIMAGECOLORRESOLVE extern int gdImageColorResolve(gdImagePtr, int, int, int); #endif /* number of fonts cached before least recently used is replaced */ #define FONTCACHESIZE 6 /* number of character glyphs cached per font before least-recently-used is replaced */ #define GLYPHCACHESIZE 120 /* number of bitmaps cached per glyph before least-recently-used is replaced */ #define BITMAPCACHESIZE 8 /* number of antialias color lookups cached */ #define TWEENCOLORCACHESIZE 32 /* ptsize below which anti-aliasing is ineffective */ #define MINANTIALIASPTSIZE 0 /* display resolution - (Not really. This has to be 72 or hinting is wrong) */ #define RESOLUTION 72 /* Number of colors used for anti-aliasing */ #undef NUMCOLORS #define NUMCOLORS 4 /* Line separation as a factor of font height. No space between if LINESPACE = 1.00 Line separation will be rounded up to next pixel row*/ #define LINESPACE 1.05 #ifndef TRUE #define FALSE 0 #define TRUE !FALSE #endif #ifndef MAX #define MAX(a, b) ((a)>(b)?(a):(b)) #endif #ifndef MIN #define MIN(a, b) ((a)<(b)?(a):(b)) #endif typedef struct { char *fontname; /* key */ double ptsize; /* key */ double angle; /* key */ double sin_a, cos_a; TT_Engine *engine; TT_Face face; TT_Face_Properties properties; TT_Instance instance; TT_CharMap char_map_Unicode; TT_CharMap char_map_Big5; TT_CharMap char_map_Roman; int have_char_map_Unicode; int have_char_map_Big5; int have_char_map_Roman; TT_Matrix matrix; TT_Instance_Metrics imetrics; gdCache_head_t *glyphCache; } font_t; typedef struct { char *fontname; /* key */ double ptsize; /* key */ double angle; /* key */ TT_Engine *engine; } fontkey_t; typedef struct { int character; /* key */ int hinting; /* key */ TT_Glyph glyph; TT_Glyph_Metrics metrics; TT_Outline outline; TT_Pos oldx, oldy; TT_Raster_Map Bit; int gray_render; int xmin, xmax, ymin, ymax; gdCache_head_t *bitmapCache; } glyph_t; typedef struct { int character; /* key */ int hinting; /* key */ int gray_render; font_t *font; } glyphkey_t; typedef struct { int xoffset; /* key */ int yoffset; /* key */ char *bitmap; } bitmap_t; typedef struct { int xoffset; /* key */ int yoffset; /* key */ glyph_t *glyph; } bitmapkey_t; typedef struct { unsigned char pixel; /* key */ unsigned char bgcolor; /* key */ int fgcolor; /* key */ /* -ve means no antialias */ gdImagePtr im; /* key */ unsigned char tweencolor; } tweencolor_t; typedef struct { unsigned char pixel; /* key */ unsigned char bgcolor; /* key */ int fgcolor; /* key */ /* -ve means no antialias */ gdImagePtr im; /* key */ } tweencolorkey_t; /* forward declarations so that glyphCache can be initialized by font code */ static int glyphTest ( void *element, void *key ); static void *glyphFetch ( char **error, void *key ); static void glyphRelease( void *element ); /* forward declarations so that bitmapCache can be initialized by glyph code */ static int bitmapTest ( void *element, void *key ); static void *bitmapFetch ( char **error, void *key ); static void bitmapRelease( void *element ); /* local prototype */ char *gdttfchar(gdImage *im, int fg, font_t *font, int x, int y, TT_F26Dot6 x1, TT_F26Dot6 y1, TT_F26Dot6 *advance, TT_BBox **bbox, char **next); /******************************************************************** * gdTcl_UtfToUniChar is borrowed from ... */ /* * tclUtf.c -- * * Routines for manipulating UTF-8 strings. * * Copyright (c) 1997-1998 Sun Microsystems, Inc. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * * SCCS: @(#) tclUtf.c 1.25 98/01/28 18:02:43 */ /* *--------------------------------------------------------------------------- * * gdTcl_UtfToUniChar -- * * Extract the Tcl_UniChar represented by the UTF-8 string. Bad * UTF-8 sequences are converted to valid Tcl_UniChars and processing * continues. Equivalent to Plan 9 chartorune(). * * The caller must ensure that the source buffer is long enough that * this routine does not run off the end and dereference non-existent * memory looking for trail bytes. If the source buffer is known to * be '\0' terminated, this cannot happen. Otherwise, the caller * should call Tcl_UtfCharComplete() before calling this routine to * ensure that enough bytes remain in the string. * * Results: * *chPtr is filled with the Tcl_UniChar, and the return value is the * number of bytes from the UTF-8 string that were consumed. * * Side effects: * None. * *--------------------------------------------------------------------------- */ #ifndef CHARSET_EBCDIC #define ASC(ch) (ch) #else /*CHARSET_EBCDIC*/ #define ASC(ch) os_toascii[(unsigned char) (ch)] #endif /*CHARSET_EBCDIC*/ #define Tcl_UniChar int #define TCL_UTF_MAX 3 static int gdTcl_UtfToUniChar(char *str, Tcl_UniChar *chPtr) /* str is the UTF8 next character pointer */ /* chPtr is the int for the result */ { int byte; /* HTML4.0 entities in decimal form, e.g. Å */ byte = *((unsigned char *) str); if (byte == '&') { int i, n=0; byte = *((unsigned char *) (str+1)); if (byte == '#') { for (i = 2; i < 8; i++) { byte = *((unsigned char *) (str+i)); if (byte >= '0' && byte <= '9') { n = (n * 10) + (byte - '0'); } else break; } if (byte == ';') { *chPtr = (Tcl_UniChar) n; return ++i; } } } /* * Unroll 1 to 3 byte UTF-8 sequences, use loop to handle longer ones. */ byte = ASC(*((unsigned char *) str)); if (byte < 0xC0) { /* * Handles properly formed UTF-8 characters between 0x01 and 0x7F. * Also treats \0 and naked trail bytes 0x80 to 0xBF as valid * characters representing themselves. */ *chPtr = (Tcl_UniChar) byte; return 1; } else if (byte < 0xE0) { if ((ASC(str[1]) & 0xC0) == 0x80) { /* * Two-byte-character lead-byte followed by a trail-byte. */ *chPtr = (Tcl_UniChar) (((byte & 0x1F) << 6) | (ASC(str[1]) & 0x3F)); return 2; } /* * A two-byte-character lead-byte not followed by trail-byte * represents itself. */ *chPtr = (Tcl_UniChar) byte; return 1; } else if (byte < 0xF0) { if (((ASC(str[1]) & 0xC0) == 0x80) && ((ASC(str[2]) & 0xC0) == 0x80)) { /* * Three-byte-character lead byte followed by two trail bytes. */ *chPtr = (Tcl_UniChar) (((byte & 0x0F) << 12) | ((ASC(str[1]) & 0x3F) << 6) | (ASC(str[2]) & 0x3F)); return 3; } /* * A three-byte-character lead-byte not followed by two trail-bytes * represents itself. */ *chPtr = (Tcl_UniChar) byte; return 1; } #if TCL_UTF_MAX > 3 else { int ch, total, trail; total = totalBytes[byte]; trail = total - 1; if (trail > 0) { ch = byte & (0x3F >> trail); do { str++; if ((ASC(*str) & 0xC0) != 0x80) { *chPtr = byte; return 1; } ch <<= 6; ch |= (ASC(*str) & 0x3F); trail--; } while (trail > 0); *chPtr = ch; return total; } } #endif *chPtr = (Tcl_UniChar) byte; return 1; } /********************************************************************/ /* font cache functions */ static int fontTest ( void *element, void *key ) { font_t *a=(font_t *)element; fontkey_t *b=(fontkey_t *)key; return ( strcmp(a->fontname, b->fontname) == 0 && a->ptsize == b->ptsize && a->angle == b->angle); } static void * fontFetch ( char **error, void *key ) { TT_Error err; font_t *a; fontkey_t *b=(fontkey_t *)key; int i, n, map_found; short platform, encoding; TSRMLS_FETCH(); a = (font_t *)pemalloc(sizeof(font_t), 1); #ifdef VIRTUAL_DIR /* a->fontname will be freed in fontRelease() later on */ if (virtual_filepath(b->fontname, &a->fontname TSRMLS_CC)) { *error = "Could not find/open font"; pefree(a, 1); return NULL; } #else a->fontname = (char *)pemalloc(strlen(b->fontname) + 1, 1); strcpy(a->fontname, b->fontname); #endif a->ptsize = b->ptsize; a->angle = b->angle; a->sin_a = sin(a->angle); a->cos_a = cos(a->angle); a->engine = b->engine; if ((err = TT_Open_Face(*b->engine, a->fontname, &a->face))) { if (err == TT_Err_Could_Not_Open_File) { *error = "Could not find/open font"; } else { *error = "Could not read font"; } pefree(a, 1); return NULL; } /* get face properties and allocate preload arrays */ TT_Get_Face_Properties(a->face, &a->properties); /* create instance */ if (TT_New_Instance(a->face, &a->instance)) { *error = "Could not create face instance"; pefree(a, 1); return NULL; } if (TT_Set_Instance_Resolutions(a->instance, RESOLUTION, RESOLUTION)) { *error = "Could not set device resolutions"; pefree(a, 1); return NULL; } if (TT_Set_Instance_CharSize(a->instance, (TT_F26Dot6)(a->ptsize*64))) { *error = "Could not set character size"; pefree(a, 1); return NULL; } TT_Get_Instance_Metrics(a->instance, &a->imetrics); /* First, look for a Unicode charmap */ n = TT_Get_CharMap_Count(a->face); for (i = 0; i < n; i++) { TT_Get_CharMap_ID(a->face, i, &platform, &encoding); if ((platform == 3 && encoding == 1) /* Windows Unicode */ || (platform == 2 && encoding == 1) || (platform == 0)) { /* ?? Unicode */ TT_Get_CharMap(a->face, i, &a->char_map_Unicode); a->have_char_map_Unicode = 1; map_found++; } else if (platform == 3 && encoding == 4) { /* Windows Big5 */ TT_Get_CharMap(a->face, i, &a->char_map_Big5); a->have_char_map_Big5 = 1; map_found++; } else if (platform == 1 && encoding == 0) { /* Apple Roman */ TT_Get_CharMap(a->face, i, &a->char_map_Roman); a->have_char_map_Roman = 1; map_found++; } } if (! map_found) { *error = "Unable to find a CharMap that I can handle"; pefree(a, 1); return NULL; } a->matrix.xx = (TT_Fixed) (a->cos_a * (1<<16)); a->matrix.yx = (TT_Fixed) (a->sin_a * (1<<16)); a->matrix.xy = - a->matrix.yx; a->matrix.yy = a->matrix.xx; a->glyphCache = gdCacheCreate( GLYPHCACHESIZE, glyphTest, glyphFetch, glyphRelease); return (void *)a; } static void fontRelease( void *element ) { font_t *a=(font_t *)element; gdCacheDelete(a->glyphCache); TT_Done_Instance(a->instance); TT_Close_Face(a->face); pefree(a->fontname, 1); pefree((char *)element, 1); } /********************************************************************/ /* glyph cache functions */ static int glyphTest ( void *element, void *key ) { glyph_t *a=(glyph_t *)element; glyphkey_t *b=(glyphkey_t *)key; return (a->character == b->character && a->hinting == b->hinting && a->gray_render == b->gray_render); } static void * glyphFetch ( char **error, void *key ) { glyph_t *a; glyphkey_t *b=(glyphkey_t *)key; short glyph_code; int flags, err; int crect[8], xmin, xmax, ymin, ymax; double cos_a, sin_a; a = (glyph_t *)pemalloc(sizeof(glyph_t), 1); a->character = b->character; a->hinting = b->hinting; a->gray_render = b->gray_render; a->oldx = a->oldy = 0; /* create glyph container */ if ((TT_New_Glyph(b->font->face, &a->glyph))) { *error = "Could not create glyph container"; pefree(a, 1); return NULL; } flags = TTLOAD_SCALE_GLYPH; if (a->hinting && b->font->angle == 0.0) { flags |= TTLOAD_HINT_GLYPH; } if (b->font->have_char_map_Unicode) { glyph_code = TT_Char_Index(b->font->char_map_Unicode, a->character); } else if (a->character < 161 && b->font->have_char_map_Roman) { glyph_code = TT_Char_Index(b->font->char_map_Roman, a->character); } else if ( b->font->have_char_map_Big5) { glyph_code = TT_Char_Index(b->font->char_map_Big5, a->character); } if ((err=TT_Load_Glyph(b->font->instance, a->glyph, glyph_code, flags))) { *error = "TT_Load_Glyph problem"; pefree(a, 1); return NULL; } TT_Get_Glyph_Metrics(a->glyph, &a->metrics); if (b->font->angle != 0.0) { TT_Get_Glyph_Outline(a->glyph, &a->outline); TT_Transform_Outline(&a->outline, &b->font->matrix); } /* calculate bitmap size */ xmin = a->metrics.bbox.xMin -64; ymin = a->metrics.bbox.yMin -64; xmax = a->metrics.bbox.xMax +64; ymax = a->metrics.bbox.yMax +64; cos_a = b->font->cos_a; sin_a = b->font->sin_a; crect[0] = (int)(xmin * cos_a - ymin * sin_a); crect[1] = (int)(xmin * sin_a + ymin * cos_a); crect[2] = (int)(xmax * cos_a - ymin * sin_a); crect[3] = (int)(xmax * sin_a + ymin * cos_a); crect[4] = (int)(xmax * cos_a - ymax * sin_a); crect[5] = (int)(xmax * sin_a + ymax * cos_a); crect[6] = (int)(xmin * cos_a - ymax * sin_a); crect[7] = (int)(xmin * sin_a + ymax * cos_a); a->xmin = MIN(MIN(crect[0], crect[2]), MIN(crect[4], crect[6])); a->xmax = MAX(MAX(crect[0], crect[2]), MAX(crect[4], crect[6])); a->ymin = MIN(MIN(crect[1], crect[3]), MIN(crect[5], crect[7])); a->ymax = MAX(MAX(crect[1], crect[3]), MAX(crect[5], crect[7])); /* allocate bitmap large enough for character */ a->Bit.rows = (a->ymax - a->ymin + 32 + 64) / 64; a->Bit.width = (a->xmax - a->xmin + 32 + 64) / 64; a->Bit.flow = TT_Flow_Up; if (a->gray_render) { a->Bit.cols = a->Bit.width; /* 1 byte per pixel */ } else { a->Bit.cols = (a->Bit.width + 7) / 8; /* 1 bit per pixel */ } a->Bit.cols = (a->Bit.cols + 3) & ~3; /* pad to 32 bits */ a->Bit.size = a->Bit.rows * a->Bit.cols; /* # of bytes in buffer */ a->Bit.bitmap = NULL; a->bitmapCache = gdCacheCreate( BITMAPCACHESIZE, bitmapTest, bitmapFetch, bitmapRelease); return (void *)a; } static void glyphRelease( void *element ) { glyph_t *a=(glyph_t *)element; gdCacheDelete(a->bitmapCache); TT_Done_Glyph( a->glyph ); pefree ((char *)element, 1); } /********************************************************************/ /* bitmap cache functions */ static int bitmapTest ( void *element, void *key ) { bitmap_t *a=(bitmap_t *)element; bitmapkey_t *b=(bitmapkey_t *)key; if (a->xoffset == b->xoffset && a->yoffset == b->yoffset) { b->glyph->Bit.bitmap = a->bitmap; return TRUE; } return FALSE; } static void * bitmapFetch ( char **error, void *key ) { bitmap_t *a; bitmapkey_t *b=(bitmapkey_t *)key; a = (bitmap_t *)pemalloc(sizeof(bitmap_t), 1); a->xoffset = b->xoffset; a->yoffset = b->yoffset; b->glyph->Bit.bitmap = a->bitmap = (char *)pemalloc(b->glyph->Bit.size, 1); memset(a->bitmap, 0, b->glyph->Bit.size); /* render glyph */ if (b->glyph->gray_render) { TT_Get_Glyph_Pixmap(b->glyph->glyph, &b->glyph->Bit, a->xoffset, a->yoffset); } else { TT_Get_Glyph_Bitmap(b->glyph->glyph, &b->glyph->Bit, a->xoffset, a->yoffset); } return (void *)a; } static void bitmapRelease( void *element ) { bitmap_t *a=(bitmap_t *)element; pefree (a->bitmap, 1); pefree ((char *)element, 1); } /********************************************************************/ /* tweencolor cache functions */ static int tweenColorTest (void *element, void *key) { tweencolor_t *a=(tweencolor_t *)element; tweencolorkey_t *b=(tweencolorkey_t *)key; return (a->pixel == b->pixel && a->bgcolor == b->bgcolor && a->fgcolor == b->fgcolor && a->im == b->im); } static void * tweenColorFetch (char **error, void *key) { tweencolor_t *a; tweencolorkey_t *b=(tweencolorkey_t *)key; int pixel, npixel, bg, fg; gdImagePtr im; a = (tweencolor_t *)pemalloc(sizeof(tweencolor_t), 1); pixel = a->pixel = b->pixel; bg = a->bgcolor = b->bgcolor; fg = a->fgcolor = b->fgcolor; im = b->im; /* if fg is specified by a negative color idx, then don't antialias */ if (fg <0) { a->tweencolor = -fg; } else { npixel = NUMCOLORS - pixel; a->tweencolor = gdImageColorResolve(im, (pixel * im->red [fg] + npixel * im->red [bg]) / NUMCOLORS, (pixel * im->green[fg] + npixel * im->green[bg]) / NUMCOLORS, (pixel * im->blue [fg] + npixel * im->blue [bg]) / NUMCOLORS); } *error = NULL; return (void *)a; } static void tweenColorRelease(void *element) { pefree((char *)element, 1); } /********************************************************************/ /* gdttfchar - render one character onto a gd image */ static int OneTime=0; static gdCache_head_t *tweenColorCache; char * gdttfchar(gdImage *im, int fg, font_t *font, int x, int y, /* string start pos in pixels */ TT_F26Dot6 x1, TT_F26Dot6 y1, /* char start offset (*64) from x,y */ TT_F26Dot6 *advance, TT_BBox **bbox, char **next) { int pc, ch, len; int row, col; int x2, y2; /* char start pos in pixels */ int x3, y3; /* current pixel pos */ unsigned char *pixel; glyph_t *glyph; glyphkey_t glyphkey; bitmapkey_t bitmapkey; tweencolor_t *tweencolor; tweencolorkey_t tweencolorkey; /****** set up tweenColorCache on first call ************/ if (! OneTime) { tweenColorCache = gdCacheCreate(TWEENCOLORCACHESIZE, tweenColorTest, tweenColorFetch, tweenColorRelease); OneTime++; } /**************/ if (font->have_char_map_Unicode) { /* use UTF-8 mapping from ASCII */ len = gdTcl_UtfToUniChar(*next, &ch); *next += len; } else { /* * Big 5 mapping: * use "JIS-8 half-width katakana" coding from 8-bit characters. Ref: * ftp://ftp.ora.com/pub/examples/nutshell/ujip/doc/japan.inf-032092.sjs */ ch = (**next) & 255; /* don't extend sign */ (*next)++; if (ch >= 161 /* first code of JIS-8 pair */ && **next) { /* don't advance past '\0' */ ch = (ch * 256) + **next; (*next)++; } } glyphkey.character = ch; glyphkey.hinting = 1; /* if fg is specified by a negative color idx, then don't antialias */ glyphkey.gray_render = ((font->ptsize < MINANTIALIASPTSIZE) || (fg <0))?FALSE:TRUE; glyphkey.font = font; glyph = (glyph_t *)gdCacheGet(font->glyphCache, &glyphkey); if (! glyph) return font->glyphCache->error; *bbox = &glyph->metrics.bbox; *advance = glyph->metrics.advance; /* if null *im, or invalid color, then assume user just wants brect */ if (!im || fg > 255 || fg < -255) return (char *)NULL; /* render (via cache) a bitmap for the current fractional offset */ bitmapkey.xoffset = ((x1+32) & 63) - 32 - ((glyph->xmin+32) & -64); bitmapkey.yoffset = ((y1+32) & 63) - 32 - ((glyph->ymin+32) & -64); bitmapkey.glyph = glyph; gdCacheGet(glyph->bitmapCache, &bitmapkey); /* copy to gif, mapping colors */ x2 = x + (((glyph->xmin+32) & -64) + ((x1+32) & -64)) / 64; y2 = y - (((glyph->ymin+32) & -64) + ((y1+32) & -64)) / 64; tweencolorkey.fgcolor = fg; tweencolorkey.im = im; for (row = 0; row < glyph->Bit.rows; row++) { if (glyph->gray_render) pc = row * glyph->Bit.cols; else pc = row * glyph->Bit.cols * 8; y3 = y2 - row; if (y3 >= im->sy || y3 < 0) continue; for (col = 0; col < glyph->Bit.width; col++, pc++) { if (glyph->gray_render) { tweencolorkey.pixel = *((unsigned char *)(glyph->Bit.bitmap) + pc); } else { tweencolorkey.pixel = (((*((unsigned char *)(glyph->Bit.bitmap) + pc/8)) <<(pc%8))&128)?4:0; } /* if not background */ if (tweencolorkey.pixel > 0) { x3 = x2 + col; if (x3 >= im->sx || x3 < 0) continue; #if HAVE_LIBGD20 if (im->trueColor) { pixel = &im->tpixels[y3][x3]; } else #endif { #if HAVE_LIBGD13 pixel = &im->pixels[y3][x3]; #else pixel = &im->pixels[x3][y3]; #endif } tweencolorkey.bgcolor = *pixel; tweencolor = (tweencolor_t *)gdCacheGet( tweenColorCache, &tweencolorkey); *pixel = tweencolor->tweencolor; } } } return (char *)NULL; } /********************************************************************/ /* gdttf - render a utf8 string onto a gd image */ char * gdttf(gdImage *im, int *brect, int fg, char *fontname, double ptsize, double angle, int x, int y, char *str) { TT_F26Dot6 ur_x=0, ur_y=0, ll_x=0, ll_y=0; TT_F26Dot6 advance_x, advance_y, advance, x1, y1; TT_BBox *bbox; double sin_a, cos_a; int i=0, ch; font_t *font; fontkey_t fontkey; char *error, *next; /****** initialize font engine on first call ************/ static gdCache_head_t *fontCache; static TT_Engine engine; if (! fontCache) { if (TT_Init_FreeType(&engine)) { return "Failure to initialize font engine"; } fontCache = gdCacheCreate( FONTCACHESIZE, fontTest, fontFetch, fontRelease); } /**************/ /* get the font (via font cache) */ fontkey.fontname = fontname; fontkey.ptsize = ptsize; fontkey.angle = angle; fontkey.engine = &engine; font = (font_t *)gdCacheGet(fontCache, &fontkey); if (! font) { return fontCache->error; } sin_a = font->sin_a; cos_a = font->cos_a; advance_x = advance_y = 0; next=str; while (*next) { ch = *next; /* carriage returns */ if (ch == '\r') { advance_x = 0; next++; continue; } /* newlines */ if (ch == '\n') { advance_y -= (TT_F26Dot6)(font->imetrics.y_ppem * LINESPACE * 64); advance_y = (advance_y-32) & -64; /* round to next pixel row */ next++; continue; } x1 = (TT_F26Dot6)(advance_x * cos_a - advance_y * sin_a); y1 = (TT_F26Dot6)(advance_x * sin_a + advance_y * cos_a); if ((error=gdttfchar(im, fg, font, x, y, x1, y1, &advance, &bbox, &next))) return error; if (! i++) { /* if first character, init BB corner values */ ll_x = bbox->xMin; ll_y = bbox->yMin; ur_x = bbox->xMax; ur_y = bbox->yMax; } else { if (! advance_x) ll_x = MIN(bbox->xMin, ll_x); ll_y = MIN(advance_y + bbox->yMin, ll_y); ur_x = MAX(advance_x + bbox->xMax, ur_x); if (! advance_y) ur_y = MAX(bbox->yMax, ur_y); } advance_x += advance; } /* rotate bounding rectangle */ brect[0] = (int)(ll_x * cos_a - ll_y * sin_a); brect[1] = (int)(ll_x * sin_a + ll_y * cos_a); brect[2] = (int)(ur_x * cos_a - ll_y * sin_a); brect[3] = (int)(ur_x * sin_a + ll_y * cos_a); brect[4] = (int)(ur_x * cos_a - ur_y * sin_a); brect[5] = (int)(ur_x * sin_a + ur_y * cos_a); brect[6] = (int)(ll_x * cos_a - ur_y * sin_a); brect[7] = (int)(ll_x * sin_a + ur_y * cos_a); /* scale, round and offset brect */ i = 0; while (i<8) { brect[i] = x + (brect[i] + 32) / 64; i++; brect[i] = y - (brect[i] + 32) / 64; i++; } return (char *)NULL; } #endif /* HAVE_LIBTTF */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: */ php-4.4.8/ext/gd/gdttf.h0000644000175000017500000000071507055643222014265 0ustar derickderick/* $Id: gdttf.h,v 1.3 2000/02/26 03:20:50 zeev Exp $ */ #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*/ char * gdttf(gdImage *im, int *brect, int fg, char *fontname, double ptsize, double angle, int x, int y, char *str); php-4.4.8/ext/gd/gd.dsp0000644000175000017500000004000110616247417014101 0ustar derickderick# Microsoft Developer Studio Project File - Name="gd" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 CFG=gd - Win32 Release_TS GD2 !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 "gd.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 "gd.mak" CFG="gd - Win32 Release_TS GD2" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "gd - Win32 Release_TS GD2" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "gd - Win32 Debug_TS GD2" (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)" == "gd - Win32 Release_TS GD2" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "gd___Win32_Release_TS_GD2_bundled" # PROP BASE Intermediate_Dir "gd___Win32_Release_TS_GD2_bundled" # 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 "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GD_GIF_READ=1 /D HAVE_GD_GIF_CREATE=1 /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D "HAVE_GD_XBM" /D HAVE_LIBGD13=1 /D HAVE_LIBGD=1 /D HAVE_LIBGD15=1 /D HAVE_LIBGD204=1 /FR /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /I "libgd" /D ZEND_DEBUG=0 /D HAVE_LIBGD15=1 /D HAVE_LIBGD204=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GD_GIF_READ=1 /D HAVE_GD_GIF_CREATE=1 /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D "HAVE_GD_XBM" /D HAVE_LIBGD=1 /D HAVE_LIBGD13=1 /D HAVE_LIBGD20=1 /D "USE_GD_IOCTX" /D HAVE_LIBFREETYPE=1 /D "USE_GD_IMGSTRTTF" /D HAVE_GD_STRINGTTF=1 /D HAVE_GD_BUNDLED=1 /D "MSWIN32" /D "HAVE_LIBPNG" /D "HAVE_LIBJPEG" /D "HAVE_GD_GD2" /D HAVE_GD_STRINGFTEX=1 /D HAVE_GD_IMAGESETBRUSH=1 /D HAVE_GD_IMAGESETTILE=1 /FR /FD /c # SUBTRACT CPP /YX # 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 php4ts.lib libjpeg.lib libpng.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 /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_gd2.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" # SUBTRACT BASE LINK32 /pdb:none # ADD LINK32 php4ts.lib freetype2.lib libjpeg.lib libpng.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 /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_gd2.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" /libpath:"..\..\..\zlib\Release" # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "gd___Win32_Debug_TS_GD2_bundled" # PROP BASE Intermediate_Dir "gd___Win32_Debug_TS_GD2_bundled" # 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 /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GD_GIF_READ=1 /D HAVE_GD_GIF_CREATE=1 /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D HAVE_LIBGD13=1 /D HAVE_LIBGD=1 /D HAVE_LIBGD15=1 /D HAVE_LIBGD204=1 /FR /YX /FD /c # ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\..\zlib" /I "..\..\TSRM" /I "libgd" /D ZEND_DEBUG=1 /D "HAVE_LIBGD15" /D HAVE_LIBGD204=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "COMPILE_DL_GD" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_GD_GIF_READ=1 /D HAVE_GD_GIF_CREATE=1 /D HAVE_GDIMAGECOLORRESOLVE=1 /D "HAVE_GD_PNG" /D "HAVE_GD_JPG" /D "HAVE_GD_WBMP" /D HAVE_LIBGD=1 /D HAVE_LIBGD13=1 /D HAVE_LIBGD20=1 /D "USE_GD_IOCTX" /D HAVE_LIBFREETYPE=1 /D "USE_GD_IMGSTRTTF" /D HAVE_GD_STRINGTTF=1 /D HAVE_GD_BUNDLED=1 /D "MSWIN32" /D "HAVE_LIBPNG" /D "HAVE_LIBJPEG" /D "HAVE_GD_GD2" /D HAVE_GD_STRINGFTEX=1 /D HAVE_GD_IMAGESETBRUSH=1 /D HAVE_GD_IMAGESETTILE=1 /FR /FD /c # SUBTRACT CPP /YX # 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 php4ts_debug.lib libjpeg.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_gd2.dll" /libpath:"..\..\Debug_TS" # SUBTRACT BASE LINK32 /pdb:none # ADD LINK32 php4ts_debug.lib libpng.lib zlib.lib libjpeg.lib freetype2.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_gd2.dll" /libpath:"..\..\Debug_TS" /libpath:"..\..\..\zlib\Debug" # SUBTRACT LINK32 /pdb:none !ENDIF # Begin Target # Name "gd - Win32 Release_TS GD2" # Name "gd - Win32 Debug_TS GD2" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=.\gd.c # End Source File # Begin Source File SOURCE=.\gdttf.c # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=.\gdcache.h # End Source File # Begin Source File SOURCE=.\gdttf.h # End Source File # Begin Source File SOURCE=.\php_gd.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 "libgd" # PROP Default_Filter "" # Begin Group "Source Files No. 1" # PROP Default_Filter "*.c" # Begin Source File SOURCE=.\libgd\gd.c !IF "$(CFG)" == "gd - Win32 Release_TS GD2" # PROP Intermediate_Dir "Release_TS_bundled" !ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" # PROP Intermediate_Dir "Debug_TS_bundled" # ADD CPP /FR !ENDIF # End Source File # Begin Source File SOURCE=.\libgd\gd2copypal.c !IF "$(CFG)" == "gd - Win32 Release_TS GD2" # PROP Intermediate_Dir "Release_TS_bundled" !ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" # PROP Intermediate_Dir "Debug_TS_bundled" # ADD CPP /FR !ENDIF # End Source File # Begin Source File SOURCE=.\libgd\gd_arc_f_buggy.c !IF "$(CFG)" == "gd - Win32 Release_TS GD2" # PROP Intermediate_Dir "Release_TS_bundled" !ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" # PROP Intermediate_Dir "Debug_TS_bundled" # ADD CPP /FR !ENDIF # End Source File # Begin Source File SOURCE=.\libgd\gd_gd.c !IF "$(CFG)" == "gd - Win32 Release_TS GD2" # PROP Intermediate_Dir "Release_TS_bundled" !ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" # PROP Intermediate_Dir "Debug_TS_bundled" # ADD CPP /FR !ENDIF # End Source File # Begin Source File SOURCE=.\libgd\gd_gd2.c !IF "$(CFG)" == "gd - Win32 Release_TS GD2" # PROP Intermediate_Dir "Release_TS_bundled" !ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" # PROP Intermediate_Dir "Debug_TS_bundled" # ADD CPP /FR !ENDIF # End Source File # Begin Source File SOURCE=.\libgd\gd_gif_in.c !IF "$(CFG)" == "gd - Win32 Release_TS GD2" # PROP Intermediate_Dir "Release_TS_bundled" !ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" # PROP Intermediate_Dir "Debug_TS_bundled" # ADD CPP /FR !ENDIF # End Source File # Begin Source File SOURCE=.\libgd\gd_gif_out.c # End Source File # Begin Source File SOURCE=.\libgd\gd_io.c !IF "$(CFG)" == "gd - Win32 Release_TS GD2" # PROP Intermediate_Dir "Release_TS_bundled" !ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" # PROP Intermediate_Dir "Debug_TS_bundled" # ADD CPP /FR !ENDIF # End Source File # Begin Source File SOURCE=.\libgd\gd_io_dp.c !IF "$(CFG)" == "gd - Win32 Release_TS GD2" # PROP Intermediate_Dir "Release_TS_bundled" !ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" # PROP Intermediate_Dir "Debug_TS_bundled" # ADD CPP /FR !ENDIF # End Source File # Begin Source File SOURCE=.\libgd\gd_io_file.c !IF "$(CFG)" == "gd - Win32 Release_TS GD2" # PROP Intermediate_Dir "Release_TS_bundled" !ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" # PROP Intermediate_Dir "Debug_TS_bundled" # ADD CPP /FR !ENDIF # End Source File # Begin Source File SOURCE=.\libgd\gd_io_ss.c !IF "$(CFG)" == "gd - Win32 Release_TS GD2" # PROP Intermediate_Dir "Release_TS_bundled" !ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" # PROP Intermediate_Dir "Debug_TS_bundled" # ADD CPP /FR !ENDIF # End Source File # Begin Source File SOURCE=.\libgd\gd_jpeg.c !IF "$(CFG)" == "gd - Win32 Release_TS GD2" # PROP Intermediate_Dir "Release_TS_bundled" !ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" # PROP Intermediate_Dir "Debug_TS_bundled" # ADD CPP /FR !ENDIF # End Source File # Begin Source File SOURCE=.\libgd\gd_png.c !IF "$(CFG)" == "gd - Win32 Release_TS GD2" # PROP Intermediate_Dir "Release_TS_bundled" !ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" # PROP Intermediate_Dir "Debug_TS_bundled" # ADD CPP /FR !ENDIF # End Source File # Begin Source File SOURCE=.\libgd\gd_security.c # End Source File # Begin Source File SOURCE=.\libgd\gd_ss.c !IF "$(CFG)" == "gd - Win32 Release_TS GD2" # PROP Intermediate_Dir "Release_TS_bundled" !ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" # PROP Intermediate_Dir "Debug_TS_bundled" # ADD CPP /FR !ENDIF # End Source File # Begin Source File SOURCE=.\libgd\gd_topal.c !IF "$(CFG)" == "gd - Win32 Release_TS GD2" # PROP Intermediate_Dir "Release_TS_bundled" !ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" # PROP Intermediate_Dir "Debug_TS_bundled" # ADD CPP /FR !ENDIF # End Source File # Begin Source File SOURCE=.\libgd\gd_wbmp.c !IF "$(CFG)" == "gd - Win32 Release_TS GD2" # PROP Intermediate_Dir "Release_TS_bundled" !ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" # PROP Intermediate_Dir "Debug_TS_bundled" # ADD CPP /FR !ENDIF # End Source File # Begin Source File SOURCE=.\libgd\gdcache.c !IF "$(CFG)" == "gd - Win32 Release_TS GD2" # PROP Intermediate_Dir "Release_TS_bundled" !ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" # PROP Intermediate_Dir "Debug_TS_bundled" # ADD CPP /FR !ENDIF # End Source File # Begin Source File SOURCE=.\libgd\gdfontg.c !IF "$(CFG)" == "gd - Win32 Release_TS GD2" # PROP Intermediate_Dir "Release_TS_bundled" !ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" # PROP Intermediate_Dir "Debug_TS_bundled" # ADD CPP /FR !ENDIF # End Source File # Begin Source File SOURCE=.\libgd\gdfontl.c !IF "$(CFG)" == "gd - Win32 Release_TS GD2" # PROP Intermediate_Dir "Release_TS_bundled" !ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" # PROP Intermediate_Dir "Debug_TS_bundled" # ADD CPP /FR !ENDIF # End Source File # Begin Source File SOURCE=.\libgd\gdfontmb.c !IF "$(CFG)" == "gd - Win32 Release_TS GD2" # PROP Intermediate_Dir "Release_TS_bundled" !ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" # PROP Intermediate_Dir "Debug_TS_bundled" # ADD CPP /FR !ENDIF # End Source File # Begin Source File SOURCE=.\libgd\gdfonts.c !IF "$(CFG)" == "gd - Win32 Release_TS GD2" # PROP Intermediate_Dir "Release_TS_bundled" !ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" # PROP Intermediate_Dir "Debug_TS_bundled" # ADD CPP /FR !ENDIF # End Source File # Begin Source File SOURCE=.\libgd\gdfontt.c !IF "$(CFG)" == "gd - Win32 Release_TS GD2" # PROP Intermediate_Dir "Release_TS_bundled" !ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" # PROP Intermediate_Dir "Debug_TS_bundled" # ADD CPP /FR !ENDIF # End Source File # Begin Source File SOURCE=.\libgd\gdft.c !IF "$(CFG)" == "gd - Win32 Release_TS GD2" # PROP Intermediate_Dir "Release_TS_bundled" !ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" # PROP Intermediate_Dir "Debug_TS_bundled" # ADD CPP /FR !ENDIF # End Source File # Begin Source File SOURCE=.\libgd\gdhelpers.c !IF "$(CFG)" == "gd - Win32 Release_TS GD2" # PROP Intermediate_Dir "Release_TS_bundled" !ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" # PROP Intermediate_Dir "Debug_TS_bundled" # ADD CPP /FR !ENDIF # End Source File # Begin Source File SOURCE=.\libgd\gdkanji.c !IF "$(CFG)" == "gd - Win32 Release_TS GD2" # PROP Intermediate_Dir "Release_TS_bundled" !ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" # PROP Intermediate_Dir "Debug_TS_bundled" # ADD CPP /FR !ENDIF # End Source File # Begin Source File SOURCE=.\libgd\gdtables.c !IF "$(CFG)" == "gd - Win32 Release_TS GD2" # PROP Intermediate_Dir "Release_TS_bundled" !ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" # PROP Intermediate_Dir "Debug_TS_bundled" # ADD CPP /FR !ENDIF # End Source File # Begin Source File SOURCE=.\libgd\gdxpm.c !IF "$(CFG)" == "gd - Win32 Release_TS GD2" # PROP Intermediate_Dir "Release_TS_bundled" !ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" # PROP Intermediate_Dir "Debug_TS_bundled" # ADD CPP /FR !ENDIF # End Source File # Begin Source File SOURCE=.\libgd\wbmp.c !IF "$(CFG)" == "gd - Win32 Release_TS GD2" # PROP Intermediate_Dir "Release_TS_bundled" !ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" # PROP Intermediate_Dir "Debug_TS_bundled" # ADD CPP /FR !ENDIF # End Source File # Begin Source File SOURCE=.\libgd\xbm.c !IF "$(CFG)" == "gd - Win32 Release_TS GD2" # PROP Intermediate_Dir "Release_TS_bundled" !ELSEIF "$(CFG)" == "gd - Win32 Debug_TS GD2" # PROP Intermediate_Dir "Debug_TS_bundled" # ADD CPP /FR !ENDIF # End Source File # End Group # Begin Group "Header Files No. 1" # PROP Default_Filter "*.h" # Begin Source File SOURCE=.\libgd\gd.h # End Source File # Begin Source File SOURCE=.\libgd\gd_io.h # End Source File # Begin Source File SOURCE=.\libgd\gdcache.h # End Source File # Begin Source File SOURCE=.\libgd\gdfontg.h # End Source File # Begin Source File SOURCE=.\libgd\gdfontl.h # End Source File # Begin Source File SOURCE=.\libgd\gdfontmb.h # End Source File # Begin Source File SOURCE=.\libgd\gdfonts.h # End Source File # Begin Source File SOURCE=.\libgd\gdfontt.h # End Source File # Begin Source File SOURCE=.\libgd\gdhelpers.h # End Source File # Begin Source File SOURCE=.\libgd\jisx0208.h # End Source File # Begin Source File SOURCE=.\libgd\wbmp.h # End Source File # End Group # End Group # End Target # End Project php-4.4.8/ext/gd/CREDITS0000644000175000017500000000014607630004720014013 0ustar derickderickGD imaging Rasmus Lerdorf, Stig Bakken, Jim Winstead, Jouni Ahto, Ilia Alshanetsky, Pierre-Alain Joye php-4.4.8/ext/yp/0000755000175000017500000000000010737115146013037 5ustar derickderickphp-4.4.8/ext/yp/yp.c0000644000175000017500000002515710736114316013642 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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: Stephanie Wehner <_@r4k.net> | | Fredrik Ohrn | +----------------------------------------------------------------------+ */ /* $Id: yp.c,v 1.31.8.6.4.3 2007/12/31 07:22:54 sebastian Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "php.h" #include "ext/standard/info.h" #if HAVE_YP #include "php_yp.h" #include /* {{{ thread safety stuff */ #ifdef ZTS int yp_globals_id; #else PHP_YP_API php_yp_globals yp_globals; #endif /* }}} */ function_entry yp_functions[] = { PHP_FE(yp_get_default_domain, NULL) PHP_FE(yp_order, NULL) PHP_FE(yp_master, NULL) PHP_FE(yp_match, NULL) PHP_FE(yp_first, NULL) PHP_FE(yp_next, NULL) PHP_FE(yp_all, NULL) PHP_FE(yp_cat, NULL) PHP_FE(yp_errno, NULL) PHP_FE(yp_err_string, NULL) {NULL, NULL, NULL} }; zend_module_entry yp_module_entry = { STANDARD_MODULE_HEADER, "yp", yp_functions, PHP_MINIT(yp), NULL, PHP_RINIT(yp), NULL, PHP_MINFO(yp), NO_VERSION_YET, STANDARD_MODULE_PROPERTIES }; #ifdef COMPILE_DL_YP ZEND_GET_MODULE(yp) #endif /* {{{ proto string yp_get_default_domain(void) Returns the domain or false */ PHP_FUNCTION(yp_get_default_domain) { char *outdomain; if (ZEND_NUM_ARGS()) { WRONG_PARAM_COUNT; } if((YP(error) = yp_get_default_domain(&outdomain))) { php_error(E_WARNING, yperr_string (YP(error))); RETURN_FALSE; } RETVAL_STRING(outdomain,1); } /* }}} */ /* {{{ proto int yp_order(string domain, string map) Returns the order number or false */ PHP_FUNCTION(yp_order) { pval **domain, **map; #if SOLARIS_YP unsigned long outval; #else int outval; #endif if((ZEND_NUM_ARGS() != 2) || zend_get_parameters_ex(2,&domain,&map) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_string_ex(domain); convert_to_string_ex(map); if((YP(error) = yp_order(Z_STRVAL_PP (domain), Z_STRVAL_PP (map), &outval))) { php_error(E_WARNING, yperr_string (YP(error))); RETURN_FALSE; } RETVAL_LONG(outval); } /* }}} */ /* {{{ proto string yp_master(string domain, string map) Returns the machine name of the master */ PHP_FUNCTION(yp_master) { pval **domain, **map; char *outname; if((ZEND_NUM_ARGS() != 2) || zend_get_parameters_ex(2,&domain,&map) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_string_ex(domain); convert_to_string_ex(map); if((YP(error) = yp_master(Z_STRVAL_PP (domain), Z_STRVAL_PP (map), &outname))) { php_error(E_WARNING, yperr_string (YP(error))); RETURN_FALSE; } RETVAL_STRING(outname,1); } /* }}} */ /* {{{ proto string yp_match(string domain, string map, string key) Returns the matched line or false */ PHP_FUNCTION(yp_match) { pval **domain, **map, **key; char *outval; int outvallen; if((ZEND_NUM_ARGS() != 3) || zend_get_parameters_ex(3,&domain,&map,&key) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_string_ex(domain); convert_to_string_ex(map); convert_to_string_ex(key); if((YP(error) = yp_match(Z_STRVAL_PP (domain), Z_STRVAL_PP (map), Z_STRVAL_PP (key), Z_STRLEN_PP (key), &outval, &outvallen))) { php_error(E_WARNING, yperr_string (YP(error))); RETURN_FALSE; } RETVAL_STRINGL(outval,outvallen,1); } /* }}} */ /* {{{ proto array yp_first(string domain, string map) Returns the first key as array with $var[$key] and the the line as the value */ PHP_FUNCTION(yp_first) { pval **domain, **map; char *outval, *outkey; int outvallen, outkeylen; if((ZEND_NUM_ARGS() != 2) || zend_get_parameters_ex(2,&domain,&map) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_string_ex(domain); convert_to_string_ex(map); if((YP(error) = yp_first(Z_STRVAL_PP (domain), Z_STRVAL_PP (map), &outkey, &outkeylen, &outval, &outvallen))) { php_error(E_WARNING, yperr_string (YP(error))); RETURN_FALSE; } array_init(return_value); add_assoc_stringl_ex(return_value,outkey,outkeylen+1,outval,outvallen,1); /* Deprecated */ add_assoc_stringl(return_value,"key",outkey,outkeylen,1); add_assoc_stringl(return_value,"value",outval,outvallen,1); } /* }}} */ /* {{{ proto array yp_next(string domain, string map, string key) Returns an array with $var[$key] and the the line as the value */ PHP_FUNCTION(yp_next) { pval **domain, **map, **key; char *outval, *outkey; int outvallen, outkeylen; if((ZEND_NUM_ARGS() != 3) || zend_get_parameters_ex(3,&domain,&map,&key) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_string_ex(domain); convert_to_string_ex(map); convert_to_string_ex(key); if((YP(error) = yp_next(Z_STRVAL_PP (domain), Z_STRVAL_PP (map), Z_STRVAL_PP (key), Z_STRLEN_PP (key), &outkey, &outkeylen, &outval, &outvallen))) { php_error(E_WARNING, yperr_string (YP(error))); RETURN_FALSE; } array_init(return_value); add_assoc_stringl_ex(return_value,outkey,outkeylen+1,outval,outvallen,1); } /* }}} */ /* {{{ php_foreach_all */ static int php_foreach_all (int instatus, char *inkey, int inkeylen, char *inval, int invallen, char *indata) { int r; zval *status, *key, *value; zval **args [3]; zval *retval; TSRMLS_FETCH(); args[0] = &status; args[1] = &key; args[2] = &value; MAKE_STD_ZVAL (status); ZVAL_LONG (status, ypprot_err (instatus)); MAKE_STD_ZVAL (key); ZVAL_STRINGL (key, inkey, inkeylen, 1); MAKE_STD_ZVAL (value); ZVAL_STRINGL (value, inval, invallen, 1); if(call_user_function_ex(CG(function_table), NULL, *((zval **)indata), &retval, 3, args, 0, NULL TSRMLS_CC) != SUCCESS) { zend_error(E_ERROR, "Function call failed"); return 1; } convert_to_long_ex(&retval); r = Z_LVAL_P (retval); zval_ptr_dtor(&retval); zval_ptr_dtor(&status); zval_ptr_dtor(&key); zval_ptr_dtor(&value); return r; } /* }}} */ /* {{{ proto void yp_all(string domain, string map, string callback) Traverse the map and call a function on each entry */ PHP_FUNCTION(yp_all) { pval **domain, **map, **php_callback; struct ypall_callback callback; if((ZEND_NUM_ARGS() != 3) || zend_get_parameters_ex(3,&domain,&map,&php_callback) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_string_ex(domain); convert_to_string_ex(map); callback.foreach = php_foreach_all; callback.data = (char *) php_callback; yp_all(Z_STRVAL_PP(domain),Z_STRVAL_PP(map),&callback); RETURN_FALSE; } /* }}} */ /* {{{ php_foreach_cat */ static int php_foreach_cat (int instatus, char *inkey, int inkeylen, char *inval, int invallen, char *indata) { int err; err = ypprot_err (instatus); if (!err) { if (inkeylen) { char *key = emalloc(inkeylen+1); if(key) { strlcpy(key, inkey, inkeylen+1); add_assoc_stringl_ex((zval *) indata, key, inkeylen+1, inval, invallen, 1); efree(key); } else { php_error(E_WARNING, "Can't allocate %d bytes for key buffer in yp_cat()", inkeylen+1); } } return 0; } if (err != YPERR_NOMORE) { TSRMLS_FETCH(); YP(error) = err; php_error(E_WARNING, yperr_string (err)); } return 0; } /* }}} */ /* {{{ proto array yp_cat(string domain, string map) Return an array containing the entire map */ PHP_FUNCTION(yp_cat) { pval **domain, **map; struct ypall_callback callback; if((ZEND_NUM_ARGS() != 2) || zend_get_parameters_ex(2,&domain,&map) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_string_ex(domain); convert_to_string_ex(map); array_init(return_value); callback.foreach = php_foreach_cat; callback.data = (char *) return_value; yp_all(Z_STRVAL_PP(domain),Z_STRVAL_PP(map),&callback); } /* }}} */ /* {{{ proto int yp_errno() Returns the error code from the last call or 0 if no error occured */ PHP_FUNCTION(yp_errno) { if((ZEND_NUM_ARGS() != 0)) { WRONG_PARAM_COUNT; } RETURN_LONG (YP(error)); } /* }}} */ /* {{{ proto string yp_err_string(int errorcode) Returns the corresponding error string for the given error code */ PHP_FUNCTION(yp_err_string) { pval **error; char *string; if((ZEND_NUM_ARGS() != 1) || zend_get_parameters_ex(1,&error) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_long_ex(error); if((string = yperr_string(Z_LVAL_PP(error))) == NULL) { RETURN_FALSE; } RETVAL_STRING(string,1); } /* }}} */ /* {{{ PHP_MINIT_FUNCTION */ PHP_MINIT_FUNCTION(yp) { #ifdef ZTS ts_allocate_id(&yp_globals_id, sizeof(php_yp_globals), NULL, NULL); #endif REGISTER_LONG_CONSTANT("YPERR_BADARGS", YPERR_BADARGS, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("YPERR_BADDB", YPERR_BADDB, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("YPERR_BUSY", YPERR_BUSY, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("YPERR_DOMAIN", YPERR_DOMAIN, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("YPERR_KEY", YPERR_KEY, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("YPERR_MAP", YPERR_MAP, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("YPERR_NODOM", YPERR_NODOM, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("YPERR_NOMORE", YPERR_NOMORE, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("YPERR_PMAP", YPERR_PMAP, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("YPERR_RESRC", YPERR_RESRC, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("YPERR_RPC", YPERR_RPC, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("YPERR_YPBIND", YPERR_YPBIND, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("YPERR_YPERR", YPERR_YPERR, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("YPERR_YPSERV", YPERR_YPSERV, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("YPERR_VERS", YPERR_VERS, CONST_CS | CONST_PERSISTENT); return SUCCESS; } /* }}} */ PHP_RINIT_FUNCTION(yp) { YP(error) = 0; return SUCCESS; } PHP_MINFO_FUNCTION(yp) { php_info_print_table_start(); php_info_print_table_row(2, "YP Support", "enabled"); php_info_print_table_end(); } #endif /* HAVE_YP */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: sw=4 ts=4 fdm=marker * vim<600: sw=4 ts=4 */ php-4.4.8/ext/yp/config.m40000644000175000017500000000126307555544150014555 0ustar derickderickdnl dnl $Id: config.m4,v 1.9 2002/10/23 16:03:52 hholzgra Exp $ dnl PHP_ARG_ENABLE(yp,whether to include YP support, [ --enable-yp Include YP support.]) if test "$PHP_YP" != "no"; then AC_CHECK_LIB(nsl, yp_match, [ YP_LIBS=nsl YP_CHECK_IN_LIB=nsl ], AC_CHECK_LIB(c, yp_match, [ YP_LIBS= YP_CHECK_IN_LIB=c ],[ AC_MSG_ERROR(Unable to find required yp/nis library) ]) ) AC_DEFINE(HAVE_YP,1,[ ]) PHP_NEW_EXTENSION(yp, yp.c, $ext_shared) PHP_SUBST(YP_SHARED_LIBADD) if test -n "$YP_LIBS"; then PHP_ADD_LIBRARY_WITH_PATH($YP_LIBS, $YP_LIBDIR, YP_SHARED_LIBADD) fi case $host_alias in *solaris*) AC_DEFINE(SOLARIS_YP,1,[ ]) ;; esac fi php-4.4.8/ext/yp/php_yp.h0000644000175000017500000000413310736114316014505 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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: Stephanie Wehner <_@r4k.net> | | Fredrik Ohrn | +----------------------------------------------------------------------+ */ /* $Id: php_yp.h,v 1.12.8.1.8.3 2007/12/31 07:22:54 sebastian Exp $ */ #ifndef PHP_YP_H #define PHP_YP_H #if HAVE_YP #ifdef PHP_WIN32 #define PHP_YP_API __declspec(dllexport) #else #define PHP_YP_API #endif extern zend_module_entry yp_module_entry; #define yp_module_ptr &yp_module_entry /* yp.c functions */ PHP_FUNCTION(yp_get_default_domain); PHP_FUNCTION(yp_order); PHP_FUNCTION(yp_master); PHP_FUNCTION(yp_match); PHP_FUNCTION(yp_first); PHP_FUNCTION(yp_next); PHP_FUNCTION(yp_all); PHP_FUNCTION(yp_cat); PHP_FUNCTION(yp_errno); PHP_FUNCTION(yp_err_string); PHP_MINIT_FUNCTION(yp); PHP_RINIT_FUNCTION(yp); PHP_MINFO_FUNCTION(yp); typedef struct { int error; } php_yp_globals; #ifdef ZTS #define YP(v) TSRMG(yp_globals_id, php_yp_globals *, v) #else #define YP(v) (yp_globals.v) #endif #else #define yp_module_ptr NULL #endif /* HAVE_YP */ #define phpext_yp_ptr yp_module_ptr #endif /* PHP_YP_H */ php-4.4.8/ext/yp/CREDITS0000644000175000017500000000005407255231716014061 0ustar derickderickYellow Pages Stephanie Wehner, Fredrik Ohrn php-4.4.8/ext/bz2/0000755000175000017500000000000010737115146013104 5ustar derickderickphp-4.4.8/ext/bz2/bz2.c0000644000175000017500000003431310736114305013744 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP version 4.0 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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: bz2.c,v 1.1.2.4.2.9 2007/12/31 07:22:45 sebastian Exp $ */ #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 function_entry bz2_functions[] = { PHP_FE(bzopen, NULL) PHP_FE(bzread, NULL) PHP_FALIAS(bzwrite, fwrite, NULL) PHP_FALIAS(bzflush, fflush, NULL) PHP_FALIAS(bzclose, fclose, NULL) PHP_FE(bzerrno, NULL) PHP_FE(bzerrstr, NULL) PHP_FE(bzerror, NULL) PHP_FE(bzcompress, NULL) PHP_FE(bzdecompress, NULL) {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] != '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" }; php_stream_wrapper php_stream_bzip2_wrapper = { &bzip2_stream_wops, NULL, 0 /* is_url */ }; static void php_bz2_error(INTERNAL_FUNCTION_PARAMETERS, int); PHP_MINIT_FUNCTION(bz2) { php_register_url_stream_wrapper("compress.bzip2", &php_stream_bzip2_wrapper TSRMLS_CC); return SUCCESS; } PHP_MSHUTDOWN_FUNCTION(bz2) { php_unregister_url_stream_wrapper("compress.bzip2" TSRMLS_CC); return SUCCESS; } PHP_MINFO_FUNCTION(bz2) { php_info_print_table_start(); php_info_print_table_row(2, "BZip2 Support", "Enabled"); php_info_print_table_row(2, "BZip2 Version", (char *) BZ2_bzlibVersion()); php_info_print_table_end(); } /* {{{ proto string bzread(int bz[, int length]) Reads up to length bytes from a BZip2 stream, or 1024 bytes if length is not specified */ 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 */ 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_STRVAL_PP(mode)[0] != 'r' && Z_STRVAL_PP(mode)[0] != 'w' && Z_STRVAL_PP(mode)[1] != '\0') { 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); 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; php_stream_from_zval(stream, file); 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 */ PHP_FUNCTION(bzerrno) { php_bz2_error(INTERNAL_FUNCTION_PARAM_PASSTHRU, PHP_BZ_ERRNO); } /* }}} */ /* {{{ proto string bzerrstr(resource bz) Returns the error string */ 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 */ 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 */ 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 */ PHP_FUNCTION(bzdecompress) { char *source, *dest; int source_len, error; long small = 0; #if defined(PHP_WIN32) && _MSC_VER < 1300 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 = erealloc(dest, size + bzs.avail_out + 1); 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 = erealloc(dest, 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 */ php-4.4.8/ext/bz2/tests/0000755000175000017500000000000010737115146014246 5ustar derickderickphp-4.4.8/ext/bz2/tests/with_files.phpt0000644000175000017500000000074007700240613017273 0ustar derickderick--TEST-- BZ2 with files --SKIPIF-- --POST-- --GET-- --FILE-- --POST-- --GET-- --FILE-- 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 php-4.4.8/ext/bz2/config.m40000644000175000017500000000167710003404162014607 0ustar derickderickdnl dnl $Id: config.m4,v 1.1.2.2 2004/01/21 05:04:50 sniper Exp $ 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/lib, BZ2_SHARED_LIBADD) AC_DEFINE(HAVE_BZ2,1,[ ]) ], [ AC_MSG_ERROR(bz2 module requires libbz2 >= 1.0.0) ], [ -L$BZIP_DIR/lib ]) PHP_NEW_EXTENSION(bz2, bz2.c, $ext_shared) PHP_SUBST(BZ2_SHARED_LIBADD) fi php-4.4.8/ext/bz2/php_bz2.h0000644000175000017500000000504710736114305014622 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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 | +----------------------------------------------------------------------+ */ #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 PHP_MINIT_FUNCTION(bz2); PHP_MSHUTDOWN_FUNCTION(bz2); PHP_MINFO_FUNCTION(bz2); PHP_FUNCTION(bzopen); PHP_FUNCTION(bzread); PHP_FUNCTION(bzerrno); PHP_FUNCTION(bzerrstr); PHP_FUNCTION(bzerror); PHP_FUNCTION(bzcompress); PHP_FUNCTION(bzdecompress); #else #define phpext_bz2_ptr NULL #endif #ifdef PHP_WIN32 # ifdef PHP_BZ2_EXPORTS # define PHP_BZ2_API __declspec(dllexport) # else # define PHP_BZ2_API __declspec(dllimport) # endif #else # define PHP_BZ2_API #endif PHP_BZ2_API PHPAPI 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 PHPAPI 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) php_stream_ops php_stream_bz2io_ops; #define PHP_STREAM_IS_BZIP2 &php_stream_bz2io_ops #endif /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: */ php-4.4.8/ext/bz2/CREDITS0000644000175000017500000000002607661443273014131 0ustar derickderickBzip2 Sterling Hughes php-4.4.8/ext/bz2/bz2.dsp0000644000175000017500000001111007661443273014312 0ustar derickderick# 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 php4ts.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 php4ts_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 # 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 php-4.4.8/ext/dba/0000755000175000017500000000000010737115146013135 5ustar derickderickphp-4.4.8/ext/dba/dba_cdb.c0000644000175000017500000001643010736114306014637 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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: dba_cdb.c,v 1.23.2.6.8.3 2007/12/31 07:22:46 sebastian Exp $ */ #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 */ php-4.4.8/ext/dba/dba_db2.c0000644000175000017500000001104710736114306014555 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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: dba_db2.c,v 1.30.2.6.4.3 2007/12/31 07:22:46 sebastian Exp $ */ #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 */ php-4.4.8/ext/dba/dba_db3.c0000644000175000017500000001177710736114306014570 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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: dba_db3.c,v 1.21.2.8.4.3 2007/12/31 07:22:46 sebastian Exp $ */ #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 */ php-4.4.8/ext/dba/dba_db4.c0000644000175000017500000001222010736114306014551 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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: dba_db4.c,v 1.6.2.6.4.3 2007/12/31 07:22:46 sebastian Exp $ */ #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(const char *errpfx, 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->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_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 (!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(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 (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(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 */ php-4.4.8/ext/dba/dba_dbm.c0000644000175000017500000001021510736114306014644 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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: dba_dbm.c,v 1.22.2.4.8.3 2007/12/31 07:22:46 sebastian Exp $ */ #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 */ php-4.4.8/ext/dba/install_cdb.sh0000755000175000017500000000212607561532000015744 0ustar derickderick#! /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" php-4.4.8/ext/dba/php_ndbm.h0000644000175000017500000000015407127752140015075 0ustar derickderick#ifndef PHP_NDBM_H #define PHP_NDBM_H #if DBA_NDBM #include "php_dba.h" DBA_FUNCS(ndbm); #endif #endif php-4.4.8/ext/dba/dba_inifile.c0000644000175000017500000000774710736114306015541 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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: dba_inifile.c,v 1.1.2.2.6.3 2007/12/31 07:22:46 sebastian Exp $ */ #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 */ php-4.4.8/ext/dba/dba.c0000644000175000017500000006716110736114306014036 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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: dba.c,v 1.61.2.25.4.3 2007/12/31 07:22:46 sebastian Exp $ */ #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_db2.h" #include "php_db3.h" #include "php_db4.h" #include "php_flatfile.h" #include "php_inifile.h" /* {{{ dba_functions[] */ function_entry dba_functions[] = { PHP_FE(dba_open, NULL) PHP_FE(dba_popen, NULL) PHP_FE(dba_close, NULL) PHP_FE(dba_delete, NULL) PHP_FE(dba_exists, NULL) PHP_FE(dba_fetch, NULL) PHP_FE(dba_insert, NULL) PHP_FE(dba_replace, NULL) PHP_FE(dba_firstkey, NULL) PHP_FE(dba_nextkey, NULL) PHP_FE(dba_optimize, NULL) PHP_FE(dba_sync, NULL) PHP_FE(dba_handlers, NULL) PHP_FE(dba_list, NULL) {NULL, NULL, NULL} }; /* }}} */ PHP_MINIT_FUNCTION(dba); PHP_MSHUTDOWN_FUNCTION(dba); PHP_MINFO_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, STANDARD_MODULE_PROPERTIES }; #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_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_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) /* No lock in lib */ #endif #if DBA_FLATFILE DBA_HND(flatfile, DBA_STREAM_OPEN|DBA_LOCK_ALL) /* No lock in lib */ #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_GDBM #define DBA_DEFAULT "gdbm" #elif DBA_NBBM #define DBA_DEFAULT "ndbm" #elif DBA_DBM #define DBA_DEFAULT "dbm" #else #define DBA_DEFAULT "" #endif /* cdb/cdb_make and ini are no option here */ 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 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.fd) { php_flock(info->lock.fd, LOCK_UN); /*close(info->lock.fd);*/ info->lock.fd = 0; } 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(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_dba_init_globals */ static void php_dba_init_globals(zend_dba_globals *dba_globals) { dba_globals->default_handler = ""; dba_globals->default_hptr = NULL; } /* }}} */ /* {{{ PHP_MINIT_FUNCTION */ PHP_MINIT_FUNCTION(dba) { ZEND_INIT_MODULE_GLOBALS(dba, php_dba_init_globals, NULL); 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) { 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; 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) { 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) { info->lock.name = pestrdup(info->path, persistent); } else { spprintf(&info->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(info->lock.name, lock_file_mode, STREAM_MUST_SEEK|IGNORE_PATH|ENFORCE_SAFE_MODE|persistent_flag, NULL); } 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"; } } if (!info->lock.fp) { info->lock.fp = php_stream_open_wrapper(info->lock.name, lock_file_mode, STREAM_MUST_SEEK|REPORT_ERRORS|IGNORE_PATH|ENFORCE_SAFE_MODE|persistent_flag, NULL); } if (!info->lock.fp) { dba_close(info TSRMLS_CC); /* stream operation already wrote an error message */ FREENOW; RETURN_FALSE; } if (php_stream_cast(info->lock.fp, PHP_STREAM_AS_FD, (void*)&info->lock.fd, 1) == FAILURE) { dba_close(info TSRMLS_CC); /* stream operation already wrote an error message */ FREENOW; RETURN_FALSE; } if (php_flock(info->lock.fd, 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 (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) { 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(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 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) { ZEND_WRONG_PARAM_COUNT(); 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 */ php-4.4.8/ext/dba/tests/0000755000175000017500000000000010737115146014277 5ustar derickderickphp-4.4.8/ext/dba/tests/dba_gdbm.phpt0000644000175000017500000000117707655607475016741 0ustar derickderick--TEST-- DBA GDBM handler test --SKIPIF-- --FILE-- --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" }php-4.4.8/ext/dba/tests/dba001.phpt0000644000175000017500000000065307565221510016145 0ustar derickderick--TEST-- DBA File Creation Test --SKIPIF-- --FILE-- --EXPECTF-- database handler: %s database file createdphp-4.4.8/ext/dba/tests/dba002.phpt0000644000175000017500000000073507565221510016147 0ustar derickderick--TEST-- DBA Insert/Fetch Test --SKIPIF-- --FILE-- --EXPECTF-- database handler: %s This is a test insert php-4.4.8/ext/dba/tests/dba003.phpt0000644000175000017500000000107007565221510016141 0ustar derickderick--TEST-- DBA Insert/Replace/Fetch Test --SKIPIF-- --FILE-- --EXPECTF-- database handler: %s This is the replacement text php-4.4.8/ext/dba/tests/dba_flatfile.phpt0000644000175000017500000000103007655607475017602 0ustar derickderick--TEST-- DBA FlatFile handler test --SKIPIF-- --FILE-- --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" }php-4.4.8/ext/dba/tests/dba004.phpt0000644000175000017500000000141007565221510016140 0ustar derickderick--TEST-- DBA Multiple Insert/Fetch Test --SKIPIF-- --FILE-- --EXPECTF-- database handler: %s Another Content String Content String 2 php-4.4.8/ext/dba/tests/dba_cdb.phpt0000644000175000017500000000106207655607475016551 0ustar derickderick--TEST-- DBA CDB handler test --SKIPIF-- --FILE-- --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" } php-4.4.8/ext/dba/tests/dba005.phpt0000644000175000017500000000153207565221510016146 0ustar derickderick--TEST-- DBA FirstKey/NextKey Loop Test With 5 Items --SKIPIF-- --FILE-- --EXPECTF-- database handler: %s 5YYYYY php-4.4.8/ext/dba/tests/dba006.phpt0000644000175000017500000000162107565221510016146 0ustar derickderick--TEST-- DBA FirstKey/NextKey with 2 deletes --SKIPIF-- --FILE-- --EXPECTF-- database handler: %s 3NYNYYphp-4.4.8/ext/dba/tests/dba_inifile.phpt0000644000175000017500000000102407665413071017422 0ustar derickderick--TEST-- DBA INIFILE handler test --SKIPIF-- --FILE-- --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" }php-4.4.8/ext/dba/tests/dba007.phpt0000644000175000017500000000215707754643745016176 0ustar derickderick--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) "%s/dba/tests/test0.dbm" [%d]=> string(%d) "%s/dba/tests/test1.dbm" [%d]=> string(%d) "%s/dba/tests/test2.dbm" } php-4.4.8/ext/dba/tests/dba008.phpt0000644000175000017500000000141607567451335016166 0ustar derickderick--TEST-- DBA magic_quotes_runtime Test --SKIPIF-- --FILE-- --EXPECTF-- database handler: %s string(1) """ string(2) "\"" string(2) "\"" string(1) """ php-4.4.8/ext/dba/tests/dba009.phpt0000755000175000017500000000120607646342616016166 0ustar derickderick--TEST-- DBA dba_popen Test --SKIPIF-- --FILE-- --EXPECTF-- database handler: %s Opened Inserted Closed Opened Inserted php-4.4.8/ext/dba/tests/test.cdb0000644000175000017500000000426607561236256015747 0ustar derickderickFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFVVV††–¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶11221321331244‘µ<”µ”µ”µ2–µ(—µ —µphp-4.4.8/ext/dba/tests/test.inc0000644000175000017500000000025307655607475015771 0ustar derickderick php-4.4.8/ext/dba/tests/dba_handler.inc0000644000175000017500000000456407767161025017234 0ustar derickderickphp-4.4.8/ext/dba/tests/dba_dbm.phpt0000644000175000017500000000100507655607475016560 0ustar derickderick--TEST-- DBA DBM handler test --SKIPIF-- --FILE-- --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" } php-4.4.8/ext/dba/tests/skipif.inc0000644000175000017500000000140407662526015016262 0ustar derickderick php-4.4.8/ext/dba/tests/dba_cdb_read.phpt0000644000175000017500000000261607655607475017552 0ustar derickderick--TEST-- DBA CDB handler test (read only) --SKIPIF-- --FILE-- --EXPECT-- database handler: cdb 7YYYYNNN =1234 #1122 ?1212314 #1212314 =1231324php-4.4.8/ext/dba/tests/dba_db2.phpt0000644000175000017500000000100407655607475016464 0ustar derickderick--TEST-- DBA DB2 handler test --SKIPIF-- --FILE-- --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" }php-4.4.8/ext/dba/tests/dba_db3.phpt0000644000175000017500000000100407655607475016465 0ustar derickderick--TEST-- DBA DB3 handler test --SKIPIF-- --FILE-- --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" }php-4.4.8/ext/dba/tests/dba_db4.phpt0000644000175000017500000000100507655607475016467 0ustar derickderick--TEST-- DBA DB4 handler test --SKIPIF-- --FILE-- --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" } php-4.4.8/ext/dba/tests/dba_cdb_make.phpt0000644000175000017500000000214310106535774017532 0ustar derickderick--TEST-- DBA CDB_MAKE handler test --INI-- magic_quotes_runtime=1 --SKIPIF-- --FILE-- --EXPECT-- database handler: cdb_make string(32) "12fc5ba2b9dcfef2480e5324eeb5f3e5" string(32) "12fc5ba2b9dcfef2480e5324eeb5f3e5"php-4.4.8/ext/dba/tests/dba_ndbm.phpt0000644000175000017500000000101007655607475016732 0ustar derickderick--TEST-- DBA NDBM handler test --SKIPIF-- --FILE-- --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" }php-4.4.8/ext/dba/README0000755000175000017500000000542410005151016014005 0ustar derickderickThese 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. 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.php-4.4.8/ext/dba/config.m40000644000175000017500000002742010533020157014640 0ustar derickderickdnl dnl $Id: config.m4,v 1.29.2.28.2.2 2006/11/28 11:41:35 tony2001 Exp $ 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/lib 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([AC_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" -o "$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 ]) PHP_ARG_ENABLE(dba,whether to enable DBA, [ --enable-dba Build DBA with builtin modules]) AC_ARG_WITH(gdbm, [ --with-gdbm[=DIR] DBA: Include GDBM support],[ if test "$withval" != "no"; then PHP_DBA_STD_BEGIN for i in $withval /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/lib]) fi PHP_DBA_STD_ASSIGN PHP_DBA_STD_CHECK PHP_DBA_STD_ATTACH fi ]) AC_DBA_STD_RESULT(gdbm) AC_ARG_WITH(ndbm, [ --with-ndbm[=DIR] DBA: Include NDBM support],[ if test "$withval" != "no"; then PHP_DBA_STD_BEGIN for i in $withval /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/lib]) if test -n "$THIS_LIBS"; then break fi done fi PHP_DBA_STD_ASSIGN PHP_DBA_STD_CHECK PHP_DBA_STD_ATTACH fi ]) AC_DBA_STD_RESULT(ndbm) dnl Berkeley specific (library and version test) dnl parameters(version, library list, function) AC_DEFUN([PHP_DBA_DB_CHECK],[ for LIB in $2; do if test -f $THIS_PREFIX/lib/lib$LIB.a -o -f $THIS_PREFIX/lib/lib$LIB.$SHLIB_SUFFIX_NAME; then PHP_TEMP_LDFLAGS(-L$THIS_PREFIX/lib, -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 break ]) ]) ]) 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 fi PHP_DBA_STD_ASSIGN PHP_DBA_STD_CHECK PHP_DBA_STD_ATTACH ]) AC_ARG_WITH(db4, [ --with-db4[=DIR] DBA: Include Berkeley DB4 support],[ if test "$withval" != "no"; then PHP_DBA_STD_BEGIN for i in $withval /usr/local/BerkeleyDB.4.2 /usr/local/BerkeleyDB.4.1 /usr/local/BerkeleyDB.4.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/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.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 ]) AC_DBA_STD_RESULT(db4,Berkeley DB4) AC_ARG_WITH(db3, [ --with-db3[=DIR] DBA: Include Berkeley DB3 support],[ if test "$withval" != "no"; then PHP_DBA_STD_BEGIN if test "$HAVE_DB4" = "1"; then AC_DBA_STD_RESULT(db3,Berkeley DB3,You cannot combine --with-db3 with --with-db4) fi for i in $withval /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 ]) AC_DBA_STD_RESULT(db3,Berkeley DB3) AC_ARG_WITH(db2, [ --with-db2[=DIR] DBA: Include Berkeley DB2 support],[ if test "$withval" != "no"; then PHP_DBA_STD_BEGIN if test "$HAVE_DB3" = "1" -o "$HAVE_DB4" = "1"; then AC_DBA_STD_RESULT(db2,Berkeley DB2,You cannot combine --with-db2 with --with-db3 or --with-db4) fi for i in $withval $withval/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 ]) AC_DBA_STD_RESULT(db2,Berkeley DB2) AC_ARG_WITH(dbm, [ --with-dbm[=DIR] DBA: Include DBM support],[ if test "$withval" != "no"; then PHP_DBA_STD_BEGIN for i in $withval /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/lib]) if test -n "$THIS_LIBS"; then break fi done fi PHP_DBA_STD_ASSIGN PHP_DBA_STD_CHECK PHP_DBA_STD_ATTACH fi ]) AC_DBA_STD_RESULT(dbm) AC_DEFUN([PHP_DBA_BUILTIN_CDB],[ 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" ]) AC_ARG_WITH(cdb, [ --with-cdb[=DIR] DBA: Include CDB support],[ if test "$withval" = "yes" -o "$HAVE_DBA" = "1"; then PHP_DBA_BUILTIN_CDB elif test "$withval" != "no"; then PHP_DBA_STD_BEGIN for i in $withval /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/lib]) if test -n "$THIS_LIBS"; then break fi done fi PHP_DBA_STD_ASSIGN PHP_DBA_STD_CHECK PHP_DBA_STD_ATTACH fi ],[ if test "$PHP_DBA" != "no" -o "$HAVE_DBA" = "1"; then PHP_DBA_BUILTIN_CDB fi ]) AC_DBA_STD_RESULT(cdb) AC_DEFUN([PHP_DBA_BUILTIN_INI],[ AC_DEFINE(DBA_INIFILE, 1, [ ]) ini_sources="libinifile/inifile.c" THIS_RESULT="builtin" ]) AC_ARG_WITH(inifile, [ --with-inifile DBA: Include INI support],[ if test "$withval" != "no"; then PHP_DBA_BUILTIN_INI fi ],[ if test "$PHP_DBA" != "no" -o "$HAVE_DBA" = "1"; then PHP_DBA_BUILTIN_INI fi ]) AC_DBA_STD_RESULT(inifile,INI File) AC_DEFUN([PHP_DBA_BUILTIN_FLATFILE],[ AC_DEFINE(DBA_FLATFILE, 1, [ ]) flat_sources="libflatfile/flatfile.c" THIS_RESULT="builtin" ]) dnl dnl FlatFile check must be the last one. dnl AC_ARG_WITH(flatfile, [ --with-flatfile DBA: Include FlatFile support],[ if test "$withval" != "no"; then PHP_DBA_BUILTIN_FLATFILE fi ],[ if test "$PHP_DBA" != "no" -o "$HAVE_DBA" = "1"; then PHP_DBA_BUILTIN_FLATFILE fi ]) AC_DBA_STD_RESULT(FlatFile,FlatFile) AC_MSG_CHECKING(whether to enable DBA interface) if test "$HAVE_DBA" = "1"; then AC_MSG_RESULT(yes) AC_DEFINE(HAVE_DBA, 1, [ ]) PHP_NEW_EXTENSION(dba, dba.c dba_cdb.c dba_db2.c dba_dbm.c dba_gdbm.c dba_ndbm.c dba_db3.c dba_db4.c dba_flatfile.c dba_inifile.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 php-4.4.8/ext/dba/libflatfile/0000755000175000017500000000000010737115146015412 5ustar derickderickphp-4.4.8/ext/dba/libflatfile/flatfile.c0000644000175000017500000001750110736114306017344 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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: flatfile.c,v 1.5.2.4.8.3 2007/12/31 07:22:46 sebastian Exp $ */ #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: 1.5.2.4.8.3 $"; } /* }}} */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: sw=4 ts=4 fdm=marker * vim<600: sw=4 ts=4 */ php-4.4.8/ext/dba/libflatfile/flatfile.h0000644000175000017500000000357710736114306017361 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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: flatfile.h,v 1.4.2.4.8.3 2007/12/31 07:22:46 sebastian Exp $ */ #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 php-4.4.8/ext/dba/dba_gdbm.c0000644000175000017500000001032710736114306015017 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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: dba_gdbm.c,v 1.16.2.4.8.3 2007/12/31 07:22:46 sebastian Exp $ */ #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 */ php-4.4.8/ext/dba/dba_flatfile.c0000644000175000017500000001063710736114306015700 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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: dba_flatfile.c,v 1.8.2.6.4.3 2007/12/31 07:22:46 sebastian Exp $ */ #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) { int fd; #ifdef F_SETFL int flags; #endif if (info->mode != DBA_READER) { if (SUCCESS != php_stream_cast(info->fp, PHP_STREAM_AS_FD, (void*)&fd, 1)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not cast stream"); return FAILURE; } #ifdef F_SETFL /* Needed becasue some systems do not allow to write to the original * file contents with O_APPEND being set. */ flags = fcntl(fd, F_SETFL); fcntl(fd, F_SETFL, flags & ~O_APPEND); #endif } 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 */ php-4.4.8/ext/dba/dba_ndbm.c0000644000175000017500000000663410736114306015034 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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: dba_ndbm.c,v 1.14.2.3.8.3 2007/12/31 07:22:46 sebastian Exp $ */ #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 */ php-4.4.8/ext/dba/libcdb/0000755000175000017500000000000010737115146014354 5ustar derickderickphp-4.4.8/ext/dba/libcdb/cdb_make.c0000644000175000017500000001341310736114306016243 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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: cdb_make.c,v 1.2.2.4.8.3 2007/12/31 07:22:46 sebastian Exp $ */ /* 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: 1.2.2.4.8.3 $"; } php-4.4.8/ext/dba/libcdb/cdb_make.h0000644000175000017500000000426610736114306016256 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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: cdb_make.h,v 1.1.2.3.8.3 2007/12/31 07:22:46 sebastian Exp $ */ /* 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 php-4.4.8/ext/dba/libcdb/cdb.c0000644000175000017500000001051010736114306015241 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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: cdb.c,v 1.3.2.3.8.3 2007/12/31 07:22:46 sebastian Exp $ */ /* 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_hashadd */ static uint32 cdb_hashadd(uint32 h, unsigned char c) { h += (h << 5); return h ^ c; } /* }}} */ /* {{{ cdb_hash */ uint32 cdb_hash(char *buf, unsigned int len) { uint32 h; h = CDB_HASHSTART; while (len) { h = cdb_hashadd(h, *buf++); --len; } 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: 1.3.2.3.8.3 $"; } /* }}} */ php-4.4.8/ext/dba/libcdb/cdb.h0000644000175000017500000000433510736114306015256 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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: cdb.h,v 1.1.2.3.8.3 2007/12/31 07:22:46 sebastian Exp $ */ /* 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 php-4.4.8/ext/dba/libcdb/uint32.c0000644000175000017500000000344310736114306015644 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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: uint32.c,v 1.1.2.2.8.3 2007/12/31 07:22:46 sebastian Exp $ */ /* 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])); } /* }}} */ php-4.4.8/ext/dba/libcdb/uint32.h0000644000175000017500000000317010736114306015646 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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: uint32.h,v 1.1.2.2.8.3 2007/12/31 07:22:46 sebastian Exp $ */ /* 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 php-4.4.8/ext/dba/php_inifile.h0000644000175000017500000000017007665413071015576 0ustar derickderick#ifndef PHP_INIFILE_H #define PHP_INIFILE_H #if DBA_INIFILE #include "php_dba.h" DBA_FUNCS(inifile); #endif #endif php-4.4.8/ext/dba/libinifile/0000755000175000017500000000000010737115146015243 5ustar derickderickphp-4.4.8/ext/dba/libinifile/inifile.c0000644000175000017500000003531110736114306017025 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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: inifile.c,v 1.6.2.3.4.3 2007/12/31 07:22:46 sebastian Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "php.h" #include "php_globals.h" #include "safe_mode.h" #include "php_network.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: 1.6.2.3.4.3 $"; } /* }}} */ /* {{{ 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; int fd = 0; if (!readonly) { if (SUCCESS != php_stream_cast(fp, PHP_STREAM_AS_FD, (void*)&fd, 1)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not cast stream"); return NULL; } } dba = pemalloc(sizeof(inifile), persistent); memset(dba, 0, sizeof(inifile)); dba->fp = fp; dba->fd = fd; 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; php_stream_flush(dba->fp); if ((res=ftruncate(dba->fd, 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 [%d - %d] 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 [%d - %d] 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 [%d - %d] 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) { 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_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 */ php-4.4.8/ext/dba/libinifile/inifile.h0000644000175000017500000000450110736114306017027 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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: inifile.h,v 1.1.2.1.6.3 2007/12/31 07:22:46 sebastian Exp $ */ #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 fd; 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 php-4.4.8/ext/dba/php_cdb.h0000644000175000017500000000015007127752140014701 0ustar derickderick#ifndef PHP_CDB_H #define PHP_CDB_H #if DBA_CDB #include "php_dba.h" DBA_FUNCS(cdb); #endif #endif php-4.4.8/ext/dba/php_db2.h0000644000175000017500000000015007127752140014620 0ustar derickderick#ifndef PHP_DB2_H #define PHP_DB2_H #if DBA_DB2 #include "php_dba.h" DBA_FUNCS(db2); #endif #endif php-4.4.8/ext/dba/php_db3.h0000644000175000017500000000015007127752140014621 0ustar derickderick#ifndef PHP_DB3_H #define PHP_DB3_H #if DBA_DB3 #include "php_dba.h" DBA_FUNCS(db3); #endif #endif php-4.4.8/ext/dba/php_db4.h0000644000175000017500000000015007604115350014616 0ustar derickderick#ifndef PHP_DB4_H #define PHP_DB4_H #if DBA_DB4 #include "php_dba.h" DBA_FUNCS(db4); #endif #endif php-4.4.8/ext/dba/php_dba.h0000644000175000017500000001170010736114306014676 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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: php_dba.h,v 1.19.2.5.8.3 2007/12/31 07:22:46 sebastian Exp $ */ #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; int fd; 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 */ /* 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) 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); #else #define dba_module_ptr NULL #endif #define phpext_dba_ptr dba_module_ptr #endif php-4.4.8/ext/dba/php_dbm.h0000644000175000017500000000015007127752140014713 0ustar derickderick#ifndef PHP_DBM_H #define PHP_DBM_H #if DBA_DBM #include "php_dba.h" DBA_FUNCS(dbm); #endif #endif php-4.4.8/ext/dba/php_flatfile.h0000644000175000017500000000017407562113621015743 0ustar derickderick#ifndef PHP_FLATFILE_H #define PHP_FLATFILE_H #if DBA_FLATFILE #include "php_dba.h" DBA_FUNCS(flatfile); #endif #endif php-4.4.8/ext/dba/CREDITS0000644000175000017500000000004307561532000014143 0ustar derickderickDBA Sascha Schumann, Marcus Boergerphp-4.4.8/ext/dba/dba.dsp0000644000175000017500000001557007772043064014407 0ustar derickderick# 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 php4ts.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 php4ts.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 php4ts_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 php4ts_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" !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 php-4.4.8/ext/dba/php_gdbm.h0000644000175000017500000000015407127752140015066 0ustar derickderick#ifndef PHP_GDBM_H #define PHP_GDBM_H #if DBA_GDBM #include "php_dba.h" DBA_FUNCS(gdbm); #endif #endif php-4.4.8/ext/dbx/0000755000175000017500000000000010737115146013164 5ustar derickderickphp-4.4.8/ext/dbx/dbx.dsp0000644000175000017500000001365707434143657014475 0ustar derickderick# Microsoft Developer Studio Project File - Name="dbx" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 CFG=dbx - 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 "dbx.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 "dbx.mak" CFG="dbx - Win32 Release_TS" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "dbx - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "dbx - 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)" == "dbx - 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_dbx" /D ZTS=1 /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\..\bindlib_w32" /I "..\..\TSRM" /D "WIN32" /D "DBX_EXPORTS" /D "COMPILE_DL_DBX" /D ZTS=1 /D HAVE_LIBINTL=1 /D ZEND_DEBUG=0 /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ZEND_WIN32" /D "PHP_WIN32" /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 php4ts.lib /nologo /dll /machine:I386 /out:"..\..\Release_TS/php_dbx.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" # ADD LINK32 php4ts.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_dbx.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" !ELSEIF "$(CFG)" == "dbx - 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 "MSSQL_EXPORTS" /D "COMPILE_DL_dbx" /D ZTS=1 /YX /FD /c # ADD CPP /nologo /MDd /W3 /GX /ZI /Od /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 "DBX_EXPORTS" /D "COMPILE_DL_DBX" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_LIBINTL=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 php4ts.lib /nologo /dll /machine:I386 /out:"../../Debug_TS/php_dbx.dll" /libpath:"..\..\Debug_TS" # ADD LINK32 php4ts_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_dbx.dll" /libpath:"..\..\Debug_TS" !ENDIF # Begin Target # Name "dbx - Win32 Release_TS" # Name "dbx - Win32 Debug_TS" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=.\dbx.c # End Source File # Begin Source File SOURCE=.\dbx_fbsql.c # End Source File # Begin Source File SOURCE=.\dbx_mssql.c # End Source File # Begin Source File SOURCE=.\dbx_mysql.c # End Source File # Begin Source File SOURCE=.\dbx_oci8.c # End Source File # Begin Source File SOURCE=.\dbx_odbc.c # End Source File # Begin Source File SOURCE=.\dbx_pgsql.c # End Source File # Begin Source File SOURCE=.\dbx_sybasect.c # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=.\dbx.h # End Source File # Begin Source File SOURCE=.\dbx_fbsql.h # End Source File # Begin Source File SOURCE=.\dbx_mssql.h # End Source File # Begin Source File SOURCE=.\dbx_mysql.h # End Source File # Begin Source File SOURCE=.\dbx_oci8.h # End Source File # Begin Source File SOURCE=.\dbx_odbc.h # End Source File # Begin Source File SOURCE=.\dbx_pgsql.h # End Source File # Begin Source File SOURCE=.\dbx_sybasect.h # End Source File # Begin Source File SOURCE=.\php_dbx.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 php-4.4.8/ext/dbx/dbx.c0000644000175000017500000011174310736114306014110 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | dbx module version 1.0 | +----------------------------------------------------------------------+ | Copyright (c) 2001 Guidance Rotterdam BV | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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 : Marc Boeren | +----------------------------------------------------------------------+ */ /* $Id: dbx.c,v 1.42.2.2.8.3 2007/12/31 07:22:46 sebastian Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "php.h" #include "php_ini.h" #include "php_dbx.h" #include "ext/standard/info.h" /* defines for supported databases */ #define DBX_UNKNOWN 0 #define DBX_MYSQL 1 #define DBX_ODBC 2 #define DBX_PGSQL 3 #define DBX_MSSQL 4 #define DBX_FBSQL 5 #define DBX_OCI8 6 #define DBX_SYBASECT 7 /* includes for supported databases */ #include "dbx.h" #include "dbx_mysql.h" #include "dbx_odbc.h" #include "dbx_pgsql.h" #include "dbx_mssql.h" #include "dbx_fbsql.h" #include "dbx_oci8.h" #include "dbx_sybasect.h" /* support routines */ int module_exists(char *module_name) { zend_module_entry *zme; int r; r = zend_hash_find(&module_registry, module_name, strlen(module_name)+1, (void **) &zme); return r==0?1:0; } int module_identifier_exists(long module_identifier) { switch (module_identifier) { case DBX_MYSQL: return module_exists("mysql"); case DBX_ODBC: return module_exists("odbc"); case DBX_PGSQL: return module_exists("pgsql"); case DBX_MSSQL: return module_exists("mssql"); case DBX_FBSQL: return module_exists("fbsql"); case DBX_OCI8: return module_exists("oci8"); case DBX_SYBASECT: return module_exists("sybase_ct"); } return 0; } int get_module_identifier(char *module_name) { if (!strcmp("mysql", module_name)) return DBX_MYSQL; if (!strcmp("odbc", module_name)) return DBX_ODBC; if (!strcmp("pgsql", module_name)) return DBX_PGSQL; if (!strcmp("mssql", module_name)) return DBX_MSSQL; if (!strcmp("fbsql", module_name)) return DBX_FBSQL; if (!strcmp("oci8", module_name)) return DBX_OCI8; if (!strcmp("sybase_ct", module_name)) return DBX_SYBASECT; return DBX_UNKNOWN; } int split_dbx_handle_object(zval **dbx_object, zval ***pdbx_handle, zval ***pdbx_module, zval ***pdbx_database TSRMLS_DC) { convert_to_object_ex(dbx_object); if (zend_hash_find(Z_OBJPROP_PP(dbx_object), "handle", 7, (void **) pdbx_handle)==FAILURE || zend_hash_find(Z_OBJPROP_PP(dbx_object), "module", 7, (void **) pdbx_module)==FAILURE || zend_hash_find(Z_OBJPROP_PP(dbx_object), "database", 9, (void **) pdbx_database)==FAILURE) { return 0; } return 1; } /* from dbx.h, to be used in support-files (dbx_mysql.c etc...) */ void dbx_call_any_function(INTERNAL_FUNCTION_PARAMETERS, char *function_name, zval **returnvalue, int number_of_arguments, zval ***params) { zval *zval_function_name; MAKE_STD_ZVAL(zval_function_name); ZVAL_STRING(zval_function_name, function_name, 1); if (call_user_function_ex(EG(function_table), NULL, zval_function_name, returnvalue, number_of_arguments, params, 0, NULL TSRMLS_CC) == FAILURE) { zend_error(E_ERROR, "function '%s' not found", Z_STRVAL_P(zval_function_name)); } zval_dtor(zval_function_name); /* to free stringvalue memory */ FREE_ZVAL(zval_function_name); } /* switch_dbx functions declarations * each must be supported in the dbx_module files as dbx_module_function, * e.g. switch_dbx_connect expects a dbx_mysql_connect in de dbx_mysql files * all params except the dbx_module param are passed on * each must return the expected zval *'s in the rv parameter, which are passed on unmodified * do NOT use the return_value parameter from INTERNAL_FUNCTION_PARAMETERS * you can additionally return 0 or 1 for failure or success which will also be returned by the switches */ int switch_dbx_connect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS, zval **dbx_module); /* returns connection handle as resource on success or 0 as long on failure */ int switch_dbx_pconnect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS, zval **dbx_module); /* returns persistent connection handle as resource on success or 0 as long on failure */ int switch_dbx_close(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS, zval **dbx_module); /* returns 1 as long on success or 0 as long on failure */ int switch_dbx_query(zval **rv, zval **dbx_handle, zval **db_name, zval **sql_statement, INTERNAL_FUNCTION_PARAMETERS, zval **dbx_module); /* returns 1 as long or result identifier as resource on success or 0 as long on failure */ int switch_dbx_getcolumncount(zval **rv, zval **result_handle, INTERNAL_FUNCTION_PARAMETERS, zval **dbx_module); /* returns column-count as long on success or 0 as long on failure */ int switch_dbx_getcolumnname(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS, zval **dbx_module); /* returns column-name as string on success or 0 as long on failure */ int switch_dbx_getcolumntype(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS, zval **dbx_module); /* returns column-type as string on success or 0 as long on failure */ int switch_dbx_getrow(zval **rv, zval **result_handle, long row_number, INTERNAL_FUNCTION_PARAMETERS, zval **dbx_module); /* returns array[0..columncount-1] as strings on success or 0 as long on failure */ int switch_dbx_error(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS, zval **dbx_module); /* returns string */ int switch_dbx_esc(zval **rv, zval **dbx_handle, zval **string, INTERNAL_FUNCTION_PARAMETERS, zval **dbx_module); /* returns escaped string */ /* Every user visible function must have an entry in dbx_functions[]. */ function_entry dbx_functions[] = { ZEND_FE(dbx_connect, NULL) ZEND_FE(dbx_close, NULL) ZEND_FE(dbx_query, NULL) ZEND_FE(dbx_error, NULL) ZEND_FE(dbx_escape_string, NULL) ZEND_FE(dbx_sort, NULL) ZEND_FE(dbx_compare, NULL) {NULL, NULL, NULL} /* Must be the last line in dbx_functions[] */ }; zend_module_entry dbx_module_entry = { STANDARD_MODULE_HEADER, "dbx", dbx_functions, ZEND_MINIT(dbx), ZEND_MSHUTDOWN(dbx), NULL, /*ZEND_RINIT(dbx), Replace with NULL if there's nothing to do at request start */ NULL, /*ZEND_RSHUTDOWN(dbx), Replace with NULL if there's nothing to do at request end */ ZEND_MINFO(dbx), NO_VERSION_YET, STANDARD_MODULE_PROPERTIES }; #ifdef COMPILE_DL_DBX ZEND_GET_MODULE(dbx) #endif ZEND_INI_BEGIN() ZEND_INI_ENTRY("dbx.colnames_case", "unchanged", ZEND_INI_SYSTEM, NULL) ZEND_INI_END() ZEND_MINIT_FUNCTION(dbx) { REGISTER_INI_ENTRIES(); REGISTER_LONG_CONSTANT("DBX_MYSQL", DBX_MYSQL, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("DBX_ODBC", DBX_ODBC, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("DBX_PGSQL", DBX_PGSQL, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("DBX_MSSQL", DBX_MSSQL, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("DBX_FBSQL", DBX_FBSQL, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("DBX_OCI8", DBX_OCI8, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("DBX_SYBASECT", DBX_SYBASECT, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("DBX_PERSISTENT", DBX_PERSISTENT, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("DBX_RESULT_INFO", DBX_RESULT_INFO, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("DBX_RESULT_INDEX", DBX_RESULT_INDEX, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("DBX_RESULT_ASSOC", DBX_RESULT_ASSOC, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("DBX_COLNAMES_UNCHANGED", DBX_COLNAMES_UNCHANGED, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("DBX_COLNAMES_UPPERCASE", DBX_COLNAMES_UPPERCASE, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("DBX_COLNAMES_LOWERCASE", DBX_COLNAMES_LOWERCASE, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("DBX_CMP_NATIVE", DBX_CMP_NATIVE, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("DBX_CMP_TEXT", DBX_CMP_TEXT, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("DBX_CMP_NUMBER", DBX_CMP_NUMBER, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("DBX_CMP_ASC", DBX_CMP_ASC, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("DBX_CMP_DESC", DBX_CMP_DESC, CONST_CS | CONST_PERSISTENT); return SUCCESS; } ZEND_MSHUTDOWN_FUNCTION(dbx) { UNREGISTER_INI_ENTRIES(); return SUCCESS; } /* Remove if there's nothing to do at request start */ /*ZEND_RINIT_FUNCTION(dbx) { return SUCCESS; }*/ /* Remove if there's nothing to do at request end */ /*ZEND_RSHUTDOWN_FUNCTION(dbx) { return SUCCESS; }*/ ZEND_MINFO_FUNCTION(dbx) { php_info_print_table_start(); php_info_print_table_row(2, "dbx support", "enabled"); php_info_print_table_row(2, "dbx version", "1.0.0"); php_info_print_table_row(2, "supported databases", "MySQL\nODBC\nPostgreSQL\nMicrosoft SQL Server\nFrontBase\nOracle 8 (oci8)\nSybase-CT"); php_info_print_table_end(); DISPLAY_INI_ENTRIES(); } /* actual implementation of the dbx functions */ /* {{{ proto dbx_link_object dbx_connect(string module_name, string host, string db, string username, string password [, bool persistent]) Returns a dbx_link_object on success and returns 0 on failure */ ZEND_FUNCTION(dbx_connect) { int number_of_arguments=5; zval **arguments[6]; int result; long module_identifier; zval *dbx_module; zval *db_name; zval *rv_dbx_handle; int persistent=0; if ( !(ZEND_NUM_ARGS()==number_of_arguments+1 || ZEND_NUM_ARGS()==number_of_arguments) || zend_get_parameters_array_ex(ZEND_NUM_ARGS(), arguments) == FAILURE) { WRONG_PARAM_COUNT; } if (ZEND_NUM_ARGS()==number_of_arguments+1) { convert_to_long_ex(arguments[5]); if (Z_LVAL_PP(arguments[5])!=0) persistent=1; } if (Z_TYPE_PP(arguments[0]) == IS_LONG) { if (!module_identifier_exists(Z_LVAL_PP(arguments[0]))) { zend_error(E_WARNING, "dbx: module '%ld' not loaded or not supported.", Z_LVAL_PP(arguments[0])); return; } module_identifier = Z_LVAL_PP(arguments[0]); } else { convert_to_string_ex(arguments[0]); if (!module_exists(Z_STRVAL_PP(arguments[0]))) { zend_error(E_WARNING, "dbx: module '%s' not loaded.", Z_STRVAL_PP(arguments[0])); return; } module_identifier=get_module_identifier(Z_STRVAL_PP(arguments[0])); if (!module_identifier) { zend_error(E_WARNING, "dbx: unsupported module '%s'.", Z_STRVAL_PP(arguments[0])); return; } } MAKE_STD_ZVAL(dbx_module); ZVAL_LONG(dbx_module, module_identifier); MAKE_STD_ZVAL(rv_dbx_handle); ZVAL_LONG(rv_dbx_handle, 0); convert_to_string_ex(arguments[1]); convert_to_string_ex(arguments[2]); convert_to_string_ex(arguments[3]); convert_to_string_ex(arguments[4]); MAKE_STD_ZVAL(db_name); ZVAL_STRING(db_name, Z_STRVAL_PP(arguments[2]), 1); if (persistent) { result = switch_dbx_pconnect(&rv_dbx_handle, arguments[1], arguments[2], arguments[3], arguments[4], INTERNAL_FUNCTION_PARAM_PASSTHRU, &dbx_module); } else { result = switch_dbx_connect(&rv_dbx_handle, arguments[1], arguments[2], arguments[3], arguments[4], INTERNAL_FUNCTION_PARAM_PASSTHRU, &dbx_module); } if (!result) { FREE_ZVAL(dbx_module); zval_dtor(db_name); /* to free stringvalue memory */ FREE_ZVAL(db_name); FREE_ZVAL(rv_dbx_handle); RETURN_LONG(0); } if (object_init(return_value) != SUCCESS) { zend_error(E_ERROR, "dbx: unable to create resulting object..."); FREE_ZVAL(dbx_module); zval_dtor(db_name); /* to free stringvalue memory */ FREE_ZVAL(db_name); FREE_ZVAL(rv_dbx_handle); RETURN_LONG(0); } zend_hash_update(Z_OBJPROP_P(return_value), "handle", 7, (void *)&(rv_dbx_handle), sizeof(zval *), NULL); zend_hash_update(Z_OBJPROP_P(return_value), "module", 7, (void *)&(dbx_module), sizeof(zval *), NULL); zend_hash_update(Z_OBJPROP_P(return_value), "database", 9, (void *)&(db_name), sizeof(zval *), NULL); } /* }}} */ /* {{{ proto bool dbx_close(dbx_link_object dbx_link) Returns success or failure */ ZEND_FUNCTION(dbx_close) { int number_of_arguments=1; zval **arguments[1]; int result; zval **dbx_handle; zval **dbx_module; zval **dbx_database; zval *rv_success; if (ZEND_NUM_ARGS() !=number_of_arguments || zend_get_parameters_array_ex(number_of_arguments, arguments) == FAILURE) { WRONG_PARAM_COUNT; } if (!split_dbx_handle_object(arguments[0], &dbx_handle, &dbx_module, &dbx_database TSRMLS_CC)) { zend_error(E_WARNING, "dbx_close: not a valid dbx_handle-object..."); RETURN_LONG(0); } MAKE_STD_ZVAL(rv_success); ZVAL_LONG(rv_success, 0); result = switch_dbx_close(&rv_success, dbx_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU, dbx_module); result = (result && Z_LVAL_P(rv_success))?1:0; FREE_ZVAL(rv_success); RETURN_LONG(result?1:0); } /* }}} */ /* {{{ proto dbx_result_object dbx_query(dbx_link_object dbx_link, string sql_statement [, long flags]) Returns a dbx_link_object on success and returns 0 on failure */ ZEND_FUNCTION(dbx_query) { int min_number_of_arguments=2; int number_of_arguments=3; zval **arguments[3]; int result; zval **dbx_handle; zval **dbx_module; zval **dbx_database; zval *rv_result_handle; zval *rv_column_count; long col_index; long row_count; zval *info; long query_flags; long result_flags; zval *data; zval **row_ptr; zval **inforow_ptr; /* default values for colname-case */ char * colnames_case = INI_STR("dbx.colnames_case"); long colcase = DBX_COLNAMES_UNCHANGED; if (!strcmp(colnames_case, "uppercase")) { colcase = DBX_COLNAMES_UPPERCASE; } if (!strcmp(colnames_case, "lowercase")) { colcase = DBX_COLNAMES_LOWERCASE; } if (ZEND_NUM_ARGS()number_of_arguments || zend_get_parameters_array_ex(ZEND_NUM_ARGS(), arguments) == FAILURE) { WRONG_PARAM_COUNT; } if (!split_dbx_handle_object(arguments[0], &dbx_handle, &dbx_module, &dbx_database TSRMLS_CC)) { zend_error(E_WARNING, "dbx_query: not a valid dbx_handle-object..."); RETURN_LONG(0); } /* default values */ result_flags = DBX_RESULT_INFO | DBX_RESULT_INDEX | DBX_RESULT_ASSOC; /* parameter overrides */ if (ZEND_NUM_ARGS()>2) { convert_to_long_ex(arguments[2]); query_flags = Z_LVAL_PP(arguments[2]); /* fieldnames are needed for association! */ result_flags = (query_flags & DBX_RESULT_INFO) | (query_flags & DBX_RESULT_INDEX) | (query_flags & DBX_RESULT_ASSOC); if (result_flags & DBX_RESULT_ASSOC) { result_flags |= DBX_RESULT_INFO; } if (!result_flags) result_flags = DBX_RESULT_INFO | DBX_RESULT_INDEX | DBX_RESULT_ASSOC; /* override ini-setting for colcase */ if (query_flags & DBX_COLNAMES_UNCHANGED) { colcase = DBX_COLNAMES_UNCHANGED; } if (query_flags & DBX_COLNAMES_UPPERCASE) { colcase = DBX_COLNAMES_UPPERCASE; } if (query_flags & DBX_COLNAMES_LOWERCASE) { colcase = DBX_COLNAMES_LOWERCASE; } } MAKE_STD_ZVAL(rv_result_handle); ZVAL_LONG(rv_result_handle, 0); convert_to_string_ex(arguments[1]); result = switch_dbx_query(&rv_result_handle, dbx_handle, dbx_database, arguments[1], INTERNAL_FUNCTION_PARAM_PASSTHRU, dbx_module); /* boolean return value means either failure for any query or success for queries that don't return anything */ if (!result || (rv_result_handle && Z_TYPE_P(rv_result_handle)==IS_BOOL)) { result = (result && Z_LVAL_P(rv_result_handle))?1:0; FREE_ZVAL(rv_result_handle); RETURN_LONG(result?1:0); } /* if you get here, the query succeeded and returned results, so we'll return them * rv_result_handle holds a resource */ /* init return_value as object (of rows) */ if (object_init(return_value) != SUCCESS) { zend_error(E_ERROR, "dbx_query: unable to create resulting object..."); FREE_ZVAL(rv_result_handle); RETURN_LONG(0); } /* add result_handle property to return_value */ zend_hash_update(Z_OBJPROP_P(return_value), "handle", 7, (void *)&(rv_result_handle), sizeof(zval *), NULL); /* init info property as array and add to return_value as a property */ if (result_flags & DBX_RESULT_INFO) { MAKE_STD_ZVAL(info); if (array_init(info) != SUCCESS) { zend_error(E_ERROR, "dbx_query: unable to create info-array for results..."); FREE_ZVAL(info); RETURN_LONG(0); } zend_hash_update(Z_OBJPROP_P(return_value), "info", 5, (void *)&(info), sizeof(zval *), NULL); } /* init data property as array and add to return_value as a property */ MAKE_STD_ZVAL(data); if (array_init(data) != SUCCESS) { zend_error(E_ERROR, "dbx_query: unable to create data-array for results..."); FREE_ZVAL(data); RETURN_LONG(0); } zend_hash_update(Z_OBJPROP_P(return_value), "data", 5, (void *)&(data), sizeof(zval *), NULL); /* get columncount and add to returnvalue as property */ MAKE_STD_ZVAL(rv_column_count); ZVAL_LONG(rv_column_count, 0); result = switch_dbx_getcolumncount(&rv_column_count, &rv_result_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU, dbx_module); if (!result) { zend_error(E_ERROR, "dbx_query: get column_count failed..."); FREE_ZVAL(rv_column_count); RETURN_LONG(0); } zend_hash_update(Z_OBJPROP_P(return_value), "cols", 5, (void *)&(rv_column_count), sizeof(zval *), NULL); /* fill the info array with columnnames and types (indexed and assoc) */ if (result_flags & DBX_RESULT_INFO) { zval *info_row_name; zval *info_row_type; MAKE_STD_ZVAL(info_row_name); MAKE_STD_ZVAL(info_row_type); if (array_init(info_row_name) != SUCCESS) { zend_error(E_ERROR, "dbx_query: unable to create info_row_name-array for results..."); FREE_ZVAL(info_row_name); FREE_ZVAL(info_row_type); RETURN_LONG(0); } if (array_init(info_row_type) != SUCCESS) { zend_error(E_ERROR, "dbx_query: unable to create info_row_type-array for results..."); FREE_ZVAL(info_row_name); FREE_ZVAL(info_row_type); RETURN_LONG(0); } for (col_index=0; col_indexrefcount+=1; (*actual_ptr)->is_ref=1; zend_hash_update(Z_ARRVAL_PP(row_ptr), Z_STRVAL_PP(columnname_ptr), Z_STRLEN_PP(columnname_ptr) + 1, actual_ptr, sizeof(zval *), NULL); } } ++row_count; } else { FREE_ZVAL(rv_row); } } /* add row_count property */ add_property_long(return_value, "rows", row_count); } /* }}} */ /* {{{ proto void dbx_error(dbx_link_object dbx_link) Returns success or failure */ ZEND_FUNCTION(dbx_error) { int number_of_arguments=1; zval **arguments[1]; int result; zval **dbx_handle; zval **dbx_module; zval **dbx_database; zval *rv_errormsg; if (ZEND_NUM_ARGS() !=number_of_arguments || zend_get_parameters_array_ex(number_of_arguments, arguments) == FAILURE) { WRONG_PARAM_COUNT; } if (!split_dbx_handle_object(arguments[0], &dbx_handle, &dbx_module, &dbx_database TSRMLS_CC)) { zend_error(E_WARNING, "dbx_error: not a valid dbx_handle-object..."); RETURN_LONG(0); } MAKE_STD_ZVAL(rv_errormsg); ZVAL_LONG(rv_errormsg, 0); result = switch_dbx_error(&rv_errormsg, dbx_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU, dbx_module); if (!result) { FREE_ZVAL(rv_errormsg); RETURN_STRING("", 1); } MOVE_RETURNED_TO_RV(&return_value, rv_errormsg); } /* }}} */ /* {{{ proto string dbx_esc(dbx_link_object dbx_link, string sz) Returns escaped string or NULL on error */ ZEND_FUNCTION(dbx_escape_string) { int number_of_arguments=2; zval **arguments[2]; int result; zval **dbx_handle; zval **dbx_module; zval **dbx_database; zval *rv; if (ZEND_NUM_ARGS() !=number_of_arguments || zend_get_parameters_array_ex(number_of_arguments, arguments) == FAILURE) { WRONG_PARAM_COUNT; } if (!split_dbx_handle_object(arguments[0], &dbx_handle, &dbx_module, &dbx_database TSRMLS_CC)) { zend_error(E_WARNING, "dbx_esc: not a valid dbx_handle-object..."); RETURN_NULL(); } convert_to_string_ex(arguments[1]); MAKE_STD_ZVAL(rv); ZVAL_LONG(rv, 0); result = switch_dbx_esc(&rv, dbx_handle, arguments[1], INTERNAL_FUNCTION_PARAM_PASSTHRU, dbx_module); if (!result) { /* this will probably never happen */ FREE_ZVAL(rv); RETURN_NULL(); } MOVE_RETURNED_TO_RV(&return_value, rv); } /* }}} */ /* * dbx functions that are database independent... like sorting result_objects! */ /* {{{ proto int dbx_compare(array row_x, array row_y, string columnname [, int flags]) Returns row_y[columnname] - row_x[columnname], converted to -1, 0 or 1 */ ZEND_FUNCTION(dbx_compare) { int min_number_of_arguments=3; int max_number_of_arguments=4; int number_of_arguments=-1; long comparison_direction=DBX_CMP_ASC; long comparison_type=DBX_CMP_NATIVE; double dtemp; long ltemp; zval **arguments[4]; zval **zv_a; zval **zv_b; int result=0; number_of_arguments=ZEND_NUM_ARGS(); if (number_of_argumentsmax_number_of_arguments || zend_get_parameters_array_ex(number_of_arguments, arguments) == FAILURE) { WRONG_PARAM_COUNT; } if (Z_TYPE_PP(arguments[0]) != IS_ARRAY || Z_TYPE_PP(arguments[1]) != IS_ARRAY) { zend_error(E_WARNING, "Wrong argument type for compare"); RETURN_LONG(0); } convert_to_string_ex(arguments[2]); /* field name */ comparison_type = DBX_CMP_NATIVE; comparison_direction = DBX_CMP_ASC; if (number_of_arguments>3) { convert_to_long_ex(arguments[3]); /* comparison type and direction*/ /* direction */ if (Z_LVAL_PP(arguments[3]) & DBX_CMP_DESC) { comparison_direction=DBX_CMP_DESC; } if (Z_LVAL_PP(arguments[3]) & DBX_CMP_ASC) { comparison_direction=DBX_CMP_ASC; } /* type */ if (Z_LVAL_PP(arguments[3]) & DBX_CMP_NUMBER) { comparison_type=DBX_CMP_NUMBER; } if (Z_LVAL_PP(arguments[3]) & DBX_CMP_TEXT) { comparison_type=DBX_CMP_TEXT; } if (Z_LVAL_PP(arguments[3]) & DBX_CMP_NATIVE) { comparison_type=DBX_CMP_NATIVE; } } if (zend_hash_find(Z_ARRVAL_PP(arguments[0]), Z_STRVAL_PP(arguments[2]), Z_STRLEN_PP(arguments[2])+1, (void **) &zv_a)==FAILURE || zend_hash_find(Z_ARRVAL_PP(arguments[1]), Z_STRVAL_PP(arguments[2]), Z_STRLEN_PP(arguments[2])+1, (void **) &zv_b)==FAILURE) { zend_error(E_WARNING, "Field '%s' not available in result-object", Z_STRVAL_PP(arguments[2])); RETURN_LONG(0); } switch (comparison_type) { case DBX_CMP_TEXT: convert_to_string_ex(zv_a); convert_to_string_ex(zv_b); break; case DBX_CMP_NUMBER: convert_to_double_ex(zv_a); convert_to_double_ex(zv_b); break; } switch (Z_TYPE_PP(zv_a)) { case IS_NULL: result=0; break; case IS_BOOL: case IS_LONG: case IS_CONSTANT: ltemp = Z_LVAL_PP(zv_a) - Z_LVAL_PP(zv_b); result = (ltemp==0?0: (ltemp>0?1:-1)); break; case IS_DOUBLE: dtemp = (Z_DVAL_PP(zv_a) - Z_DVAL_PP(zv_b)); result = (dtemp==0?0: (dtemp>0?1:-1)); break; case IS_STRING: ltemp = strcmp(Z_STRVAL_PP(zv_a), Z_STRVAL_PP(zv_b)); result = (ltemp==0?0: (ltemp>0?1:-1)); break; default: result=0; } if (comparison_direction==DBX_CMP_DESC) RETURN_LONG(-result); RETURN_LONG(result); } /* }}} */ /* {{{ proto int dbx_sort(object dbx_result, string compare_function_name) Returns 0 on failure, 1 on success */ ZEND_FUNCTION(dbx_sort) { int number_of_arguments=2; zval **arguments[2]; zval **zval_data; zval *returned_zval; if (ZEND_NUM_ARGS() !=number_of_arguments || zend_get_parameters_array_ex(number_of_arguments, arguments) == FAILURE) { WRONG_PARAM_COUNT; } if (Z_TYPE_PP(arguments[0]) != IS_OBJECT || Z_TYPE_PP(arguments[1]) != IS_STRING) { zend_error(E_WARNING, "Wrong argument type for sort"); RETURN_LONG(0); } if (zend_hash_find(Z_OBJPROP_PP(arguments[0]), "data", 5, (void **) &zval_data)==FAILURE || Z_TYPE_PP(zval_data) != IS_ARRAY) { zend_error(E_WARNING, "Wrong argument type for sort"); RETURN_LONG(0); } arguments[0] = zval_data; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "usort", &returned_zval, number_of_arguments, arguments); zval_ptr_dtor(&returned_zval); RETURN_LONG(1); } /* }}} */ /***********************************/ /* * switch_dbx functions */ int switch_dbx_connect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS, zval **dbx_module) { /* returns connection handle as resource on success or 0 as long on failure */ switch (Z_LVAL_PP(dbx_module)) { case DBX_MYSQL: return dbx_mysql_connect(rv, host, db, username, password, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_ODBC: return dbx_odbc_connect(rv, host, db, username, password, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_PGSQL: return dbx_pgsql_connect(rv, host, db, username, password, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_MSSQL: return dbx_mssql_connect(rv, host, db, username, password, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_FBSQL: return dbx_fbsql_connect(rv, host, db, username, password, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_OCI8: return dbx_oci8_connect(rv, host, db, username, password, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_SYBASECT: return dbx_sybasect_connect(rv, host, db, username, password, INTERNAL_FUNCTION_PARAM_PASSTHRU); } zend_error(E_WARNING, "dbx_connect: not supported in this module"); return 0; } int switch_dbx_pconnect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS, zval **dbx_module) { /* returns persistent connection handle as resource on success or 0 as long on failure */ switch (Z_LVAL_PP(dbx_module)) { case DBX_MYSQL: return dbx_mysql_pconnect(rv, host, db, username, password, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_ODBC: return dbx_odbc_pconnect(rv, host, db, username, password, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_PGSQL: return dbx_pgsql_pconnect(rv, host, db, username, password, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_MSSQL: return dbx_mssql_pconnect(rv, host, db, username, password, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_FBSQL: return dbx_fbsql_pconnect(rv, host, db, username, password, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_OCI8: return dbx_oci8_pconnect(rv, host, db, username, password, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_SYBASECT: return dbx_sybasect_pconnect(rv, host, db, username, password, INTERNAL_FUNCTION_PARAM_PASSTHRU); } zend_error(E_WARNING, "dbx_pconnect: not supported in this module"); return 0; } int switch_dbx_close(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS, zval **dbx_module) { /* returns 1 as long on success or 0 as long on failure */ switch (Z_LVAL_PP(dbx_module)) { case DBX_MYSQL: return dbx_mysql_close(rv, dbx_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_ODBC: return dbx_odbc_close(rv, dbx_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_PGSQL: return dbx_pgsql_close(rv, dbx_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_MSSQL: return dbx_mssql_close(rv, dbx_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_FBSQL: return dbx_fbsql_close(rv, dbx_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_OCI8: return dbx_oci8_close(rv, dbx_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_SYBASECT: return dbx_sybasect_close(rv, dbx_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU); } zend_error(E_WARNING, "dbx_close: not supported in this module"); return 0; } int switch_dbx_query(zval **rv, zval **dbx_handle, zval **db_name, zval **sql_statement, INTERNAL_FUNCTION_PARAMETERS, zval **dbx_module) { /* returns 1 as long or result identifier as resource on success or 0 as long on failure */ switch (Z_LVAL_PP(dbx_module)) { case DBX_MYSQL: return dbx_mysql_query(rv, dbx_handle, db_name, sql_statement, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_ODBC: return dbx_odbc_query(rv, dbx_handle, db_name, sql_statement, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_PGSQL: return dbx_pgsql_query(rv, dbx_handle, db_name, sql_statement, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_MSSQL: return dbx_mssql_query(rv, dbx_handle, db_name, sql_statement, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_FBSQL: return dbx_fbsql_query(rv, dbx_handle, db_name, sql_statement, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_OCI8: return dbx_oci8_query(rv, dbx_handle, db_name, sql_statement, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_SYBASECT: return dbx_sybasect_query(rv, dbx_handle, db_name, sql_statement, INTERNAL_FUNCTION_PARAM_PASSTHRU); } zend_error(E_WARNING, "dbx_query: not supported in this module"); return 0; } int switch_dbx_getcolumncount(zval **rv, zval **result_handle, INTERNAL_FUNCTION_PARAMETERS, zval **dbx_module) { /* returns column-count as long on success or 0 as long on failure */ switch (Z_LVAL_PP(dbx_module)) { case DBX_MYSQL: return dbx_mysql_getcolumncount(rv, result_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_ODBC: return dbx_odbc_getcolumncount(rv, result_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_PGSQL: return dbx_pgsql_getcolumncount(rv, result_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_MSSQL: return dbx_mssql_getcolumncount(rv, result_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_FBSQL: return dbx_fbsql_getcolumncount(rv, result_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_OCI8: return dbx_oci8_getcolumncount(rv, result_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_SYBASECT: return dbx_sybasect_getcolumncount(rv, result_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU); } zend_error(E_WARNING, "dbx_getcolumncount: not supported in this module"); return 0; } int switch_dbx_getcolumnname(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS, zval **dbx_module) { /* returns column-name as string on success or 0 as long on failure */ switch (Z_LVAL_PP(dbx_module)) { case DBX_MYSQL: return dbx_mysql_getcolumnname(rv, result_handle, column_index, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_ODBC: return dbx_odbc_getcolumnname(rv, result_handle, column_index, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_PGSQL: return dbx_pgsql_getcolumnname(rv, result_handle, column_index, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_MSSQL: return dbx_mssql_getcolumnname(rv, result_handle, column_index, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_FBSQL: return dbx_fbsql_getcolumnname(rv, result_handle, column_index, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_OCI8: return dbx_oci8_getcolumnname(rv, result_handle, column_index, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_SYBASECT: return dbx_sybasect_getcolumnname(rv, result_handle, column_index, INTERNAL_FUNCTION_PARAM_PASSTHRU); } zend_error(E_WARNING, "dbx_getcolumnname: not supported in this module"); return 0; } int switch_dbx_getcolumntype(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS, zval **dbx_module) { /* returns column-type as string on success or 0 as long on failure */ switch (Z_LVAL_PP(dbx_module)) { case DBX_MYSQL: return dbx_mysql_getcolumntype(rv, result_handle, column_index, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_ODBC: return dbx_odbc_getcolumntype(rv, result_handle, column_index, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_PGSQL: return dbx_pgsql_getcolumntype(rv, result_handle, column_index, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_MSSQL: return dbx_mssql_getcolumntype(rv, result_handle, column_index, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_FBSQL: return dbx_fbsql_getcolumntype(rv, result_handle, column_index, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_OCI8: return dbx_oci8_getcolumntype(rv, result_handle, column_index, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_SYBASECT: return dbx_sybasect_getcolumntype(rv, result_handle, column_index, INTERNAL_FUNCTION_PARAM_PASSTHRU); } zend_error(E_WARNING, "dbx_getcolumntype: not supported in this module"); return 0; } int switch_dbx_getrow(zval **rv, zval **result_handle, long row_number, INTERNAL_FUNCTION_PARAMETERS, zval **dbx_module) { /* returns array[0..columncount-1] as strings on success or 0 as long on failure */ switch (Z_LVAL_PP(dbx_module)) { case DBX_MYSQL: return dbx_mysql_getrow(rv, result_handle, row_number, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_ODBC: return dbx_odbc_getrow(rv, result_handle, row_number, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_PGSQL: return dbx_pgsql_getrow(rv, result_handle, row_number, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_MSSQL: return dbx_mssql_getrow(rv, result_handle, row_number, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_FBSQL: return dbx_fbsql_getrow(rv, result_handle, row_number, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_OCI8: return dbx_oci8_getrow(rv, result_handle, row_number, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_SYBASECT: return dbx_sybasect_getrow(rv, result_handle, row_number, INTERNAL_FUNCTION_PARAM_PASSTHRU); } zend_error(E_WARNING, "dbx_getrow: not supported in this module"); return 0; } int switch_dbx_error(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS, zval **dbx_module) { /* returns string */ switch (Z_LVAL_PP(dbx_module)) { case DBX_MYSQL: return dbx_mysql_error(rv, dbx_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_ODBC: return dbx_odbc_error(rv, dbx_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_PGSQL: return dbx_pgsql_error(rv, dbx_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_MSSQL: return dbx_mssql_error(rv, dbx_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_FBSQL: return dbx_fbsql_error(rv, dbx_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU); /* case DBX_OCI8: return dbx_oci8_error(rv, dbx_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU); */ case DBX_SYBASECT: return dbx_sybasect_error(rv, dbx_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU); } zend_error(E_WARNING, "dbx_error: not supported in this module"); return 0; } int switch_dbx_esc(zval **rv, zval **dbx_handle, zval **string, INTERNAL_FUNCTION_PARAMETERS, zval **dbx_module) { /* returns escaped string */ switch (Z_LVAL_PP(dbx_module)) { case DBX_MYSQL: return dbx_mysql_esc(rv, dbx_handle, string, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_ODBC: return dbx_odbc_esc(rv, dbx_handle, string, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_PGSQL: return dbx_pgsql_esc(rv, dbx_handle, string, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_MSSQL: return dbx_mssql_esc(rv, dbx_handle, string, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_FBSQL: return dbx_fbsql_esc(rv, dbx_handle, string, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_OCI8: return dbx_oci8_esc(rv, dbx_handle, string, INTERNAL_FUNCTION_PARAM_PASSTHRU); case DBX_SYBASECT: return dbx_sybasect_esc(rv, dbx_handle, string, INTERNAL_FUNCTION_PARAM_PASSTHRU); } zend_error(E_WARNING, "dbx_esc: not supported in this module"); return 0; } /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: */ php-4.4.8/ext/dbx/dbx.h0000644000175000017500000000470010736114306014107 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | dbx module version 1.0 | +----------------------------------------------------------------------+ | Copyright (c) 2001 Guidance Rotterdam BV | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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 : Marc Boeren | +----------------------------------------------------------------------+ */ /* $Id: dbx.h,v 1.11.2.1.8.3 2007/12/31 07:22:46 sebastian Exp $ */ #ifndef ZEND_DBX_H #define ZEND_DBX_H #ifndef INIT_FUNC_ARGS #include "zend_modules.h" #endif #include "php.h" #include "ext/standard/php_string.h" #define DBX_PERSISTENT (1<<0) #define DBX_RESULT_INFO (1<<0) #define DBX_RESULT_INDEX (1<<1) #define DBX_RESULT_ASSOC (1<<2) #define DBX_COLNAMES_UNCHANGED (1<<3) #define DBX_COLNAMES_UPPERCASE (1<<4) #define DBX_COLNAMES_LOWERCASE (1<<5) #define DBX_CMP_NATIVE (1<<0) #define DBX_CMP_TEXT (1<<1) #define DBX_CMP_NUMBER (1<<2) #define DBX_CMP_ASC (1<<3) #define DBX_CMP_DESC (1<<4) #define MOVE_RETURNED_TO_RV(rv, returned_zval) { **rv = *returned_zval; zval_copy_ctor(*rv); zval_ptr_dtor(&returned_zval); } void dbx_call_any_function(INTERNAL_FUNCTION_PARAMETERS, char *function_name, zval **returnvalue, int number_of_arguments, zval ***params); #endif /* ZEND_DBX_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: */ php-4.4.8/ext/dbx/tests/0000755000175000017500000000000010737115146014326 5ustar derickderickphp-4.4.8/ext/dbx/tests/dbx_test.p0000644000175000017500000000325407556000274016327 0ustar derickderickphp-4.4.8/ext/dbx/tests/dbx_test.script0000644000175000017500000022435107314104547017377 0ustar derickderick create database if not exists dbx_test; use dbx_test; grant SELECT,INSERT,UPDATE,DELETE on dbx_test.* to dbx_testuser@localhost identified by 'dbx_testpassword'; # info tables drop table if exists tbl; create table tbl ( id int(10) NOT NULL default 0, parentid int(10) NOT NULL default 0, description varchar(255) NULL, field1 mediumtext NULL, field2 mediumtext NULL, field3 mediumtext NULL, field4 mediumtext NULL, field5 mediumtext NULL, creation_date timestamp NULL, PRIMARY KEY (id), KEY parentid (parentid), KEY description (description), KEY creation_date (creation_date) ); insert into tbl (id, parentid, description, field1, field2, field3, field4, field5, creation_date) values (1, 0, 'root', 'empty fields', '', '', '', '', 20010605110724), (10, 1, 'abc', 'field2 contains single quote', 'x''x', '', '', '', 20010605110724), (20, 1, 'cba', 'field2 contains double quote', 'x"x', '', '', '', 20010605110724), (30, 1, 'bac', 'field2 contains >4k text', 'asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl', '', '', '', 20010605110724), (40, 1, '100', 'field2 contains >64k text', 'asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl', '', '', '', 20010605110724), (50, 1, '20', 'empty fields', '', '', '', '', 20010605110724), (60, 1, '20', 'empty fields', '', '', '', '', 20010605110724) ;php-4.4.8/ext/dbx/tests/001.phpt0000644000175000017500000000027607556045472015541 0ustar derickderick--TEST-- Check for dbx presence --SKIPIF-- --FILE-- --EXPECT-- dbx extension is availablephp-4.4.8/ext/dbx/tests/skipif.inc0000644000175000017500000000023207556045472016314 0ustar derickderickphp-4.4.8/ext/dbx/tests/002.phpt0000644000175000017500000000265107557203073015533 0ustar derickderick--TEST-- DBX_CONSTANTS --SKIPIF-- --FILE-- --EXPECT-- okphp-4.4.8/ext/dbx/tests/003.phpt0000644000175000017500000000643107556045472015542 0ustar derickderick--TEST-- dbx_connect --SKIPIF-- --FILE-- --EXPECT-- connect using string ok connect using constant ok connect to non-existing database failed, so it's ok connect with false username/password combi failed, so it's ok persistent connect using string ok persistent connect using constant ok persistent connect to non-existing database failed, so it's ok persistent connect with false username/password combi failed, so it's ok too many parameters: connect failure works ok too few parameters: connect failure works ok multiple connects ok multiple connects (2nd fails on database-name) okphp-4.4.8/ext/dbx/tests/004.phpt0000644000175000017500000000151607556045472015542 0ustar derickderick--TEST-- dbx_close --SKIPIF-- --FILE-- --EXPECT-- close works ok close failure works ok too many parameters: close failure works ok too few parameters: close failure works okphp-4.4.8/ext/dbx/tests/005.phpt0000644000175000017500000001015407562244714015536 0ustar derickderick--TEST-- dbx_query --SKIPIF-- --INI-- magic_quotes_runtime=0 --FILE-- 64 k, as one of the test-fields // requires this (shouldn't this be a php.ini-entry??) if ($connection === DBX_SYBASECT) @dbx_query($dlo, "set textsize 100000"); // select query if ($dro=dbx_query($dlo, $sql_statement)) { for ($i=0; $i<$dro->rows; ++$i) { print($dro->data[$i]['id'].".".$dro->data[$i]['description'].".".$dro->data[$i]['field1'].".".strlen($dro->data[$i]['field2'])."\n"); } $dro->data[0]['id']='changed_value'; print($dro->data[0][0]."\n"); } // insert query if (dbx_query($dlo, $sql_insert_statement)) { print('insert-query: dbx_query works ok'."\n"); if ($dro=dbx_query($dlo, $sql_select_statement)) { for ($i=0; $i<$dro->rows; ++$i) { print($dro->data[$i]['id'].".".$dro->data[$i]['description'].".".strlen($dro->data[$i]['field2'])."\n"); } } } // update query if (dbx_query($dlo, $sql_update_statement)) { print('update-query: dbx_query works ok'."\n"); if ($dro=dbx_query($dlo, $sql_select_statement)) { for ($i=0; $i<$dro->rows; ++$i) { print($dro->data[$i]['id'].".".$dro->data[$i]['description'].".".strlen($dro->data[$i]['field2'])."\n"); } } } // delete query if (dbx_query($dlo, $sql_delete_statement)) { print('delete-query: dbx_query works ok'."\n"); if ($dro=dbx_query($dlo, $sql_select_statement)) { for ($i=0; $i<$dro->rows; ++$i) { print($dro->data[$i]['id'].".".$dro->data[$i]['description'].".".strlen($dro->data[$i]['field2'])."\n"); } } } // colnames_case flags if ($dro=dbx_query($dlo, $sql_statement, DBX_COLNAMES_LOWERCASE)) { print('column name lowercased: '); print($dro->info["name"][0].".".$dro->data[0]['id'].".".$dro->data[0]['description']."\n"); } if ($dro=dbx_query($dlo, $sql_statement, DBX_COLNAMES_UPPERCASE)) { print('column name uppercased: '); print($dro->info["name"][0].".".$dro->data[0]['ID'].".".$dro->data[0]['DESCRIPTION']."\n"); } // generate errors if (!@dbx_query(0, $sql_statement)) { print('wrong dbx_link_object: query failure works ok'."\n"); } if (!@dbx_query($dlo, $invalid_sql_statement)) { print('wrong sql-statement: query failure works ok'."\n"); } if (!@dbx_query($dlo, $sql_statement, DBX_RESULT_INDEX, "12many")) { print('too many parameters: query failure works ok'."\n"); } if (!@dbx_query($dlo)) { print('too few parameters: query failure works ok'."\n"); } dbx_close($dlo); } ?> --EXPECT-- 1.root.empty fields.0 10.abc.field2 contains single quote.3 20.cba.field2 contains double quote.3 30.bac.field2 contains >4k text.4591 40.100.field2 contains >64k text.70051 50.20.empty fields.0 60.20.empty fields.0 changed_value insert-query: dbx_query works ok 999999.temporary_record.0 update-query: dbx_query works ok 999999.temporary_record.11 delete-query: dbx_query works ok column name lowercased: id.1.root column name uppercased: ID.1.root wrong dbx_link_object: query failure works ok wrong sql-statement: query failure works ok too many parameters: query failure works ok too few parameters: query failure works ok php-4.4.8/ext/dbx/tests/006.phpt0000644000175000017500000000406207556045472015543 0ustar derickderick--TEST-- dbx_error --SKIPIF-- --FILE-- --EXPECT-- query generated an error: dbx_error works ok query is valid: dbx_error works ok wrong dbx_link_object: dbx_error failure works ok too many parameters: dbx_error failure works ok too few parameters: dbx_error failure works ok php-4.4.8/ext/dbx/tests/007.phpt0000644000175000017500000000405107556045472015542 0ustar derickderick--TEST-- dbx_sort --SKIPIF-- --FILE-- rows; ++$i) { print($dro->data[$i]['id'].".".$dro->data[$i]['description']."\n"); } if (dbx_sort($dro, $compare_function)) { for ($i=0; $i<$dro->rows; ++$i) { print($dro->data[$i]['id'].".".$dro->data[$i]['description']."\n"); } } if (!@dbx_sort(0, $compare_function)) { print('wrong dbx_result_object: dbx_sort failure works ok'."\n"); } if (dbx_sort($dro, $nonexisting_compare_function)) { print('nonexisting compare function: dbx_sort will NOT complain'."\n"); } if (dbx_sort($dro, $invalid_compare_function)) { print('invalid compare function: dbx_sort will NOT complain'."\n"); } if (!@dbx_sort($dro, $compare_function, "12many")) { print('too many parameters: dbx_sort failure works ok'."\n"); } if (!@dbx_sort($dro)) { print('too few parameters: dbx_sort failure works ok'."\n"); } dbx_close($dlo); } ?> --EXPECT-- 10.abc 20.cba 30.bac 40.100 50.20 60.20 40.100 50.20 60.20 10.abc 30.bac 20.cba wrong dbx_result_object: dbx_sort failure works ok nonexisting compare function: dbx_sort will NOT complain invalid compare function: dbx_sort will NOT complain too many parameters: dbx_sort failure works ok too few parameters: dbx_sort failure works okphp-4.4.8/ext/dbx/tests/008.phpt0000644000175000017500000000747607556045472015561 0ustar derickderick--TEST-- dbx_compare --SKIPIF-- --FILE-- rows; ++$i) { print($dro->data[$i]['id'].".".$dro->data[$i]['description']."\n"); } if (dbx_sort($dro, $compare_function_1)) { for ($i=0; $i<$dro->rows; ++$i) { print($dro->data[$i]['id'].".".$dro->data[$i]['description']."\n"); } } if (dbx_sort($dro, $compare_function_2)) { for ($i=0; $i<$dro->rows; ++$i) { print($dro->data[$i]['id'].".".$dro->data[$i]['description']."\n"); } } if (dbx_sort($dro, $compare_function_3)) { for ($i=0; $i<$dro->rows; ++$i) { print($dro->data[$i]['id'].".".$dro->data[$i]['description']."\n"); } } if (dbx_sort($dro, $compare_function_4)) { for ($i=0; $i<$dro->rows; ++$i) { print($dro->data[$i]['id'].".".$dro->data[$i]['description']."\n"); } } if (dbx_sort($dro, $compare_function_5)) { for ($i=0; $i<$dro->rows; ++$i) { print($dro->data[$i]['id'].".".$dro->data[$i]['description']."\n"); } } if (dbx_sort($dro, $compare_function_6)) { for ($i=0; $i<$dro->rows; ++$i) { print($dro->data[$i]['id'].".".$dro->data[$i]['description']."\n"); } } if (!@dbx_compare($a, $b, "fieldname")) { print('wrong parameters: dbx_compare failure works ok'."\n"); } if (!@dbx_compare($a, $b, "fieldname", DBX_CMP_NATIVE, "12many")) { print('too many parameters: dbx_compare failure works ok'."\n"); } if (!@dbx_compare($a, $b)) { print('too few parameters: dbx_compare failure works ok'."\n"); } dbx_close($dlo); } ?> --EXPECT-- 10.abc 20.cba 30.bac 40.100 50.20 60.20 40.100 50.20 60.20 10.abc 30.bac 20.cba 20.cba 30.bac 10.abc 50.20 60.20 40.100 40.100 60.20 50.20 10.abc 30.bac 20.cba 20.cba 30.bac 10.abc 60.20 50.20 40.100 40.100 50.20 60.20 10.abc 30.bac 20.cba 10.0 20.0 30.0 50.20 60.20 40.100 wrong parameters: dbx_compare failure works ok too many parameters: dbx_compare failure works ok too few parameters: dbx_compare failure works okphp-4.4.8/ext/dbx/tests/009.phpt0000644000175000017500000000466407562244544015554 0ustar derickderick--TEST-- dbx_escape_string --SKIPIF-- --INI-- magic_quotes_runtime=0 --FILE-- data[0]['field2']===$txt?'ok':'fail ('.$dro->data[0]['field2'].')').': '.$txt."\n"); } } } test_dbx_escape_string('no special characters'); test_dbx_escape_string('quote \' string'); test_dbx_escape_string('doublequote " string'); test_dbx_escape_string('backslash \\ string'); test_dbx_escape_string('backslash and quote \\ \' string'); test_dbx_escape_string('ampersand & string'); // delete query dbx_query($dlo, $sql_delete_statement); // generate errors if (!@dbx_escape_string(0, "any_text")) { print('wrong dbx_link_object: escape_string failure works ok'."\n"); } if (!@dbx_escape_string($dlo, "any_text", "12many")) { print('too many parameters: escape_string failure works ok'."\n"); } if (!@dbx_escape_string($dlo)) { print('too few parameters: escape_string failure works ok'."\n"); } dbx_close($dlo); } ?> --EXPECT-- ok: no special characters ok: quote ' string ok: doublequote " string ok: backslash \ string ok: backslash and quote \ ' string ok: ampersand & string wrong dbx_link_object: escape_string failure works ok too many parameters: escape_string failure works ok too few parameters: escape_string failure works ok php-4.4.8/ext/dbx/tests/dbx_test.pgsql.script0000644000175000017500000022544607312401343020522 0ustar derickderickcreate database dbx_test; \cdbx_test create table tbl ( id int NOT NULL default 0, parentid int NOT NULL default 0, description varchar(255) NULL, field1 text NULL, field2 text NULL, field3 text NULL, field4 text NULL, field5 text NULL, creation_date int8 NULL, PRIMARY KEY (id) ); create index parentid on tbl (parentid); create index description on tbl (description); create index creation_date on tbl (creation_date); insert into tbl (id, parentid, description, field1, field2, field3, field4, field5, creation_date) values (1, 0, 'root', 'empty fields', '', '', '', '', 20010605110724 ); insert into tbl (id, parentid, description, field1, field2, field3, field4, field5, creation_date) values (10, 1, 'abc', 'field2 contains single quote', 'x''x', '', '', '', 20010605110724); insert into tbl (id, parentid, description, field1, field2, field3, field4, field5, creation_date) values (20, 1, 'cba', 'field2 contains double quote', 'x"x', '', '', '', 20010605110724); insert into tbl (id, parentid, description, field1, field2, field3, field4, field5, creation_date) values (30, 1, 'bac', 'field2 contains >4k text', 'asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl', '', '', '', 20010605110724); insert into tbl (id, parentid, description, field1, field2, field3, field4, field5, creation_date) values (40, 1, '100', 'field2 contains >64k text', 'asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl mnv m,xztsie5i4wj5k34ntmnial4jl234k kjtk34j5hfu 8uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5kuiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl uiod5w4 vkjlkarj ql32j5k4j3kj vkjkf jaktjk43j5k asjdhjsaeqw WJK213128Y2`Y12H WJHREJH4HWQEJHJHJSHFDWA4NBNs fjsdhr3wrbsndfbndsfbndsrbjwehrjkeh rfjdhfjdshfgnbgs aljdshgjfdsa jsdhfjdhgjs sdhfjsd kjejshrjewhrjewhrj hrj hjrhjfh jdhfjhsfjhgjjdrhehrj4whe jrhjhrjwe jhwr jhr jhejcrhwejrh 3kjwq4324ri f,mcvmn3qn m,wnrmwnf mn mndrweihr nfmgnrjkrakrfah fja kjfkdsjkrj43wkjrk34rf kncvnmn jew5 r4rjkwej4k23j kjrkewj lk34j 4kjkljklaje kj4kj5k43jklakrjklej4kj k4j5k4wjksckk4jkl43j5k 4j5kfcsc ksd rk43wj 5kjk ejrkjkwjrk32j4 kjkj4kj4rkje kjewk jk45j432k5j wkjrk23j4k k324j598dfkl', '', '', '', 20010605110724); insert into tbl (id, parentid, description, field1, field2, field3, field4, field5, creation_date) values (50, 1, '20', 'empty fields', '', '', '', '', 20010605110724); insert into tbl (id, parentid, description, field1, field2, field3, field4, field5, creation_date) values (60, 1, '20', 'empty fields', '', '', '', '', 20010605110724); create user dbx_testuser with password 'dbx_testpassword'; grant SELECT,INSERT,UPDATE,DELETE on tbl to dbx_testuser; php-4.4.8/ext/dbx/dbx_fbsql.c0000644000175000017500000002376710736114306015307 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | dbx module version 1.0 | +----------------------------------------------------------------------+ | Copyright (c) 2001 Guidance Rotterdam BV | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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 : Marc Boeren | | Frank M. Kromann | +----------------------------------------------------------------------+ */ /* $Id: dbx_fbsql.c,v 1.9.2.2.6.3 2007/12/31 07:22:46 sebastian Exp $ */ #include "dbx.h" #include "dbx_fbsql.h" #define FBSQL_ASSOC 1<<0 #define FBSQL_NUM 1<<1 int dbx_fbsql_connect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS) { /* returns connection handle as resource on success or 0 as long on failure */ int number_of_arguments=3; zval **arguments[3]; zval *returned_zval=NULL; zval *select_db_zval=NULL; arguments[0]=host; arguments[1]=username; arguments[2]=password; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "fbsql_connect", &returned_zval, number_of_arguments, arguments); if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_RESOURCE) { if (returned_zval) zval_ptr_dtor(&returned_zval); return 0; } number_of_arguments=2; arguments[0]=db; arguments[1]=&returned_zval; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "fbsql_select_db", &select_db_zval, number_of_arguments, arguments); if (!select_db_zval || (Z_TYPE_P(select_db_zval)==IS_BOOL && Z_LVAL_P(select_db_zval)==0) ) { if (select_db_zval) zval_ptr_dtor(&select_db_zval); /* also close connection */ number_of_arguments=1; arguments[0]=&returned_zval; zend_list_addref(Z_LVAL_P(returned_zval)); dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "fbsql_close", &select_db_zval, number_of_arguments, arguments); if (select_db_zval) zval_ptr_dtor(&select_db_zval); zval_ptr_dtor(&returned_zval); return 0; } zval_ptr_dtor(&select_db_zval); MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_fbsql_pconnect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS) { /* returns persistent connection handle as resource on success or 0 as long on failure */ int number_of_arguments=3; zval **arguments[3]; zval *returned_zval=NULL; zval *select_db_zval=NULL; arguments[0]=host; arguments[1]=username; arguments[2]=password; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "fbsql_pconnect", &returned_zval, number_of_arguments, arguments); if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_RESOURCE) { if (returned_zval) zval_ptr_dtor(&returned_zval); return 0; } number_of_arguments=2; arguments[0]=db; arguments[1]=&returned_zval; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "fbsql_select_db", &select_db_zval, number_of_arguments, arguments); if (!select_db_zval || (Z_TYPE_P(select_db_zval)==IS_BOOL && Z_LVAL_P(select_db_zval)==0) ) { if (select_db_zval) zval_ptr_dtor(&select_db_zval); /* also close connection */ number_of_arguments=1; arguments[0]=&returned_zval; zend_list_addref(Z_LVAL_P(returned_zval)); dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "fbsql_close", &select_db_zval, number_of_arguments, arguments); if (select_db_zval) zval_ptr_dtor(&select_db_zval); zval_ptr_dtor(&returned_zval); return 0; } zval_ptr_dtor(&select_db_zval); MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_fbsql_close(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS) { /* returns 1 as long on success or 0 as long on failure */ int number_of_arguments=1; zval **arguments[1]; zval *returned_zval=NULL; arguments[0]=dbx_handle; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "fbsql_close", &returned_zval, number_of_arguments, arguments); if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_BOOL) { if (returned_zval) zval_ptr_dtor(&returned_zval); return 0; } MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_fbsql_query(zval **rv, zval **dbx_handle, zval **db_name, zval **sql_statement, INTERNAL_FUNCTION_PARAMETERS) { /* returns 1 as long or a result identifier as resource on success or 0 as long on failure */ int number_of_arguments=3; zval **arguments[3]; zval *returned_zval=NULL; arguments[0]=db_name; arguments[1]=sql_statement; arguments[2]=dbx_handle; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "fbsql_db_query", &returned_zval, number_of_arguments, arguments); /* fbsql_query returns a bool for success or failure, or a result_identifier for select statements */ if (!returned_zval || (Z_TYPE_P(returned_zval)!=IS_BOOL && Z_TYPE_P(returned_zval)!=IS_RESOURCE)) { if (returned_zval) zval_ptr_dtor(&returned_zval); return 0; } MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_fbsql_getcolumncount(zval **rv, zval **result_handle, INTERNAL_FUNCTION_PARAMETERS) { /* returns column-count as long on success or 0 as long on failure */ int number_of_arguments=1; zval **arguments[1]; zval *returned_zval=NULL; arguments[0]=result_handle; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "fbsql_num_fields", &returned_zval, number_of_arguments, arguments); if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_LONG) { if (returned_zval) zval_ptr_dtor(&returned_zval); return 0; } MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_fbsql_getcolumnname(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS) { /* returns column-name as string on success or 0 as long on failure */ int number_of_arguments=2; zval **arguments[2]; zval *zval_column_index; zval *returned_zval=NULL; MAKE_STD_ZVAL(zval_column_index); ZVAL_LONG(zval_column_index, column_index); arguments[0]=result_handle; arguments[1]=&zval_column_index; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "fbsql_field_name", &returned_zval, number_of_arguments, arguments); /* fbsql_field_name returns a string */ if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) { if (returned_zval) zval_ptr_dtor(&returned_zval); FREE_ZVAL(zval_column_index); return 0; } FREE_ZVAL(zval_column_index); MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_fbsql_getcolumntype(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS) { /* returns column-type as string on success or 0 as long on failure */ int number_of_arguments=2; zval **arguments[2]; zval *zval_column_index; zval *returned_zval=NULL; MAKE_STD_ZVAL(zval_column_index); ZVAL_LONG(zval_column_index, column_index); arguments[0]=result_handle; arguments[1]=&zval_column_index; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "fbsql_field_type", &returned_zval, number_of_arguments, arguments); /* fbsql_field_name returns a string */ if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) { if (returned_zval) zval_ptr_dtor(&returned_zval); FREE_ZVAL(zval_column_index); return 0; } FREE_ZVAL(zval_column_index); MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_fbsql_getrow(zval **rv, zval **result_handle, long row_number, INTERNAL_FUNCTION_PARAMETERS) { /* returns array[0..columncount-1] as strings on success or 0 as long on failure */ int number_of_arguments=2; zval **arguments[2]; zval *zval_resulttype=NULL; zval *returned_zval=NULL; MAKE_STD_ZVAL(zval_resulttype); ZVAL_LONG(zval_resulttype, FBSQL_NUM); arguments[0]=result_handle; arguments[1]=&zval_resulttype; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "fbsql_fetch_array", &returned_zval, number_of_arguments, arguments); if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_ARRAY) { if (returned_zval) zval_ptr_dtor(&returned_zval); FREE_ZVAL(zval_resulttype); return 0; } FREE_ZVAL(zval_resulttype); MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_fbsql_error(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS) { /* returns string */ int number_of_arguments=1; zval **arguments[1]; zval *returned_zval=NULL; arguments[0]=dbx_handle; if (!dbx_handle) number_of_arguments=0; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "fbsql_error", &returned_zval, number_of_arguments, arguments); if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) { if (returned_zval) zval_ptr_dtor(&returned_zval); return 0; } MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_fbsql_esc(zval **rv, zval **dbx_handle, zval **string, INTERNAL_FUNCTION_PARAMETERS) { /* returns escaped string */ /* replace \ with \\ */ /* ' with '' */ char * str; int len; char * tmpstr; int tmplen; if (Z_STRLEN_PP(string) == 0) { ZVAL_EMPTY_STRING(*rv); return 1; } tmpstr = estrdup(Z_STRVAL_PP(string)); tmplen = Z_STRLEN_PP(string); /* php_str_to_str uses a smart_str that allocates memory */ /* this memory must be freed or passed on to rv */ str = php_str_to_str(tmpstr, tmplen, "'", 1, "''", 2, &len); efree(tmpstr); ZVAL_STRINGL(*rv, str, len, 0); return 1; } /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: */ php-4.4.8/ext/dbx/dbx_fbsql.h0000644000175000017500000000673310736114306015306 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | dbx module version 1.0 | +----------------------------------------------------------------------+ | Copyright (c) 2001 Guidance Rotterdam BV | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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 : Marc Boeren | | Frank M. Kromann | +----------------------------------------------------------------------+ */ /* $Id: dbx_fbsql.h,v 1.6.2.2.6.3 2007/12/31 07:22:46 sebastian Exp $ */ #ifndef ZEND_DBX_FBSQL_H #define ZEND_DBX_FBSQL_H #ifndef INIT_FUNC_ARGS #include "zend_modules.h" #endif #include "php.h" int dbx_fbsql_connect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS); /* returns connection handle as resource on success or 0 as long on failure */ int dbx_fbsql_pconnect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS); /* returns persistent connection handle as resource on success or 0 as long on failure */ int dbx_fbsql_close(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS); /* returns 1 as long on success or 0 as long on failure */ int dbx_fbsql_query(zval **rv, zval **dbx_handle, zval **db_name, zval **sql_statement, INTERNAL_FUNCTION_PARAMETERS); /* returns 1 as long or a result identifier as resource on success or 0 as long on failure */ int dbx_fbsql_getcolumncount(zval **rv, zval **result_handle, INTERNAL_FUNCTION_PARAMETERS); /* returns column-count as long on success or 0 as long on failure */ int dbx_fbsql_getcolumnname(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS); /* returns column-name as string on success or 0 as long on failure */ int dbx_fbsql_getcolumntype(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS); /* returns column-type as string on success or 0 as long on failure */ int dbx_fbsql_getrow(zval **rv, zval **result_handle, long row_number, INTERNAL_FUNCTION_PARAMETERS); /* returns array[0..columncount-1] as strings on success or 0 as long on failure */ int dbx_fbsql_error(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS); /* returns string */ int dbx_fbsql_esc(zval **rv, zval **dbx_handle, zval **string, INTERNAL_FUNCTION_PARAMETERS); /* returns escaped string */ #endif /* ZEND_DBX_FBSQL_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: */ php-4.4.8/ext/dbx/config.m40000644000175000017500000000050107443424555014676 0ustar derickderickdnl dnl $Id: config.m4,v 1.3 2002/03/12 16:14:37 sas Exp $ dnl PHP_ARG_ENABLE(dbx,whether to enable dbx support, [ --enable-dbx Enable dbx]) if test "$PHP_DBX" != "no"; then PHP_NEW_EXTENSION(dbx, dbx.c dbx_mysql.c dbx_odbc.c dbx_pgsql.c dbx_mssql.c dbx_fbsql.c dbx_oci8.c dbx_sybasect.c, $ext_shared) fi php-4.4.8/ext/dbx/howto_extend_dbx.html0000644000175000017500000005177207555477356017454 0ustar derickderick HOWTO extend dbx
How-to code support for another database
Every supported database module must be loaded by PHP before it can be used. Every supported database module must be added to the dbx-module before it can be used. Currently there is support for MySQL, PostgreSQL, Microsoft SQL Server, Frontbase, Sybase-CT, Oracle (oci8) and ODBC. It is not difficult to add support for more databases.

The dbx module is found in de PHP ext/dbx folder. The support-code is found in the same folder

To add support for module 'blabla' the following steps must be taken:
1. the dbx.c source file must be extended to recognize module 'blabla' and switch to the 'blabla' functions.
2. the files dbx_blabla.h and dbx_blabla.c must be created and edited to produce the required response.
3. add the files from step 2 to the project.
4. compile.
5. enjoy.

You may need a bit of help for step 1 and 2. If you need help for step 3 or 4, you shouldn't try to attempt this probably :-). If you need help with step 5 you're in big trouble ;o)
Help for step 1 and 2 is given below, bold text in code indicate the important bits.

home

1. the dbx.c source file must be extended
Define a module identifier and assign it a unique number. Include your header file here as well.
// defines for supported databases
#define DBX_UNKNOWN 0
#define DBX_MYSQL 1
#define DBX_ODBC 2
#define DBX_BLABLA 3
// includes for supported databases
#include "dbx.h"
#include "dbx_mysql.h"
#include "dbx_odbc.h"
#include "dbx_blabla.h"
Add code to the module_identifier_exists function so DBX_BLABLA will be recognized:
int module_identifier_exists(long module_identifier) {
    switch (module_identifier) {
        case DBX_MYSQL: return module_exists("mysql");
        case DBX_ODBC: return module_exists("odbc");
        case DBX_BLABLA: return module_exists("blabla");
        }
    return 0;
    }
Add code to the get_module_identifier function so your extension will be recognized:
int get_module_identifier(char * module_name) {
    if (!strcmp("mysql", module_name)) return DBX_MYSQL;
    if (!strcmp("odbc", module_name)) return DBX_ODBC;
    if (!strcmp("blabla", module_name)) return DBX_BLABLA;
    return DBX_UNKNOWN;
    }
Add code for exposing the DBX_BLABLA constant to the world:
ZEND_MINIT_FUNCTION(dbx)
{
/*/	REGISTER_INI_ENTRIES(); /*/

    REGISTER_LONG_CONSTANT("DBX_MYSQL", DBX_MYSQL, CONST_CS | CONST_PERSISTENT);
    REGISTER_LONG_CONSTANT("DBX_ODBC", DBX_ODBC, CONST_CS | CONST_PERSISTENT);
    REGISTER_LONG_CONSTANT("DBX_BLABLA", DBX_BLABLA CONST_CS | CONST_PERSISTENT);

    [...]

    return SUCCESS;
    }
Add code for inclusion in the phpinfo() function (optional, but recommended):
ZEND_MINFO_FUNCTION(dbx)
{
    php_info_print_table_start();
    php_info_print_table_row(2, "dbx support", "enabled");
    php_info_print_table_row(2, "dbx support for MySQL", "enabled");
    php_info_print_table_row(2, "dbx support for ODBC", "enabled");
    php_info_print_table_row(2, "dbx support for BlaBla", "enabled");
    php_info_print_table_end();
    DISPLAY_INI_ENTRIES();
}
Finally, for the implementation of all switch_dbx_XXXXX functions, copy a 'case'-line for every function that you support (should be all functions!). Here is an example for only the switch_dbx_connect function:
int switch_dbx_connect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS, zval **dbx_module) {
    // returns connection handle as resource on success or 0 as long on failure
    switch ((*dbx_module)->value.lval) {
        case DBX_MYSQL: return dbx_mysql_connect(rv, host, db, username, password, INTERNAL_FUNCTION_PARAM_PASSTHRU);
        case DBX_ODBC: return dbx_odbc_connect(rv, host, db, username, password, INTERNAL_FUNCTION_PARAM_PASSTHRU);
        case DBX_BLABLA: return dbx_blabla_connect(rv, host, db, username, password, INTERNAL_FUNCTION_PARAM_PASSTHRU);
        }
    zend_error(E_WARNING, "dbx_connect: not supported in this module");
    return 0;
    }
This should be done for all switch_dbx_XXXXX functions. They are listed below:
int switch_dbx_connect(...);
int switch_dbx_pconnect(...);
int switch_dbx_close(...);
int switch_dbx_query(...);
int switch_dbx_getcolumncount(...);
int switch_dbx_getcolumnname(...);
int switch_dbx_getcolumntype(...);
int switch_dbx_getrow(...);
int switch_dbx_error(...);
This concludes the changes for the dbx.c file. All that is needed now is to actually code the dbx_blabla_connect and other functions, which we will see in the following step.

top

2. the files dbx_blabla.h and dbx_blabla.c
The dbx_blabla.h and dbx_blabla.c file are created in the folder /ext/dbx.
The easiest method is to just copy dbx_mysql.h en dbx_mysql.c, open both files, and do a search and replace ('blabla' for 'mysql' and 'BLABLA' for 'MYSQL'). Yes, case-sensitive.
For the .h file, that's all.
For the .c file, the fun has just started :-)
In the .c is the actual realization of the database abstraction, where a call to a standard function is translated into one or more database-specific calls. For mysql, a dbx_connect translates to a mysql_connect followed by a mysql_select_db. Refer to the dbx_mysql.c and dbx_odbc.c files regularly for examples!
In dbx.h one macro and one function are defined to make the calling of external module functions and returning of the results easier: dbx_call_any_function and MOVE_RETURNED_TO_RV.

The details of what each of the functions do, what parameters they get, and what parameters they should return are discussed below. But first, the dbx_mysql_connect function is presented and explained, so you get an idea of how things work.

int dbx_mysql_connect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS) {
    // returns connection handle as resource on success or 0 as long on 
    // failure
    int number_of_arguments;
    zval **arguments[3];
    zval * returned_zval=NULL;
    zval * select_db_zval=NULL;

    number_of_arguments=3;
    arguments[0]=host;
    arguments[1]=username;
    arguments[2]=password;
    dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mysql_connect", &returned_zval, number_of_arguments, arguments);
    if (!returned_zval || returned_zval->type!=IS_RESOURCE) {
        if (returned_zval) zval_ptr_dtor(&returned_zval);
        return 0;
        }
    MOVE_RETURNED_TO_RV(rv, returned_zval);

    number_of_arguments=2;
    arguments[0]=db;
    arguments[1]=rv;
    dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mysql_select_db", &select_db_zval, number_of_arguments, arguments);
    zval_ptr_dtor(&select_db_zval);

    return 1;
    }
First of all, all functions return 0 on failure and 1 on success. These values are used in the dbx-routines, they are never actually given back to the PHP-script writer that calls the dbx_connect function.
The actual value that is of interest to the caller is returned in the rv parameter. In this case it is a connection handle (or link identifier, in mysql-speak), that is also returned if the database selection doesn't succeed.
The parameters that are of interest to the function are located between the rv and INTERNAL_FUNCTION_PARAMETERS parameters, in this case it is a host name, a db name, a username and a password. These are the values that the user specifies if he calls dbx_connect(); These parameters are used in the calls to the mysql-database functions. The user actually also specifies a module-name, that decides which connect-function should be called. Here, he specified 'mysql'.
To actually call a mysql module function, you can use dbx_call_any_function where you specify the function name (it is used twice in dbx_mysql_connect, see 'mysql_connect' and 'mysql_select_db', they are printed bold in the code). The value that is returned from the function will be stored in the next argument, a zval * (e.g. returned_zval) parameter that you must declare locally. To actually return such a parameter, use the MOVE_RETURNED_TO_RV(rv, returned_zval) macro, which copies the values to rv and frees anything that may be left in returned_zval. Parameters that must be passed to the mysql-function are stored in the arguments array, which must be large enough to hold all parameters to the function-call that requires the most parameters (in this case, mysql_connect expects 3 parameters, mysql_select_db expects two parameters, so the arguments array is defined 'zval **arguments[3]'). The number_of_arguments parameter is set to the actual number of arguments that the function-call requires. As you can see it is initialized to 3, for the first call to mysql_connect. Then it is set to 2, for the call to mysql_select_db. If you call a function that retrieves a value, and you don't return it with MOVE_RETURNED_TO_RV, then you must free the value using zval_ptr_dtor, as can be seen right after the call to mysql_select_db. This can also be seen directly after the call to mysql_connect, if somehow this function failed or didn't return a resource (on a successful connect mysql_connect returns a resource) the returned value is freed as well (and 0 is returned because the connection failed).

OK, now the description of all functions that you should implement, and what is expected of them...

int dbx_blabla_connect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS);
// int: returns 0 on connect-failure and 1 on success
// rv: connection handle as resource on success or nothing on failure
dbx_blabla_connect creates a connection to a database on a specified host, using username and password for authentication. This may be done by connecting to a server and selecting a database (as mysql does), or connecting to a specific database directly (as in ODBC).
What must be returned (in rv) is the link identifier that is returned from the blabla_connect function, in it's native form so the end-user can use $db->handle to call other blabla_* functions that expect this parameter.
What must be returned from the function is a 1 on success and a 0 on failure. Remember that a failed database selection can still return a 1 because the connection succeeded!
The host (string) is the name of the machine the server is run on, but it may be empty if a database name is enough to establish a connection.
The db (string) is the name of the database to select, or, for e.g. ODBC, the identifier that is needed to actually select the database.
The username (string) and password (string) are used for authentication.
int dbx_blabla_pconnect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS);
// int: returns 0 on pconnect-failure and 1 on success
// rv: persistent connection handle as resource on success or nothing
// on failure
dbx_blabla_pconnect is identical to dbx_blabla_connect except that it will create a persistent connection.
int dbx_blabla_close(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS);
// int: returns 0 on close-failure and 1 on success
// rv: 1 as bool on success or nothing on failure
dbx_blabla_close closes an open connection, whether it was created persistently or not.
What must be returned (in rv) is a boolean true that indicates when the connection was closed successfully. If it wasn't, no value is returned in rv.
What must be returned from the function is a 1 on success and a 0 on failure. Note that an unsuccessful close is still a succeeded function call.
The dbx_handle is the same value that you returned from dbx_blabla_connect or dbx_blabla_pconnect.
int dbx_blabla_query(zval **rv, zval **dbx_handle, zval **sql_statement, INTERNAL_FUNCTION_PARAMETERS);
// int: returns 0 on query-failure and 1 on success
// rv: 1 as bool or a result identifier as resource on success 
// or nothing on failure
dbx_blabla_query executes an SQL statement over the connection.
What must be returned (in rv) is a nothing on failure, on success it must return either a boolean 1 for queries that don't return data (like INSERT INTO) or a native result-handle for queries that do return data (SELECT). The native result handle ($q->handle) can be used by the end-user to call other blabla_* functions that expect this parameter.
What must be returned from the function is a 1 on success and a 0 on failure. Note that a failed query execution can still return a 1 because the query function succeeded!
The dbx_handle is the same value that you returned from dbx_blabla_connect or dbx_blabla_pconnect.
The sql_statement (string) can have any value.
int dbx_blabla_getcolumncount(zval **rv, zval **result_handle, INTERNAL_FUNCTION_PARAMETERS);
// int: returns 0 on query-failure and 1 on success
// returns column-count as long on success or nothing on failure
dbx_blabla_getcolumncount gets the number of fields that the query-result contains.
What must be returned (in rv) is the number of fields as long from the query result specified by the result_handle.
What must be returned from the function is a 1 on success and a 0 on failure.
The result_handle is the same value that you returned from dbx_query.
int dbx_blabla_getcolumnname(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS);
// int: returns 0 on failure and 1 on success
// returns column-name as string on success or nothing on failure
dbx_blabla_getcolumnname gets the fieldname of the specified column.
What must be returned (in rv) is the fieldname as string of the given column.
What must be returned from the function is a 1 on success and a 0 on failure.
The result_handle is the same value that you returned from dbx_query.
The column_index is a long that ranges from 0 to the value you returned from dbx_blabla_getcolumncount minus 1 [0..columncount-1].
int dbx_blabla_getcolumntype(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS);
// int: returns 0 on failure and 1 on success
// returns column-type as string on success or nothing on failure
dbx_blabla_getcolumnname gets the field type of the specified column.
What must be returned (in rv) is the field type as string of the given column.
What must be returned from the function is a 1 on success and a 0 on failure.
The result_handle is the same value that you returned from dbx_query.
The column_index is a long that ranges from 0 to the value you returned from dbx_blabla_getcolumncount minus 1 [0..columncount-1].
int dbx_blabla_getrow(zval **rv, zval **result_handle, long row_number, INTERNAL_FUNCTION_PARAMETERS);
// int: returns 0 on failure and 1 on success
// returns array[0..columncount-1] as strings on success or 0 as long 
// on failure
dbx_blabla_getrow gets the next row from the query-results.
In some cases (PostgreSQL) the rownumber is needed to actually fetch the row. This will be provided (it will be indexed starting at 0) by the dbx_query function. In other cases it is not needed and thus not used.
What must be returned (in rv) is an indexed array[0..columncount-1] of strings, containing the data from the row (for mysql this is easy since it already performs this way, for ODBC the array has to be constructed inside this function from a loop that fetches the data for each column).
What must be returned from the function is a 1 on success and a 0 on failure (function failed or there are no more rows available).
The result_handle is the same value that you returned from dbx_query.
int dbx_blabla_error(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS);
// int: returns 0 on failure and 1 on success
// returns error message as string
dbx_blabla_error gets the error message from the last database call.
What must be returned (in rv) is the error message as a string.
What must be returned from the function is a 1 on success and a 0 on failure.
The dbx_handle is the same value that you returned from dbx_blabla_connect or dbx_blabla_pconnect.

top

For specifics or the finer details you can always refer to dbx_mysql.c and dbx_odbc.c to see everything in action.
More Zend API documentation can be found at http://www.zend.com/apidoc.
This document can be found at http://www.guidance.nl/php/dbx.

top

php-4.4.8/ext/dbx/dbx_sybasect.c0000644000175000017500000002531110736114306016000 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | dbx module version 1.0 | +----------------------------------------------------------------------+ | Copyright (c) 2001 Guidance Rotterdam BV | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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 : Marc Boeren | +----------------------------------------------------------------------+ */ /* $Id: dbx_sybasect.c,v 1.6.2.1.8.3 2007/12/31 07:22:46 sebastian Exp $ */ #include "dbx.h" #include "dbx_sybasect.h" #define MYSQL_ASSOC 1<<0 #define MYSQL_NUM 1<<1 int dbx_sybasect_connect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS) { /* returns connection handle as resource on success or 0 as long on failure */ int number_of_arguments=3; zval **arguments[3]; zval *returned_zval=NULL; zval *select_db_zval=NULL; arguments[0]=host; arguments[1]=username; arguments[2]=password; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "sybase_connect", &returned_zval, number_of_arguments, arguments); if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_RESOURCE) { if (returned_zval) zval_ptr_dtor(&returned_zval); return 0; } number_of_arguments=2; arguments[0]=db; arguments[1]=&returned_zval; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "sybase_select_db", &select_db_zval, number_of_arguments, arguments); if (!select_db_zval || (Z_TYPE_P(select_db_zval)==IS_BOOL && Z_LVAL_P(select_db_zval)==0) ) { if (select_db_zval) zval_ptr_dtor(&select_db_zval); /* also close connection */ number_of_arguments=1; arguments[0]=&returned_zval; zend_list_addref(Z_LVAL_P(returned_zval)); dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "sybase_close", &select_db_zval, number_of_arguments, arguments); if (select_db_zval) zval_ptr_dtor(&select_db_zval); zval_ptr_dtor(&returned_zval); return 0; } zval_ptr_dtor(&select_db_zval); MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_sybasect_pconnect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS) { /* returns persistent connection handle as resource on success or 0 as long on failure */ int number_of_arguments=3; zval **arguments[3]; zval *returned_zval=NULL; zval *select_db_zval=NULL; arguments[0]=host; arguments[1]=username; arguments[2]=password; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "sybase_pconnect", &returned_zval, number_of_arguments, arguments); if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_RESOURCE) { if (returned_zval) zval_ptr_dtor(&returned_zval); return 0; } number_of_arguments=2; arguments[0]=db; arguments[1]=&returned_zval; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "sybase_select_db", &select_db_zval, number_of_arguments, arguments); if (!select_db_zval || (Z_TYPE_P(select_db_zval)==IS_BOOL && Z_LVAL_P(select_db_zval)==0) ) { if (select_db_zval) zval_ptr_dtor(&select_db_zval); /* also close connection */ number_of_arguments=1; arguments[0]=&returned_zval; zend_list_addref(Z_LVAL_P(returned_zval)); dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "sybase_close", &select_db_zval, number_of_arguments, arguments); if (select_db_zval) zval_ptr_dtor(&select_db_zval); zval_ptr_dtor(&returned_zval); return 0; } zval_ptr_dtor(&select_db_zval); MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_sybasect_close(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS) { /* returns 1 as long on success or 0 as long on failure */ int number_of_arguments=1; zval **arguments[1]; zval *returned_zval=NULL; arguments[0]=dbx_handle; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "sybase_close", &returned_zval, number_of_arguments, arguments); if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_BOOL) { if (returned_zval) zval_ptr_dtor(&returned_zval); return 0; } MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_sybasect_query(zval **rv, zval **dbx_handle, zval **db_name, zval **sql_statement, INTERNAL_FUNCTION_PARAMETERS) { /* returns 1 as long or a result identifier as resource on success or 0 as long on failure */ int number_of_arguments=2; zval **arguments[2]; zval *returned_zval=NULL; zval *select_db_zval=NULL; number_of_arguments=2; arguments[0]=db_name; arguments[1]=dbx_handle; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "sybase_select_db", &select_db_zval, number_of_arguments, arguments); zval_ptr_dtor(&select_db_zval); number_of_arguments=2; arguments[0]=sql_statement; arguments[1]=dbx_handle; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "sybase_query", &returned_zval, number_of_arguments, arguments); /* sybase_query returns a bool for success or failure, or a result_identifier for select statements */ if (!returned_zval || (Z_TYPE_P(returned_zval)!=IS_BOOL && Z_TYPE_P(returned_zval)!=IS_RESOURCE)) { if (returned_zval) zval_ptr_dtor(&returned_zval); return 0; } MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_sybasect_getcolumncount(zval **rv, zval **result_handle, INTERNAL_FUNCTION_PARAMETERS) { /* returns column-count as long on success or 0 as long on failure */ int number_of_arguments=1; zval **arguments[1]; zval *returned_zval=NULL; arguments[0]=result_handle; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "sybase_num_fields", &returned_zval, number_of_arguments, arguments); if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_LONG) { if (returned_zval) zval_ptr_dtor(&returned_zval); return 0; } MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_sybasect_getcolumnname(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS) { /* returns column-name as string on success or 0 as long on failure */ int number_of_arguments=2; zval **arguments[2]; zval *zval_column_index; zval *returned_zval=NULL; zval **zv_name=NULL; MAKE_STD_ZVAL(zval_column_index); ZVAL_LONG(zval_column_index, column_index); arguments[0]=result_handle; arguments[1]=&zval_column_index; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "sybase_fetch_field", &returned_zval, number_of_arguments, arguments); /* sybase_fetch_field returns an object */ /* we need only the 'name' member here */ if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_OBJECT) { if (returned_zval) zval_ptr_dtor(&returned_zval); FREE_ZVAL(zval_column_index); return 0; } if (zend_hash_find(Z_OBJPROP_P(returned_zval), "name", 5, (void **) &zv_name)==FAILURE) { zval_ptr_dtor(&returned_zval); FREE_ZVAL(zval_column_index); return 0; } **rv = **zv_name; zval_copy_ctor(*rv); zval_ptr_dtor(&returned_zval); zval_ptr_dtor(zv_name); FREE_ZVAL(zval_column_index); /* MOVE_RETURNED_TO_RV(rv, returned_zval); */ return 1; } int dbx_sybasect_getcolumntype(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS) { /* returns column-type as string on success or 0 as long on failure */ int number_of_arguments=2; zval **arguments[2]; zval *zval_column_index; zval *returned_zval=NULL; zval **zv_type=NULL; MAKE_STD_ZVAL(zval_column_index); ZVAL_LONG(zval_column_index, column_index); arguments[0]=result_handle; arguments[1]=&zval_column_index; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "sybase_fetch_field", &returned_zval, number_of_arguments, arguments); /* sybase_fetch_field returns an object */ /* we need only the 'type' member here */ if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_OBJECT) { if (returned_zval) zval_ptr_dtor(&returned_zval); FREE_ZVAL(zval_column_index); return 0; } if (zend_hash_find(Z_OBJPROP_P(returned_zval), "type", 5, (void **) &zv_type)==FAILURE) { zval_ptr_dtor(&returned_zval); FREE_ZVAL(zval_column_index); return 0; } **rv = **zv_type; zval_copy_ctor(*rv); zval_ptr_dtor(&returned_zval); zval_ptr_dtor(zv_type); FREE_ZVAL(zval_column_index); /* MOVE_RETURNED_TO_RV(rv, returned_zval); */ return 1; } int dbx_sybasect_getrow(zval **rv, zval **result_handle, long row_number, INTERNAL_FUNCTION_PARAMETERS) { /* returns array[0..columncount-1] as strings on success or 0 as long on failure */ int number_of_arguments=1; zval **arguments[1]; zval *returned_zval=NULL; arguments[0]=result_handle; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "sybase_fetch_row", &returned_zval, number_of_arguments, arguments); if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_ARRAY) { if (returned_zval) zval_ptr_dtor(&returned_zval); return 0; } MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_sybasect_error(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS) { /* returns string */ int number_of_arguments=1; zval **arguments[1]; zval *returned_zval=NULL; arguments[0]=dbx_handle; if (!dbx_handle) number_of_arguments=0; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "sybase_get_last_message", &returned_zval, number_of_arguments, arguments); if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) { if (returned_zval) zval_ptr_dtor(&returned_zval); return 0; } MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_sybasect_esc(zval **rv, zval **dbx_handle, zval **string, INTERNAL_FUNCTION_PARAMETERS) { /* returns escaped string */ /* replace ' with '' */ char * str; int len; char * tmpstr; int tmplen; if (Z_STRLEN_PP(string) == 0) { ZVAL_EMPTY_STRING(*rv); return 1; } tmpstr = estrdup(Z_STRVAL_PP(string)); tmplen = Z_STRLEN_PP(string); /* php_str_to_str uses a smart_str that allocates memory */ /* this memory must be freed or passed on to rv */ str = php_str_to_str(tmpstr, tmplen, "'", 1, "''", 2, &len); efree(tmpstr); ZVAL_STRINGL(*rv, str, len, 0); return 1; } /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: */ php-4.4.8/ext/dbx/dbx_sybasect.h0000644000175000017500000000667110736114306016015 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | dbx module version 1.0 | +----------------------------------------------------------------------+ | Copyright (c) 2001 Guidance Rotterdam BV | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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 : Marc Boeren | +----------------------------------------------------------------------+ */ /* $Id: dbx_sybasect.h,v 1.3.2.1.8.3 2007/12/31 07:22:46 sebastian Exp $ */ #ifndef ZEND_DBX_SYBASECT_H #define ZEND_DBX_SYBASECT_H #ifndef INIT_FUNC_ARGS #include "zend_modules.h" #endif #include "php.h" int dbx_sybasect_connect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS); /* returns connection handle as resource on success or 0 as long on failure */ int dbx_sybasect_pconnect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS); /* returns persistent connection handle as resource on success or 0 as long on failure */ int dbx_sybasect_close(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS); /* returns 1 as long on success or 0 as long on failure */ int dbx_sybasect_query(zval **rv, zval **dbx_handle, zval **db_name, zval **sql_statement, INTERNAL_FUNCTION_PARAMETERS); /* returns 1 as long or a result identifier as resource on success or 0 as long on failure */ int dbx_sybasect_getcolumncount(zval **rv, zval **result_handle, INTERNAL_FUNCTION_PARAMETERS); /* returns column-count as long on success or 0 as long on failure */ int dbx_sybasect_getcolumnname(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS); /* returns column-name as string on success or 0 as long on failure */ int dbx_sybasect_getcolumntype(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS); /* returns column-type as string on success or 0 as long on failure */ int dbx_sybasect_getrow(zval **rv, zval **result_handle, long row_number, INTERNAL_FUNCTION_PARAMETERS); /* returns array[0..columncount-1] as strings on success or 0 as long on failure */ int dbx_sybasect_error(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS); /* returns string */ int dbx_sybasect_esc(zval **rv, zval **dbx_handle, zval **string, INTERNAL_FUNCTION_PARAMETERS); /* returns escaped string */ #endif /* ZEND_DBX_SYBASECT_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: */ php-4.4.8/ext/dbx/dbx_mssql.c0000644000175000017500000002373610736114306015333 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | dbx module version 1.0 | +----------------------------------------------------------------------+ | Copyright (c) 2001 Guidance Rotterdam BV | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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 : Marc Boeren | +----------------------------------------------------------------------+ */ /* $Id: dbx_mssql.c,v 1.12.2.1.8.3 2007/12/31 07:22:46 sebastian Exp $ */ #include "dbx.h" #include "dbx_mssql.h" #define MSSQL_ASSOC 1<<0 #define MSSQL_NUM 1<<1 int dbx_mssql_connect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS) { /* returns connection handle as resource on success or 0 as long on failure */ int number_of_arguments=3; zval **arguments[3]; zval *returned_zval=NULL; zval *select_db_zval=NULL; arguments[0]=host; arguments[1]=username; arguments[2]=password; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mssql_connect", &returned_zval, number_of_arguments, arguments); if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_RESOURCE) { if (returned_zval) zval_ptr_dtor(&returned_zval); return 0; } number_of_arguments=2; arguments[0]=db; arguments[1]=&returned_zval; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mssql_select_db", &select_db_zval, number_of_arguments, arguments); if (!select_db_zval || (Z_TYPE_P(select_db_zval)==IS_BOOL && Z_LVAL_P(select_db_zval)==0) ) { if (select_db_zval) zval_ptr_dtor(&select_db_zval); /* also close connection */ number_of_arguments=1; arguments[0]=&returned_zval; zend_list_addref(Z_LVAL_P(returned_zval)); dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mssql_close", &select_db_zval, number_of_arguments, arguments); if (select_db_zval) zval_ptr_dtor(&select_db_zval); zval_ptr_dtor(&returned_zval); return 0; } zval_ptr_dtor(&select_db_zval); MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_mssql_pconnect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS) { /* returns persistent connection handle as resource on success or 0 as long on failure */ int number_of_arguments=3; zval **arguments[3]; zval *returned_zval=NULL; zval *select_db_zval=NULL; arguments[0]=host; arguments[1]=username; arguments[2]=password; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mssql_pconnect", &returned_zval, number_of_arguments, arguments); if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_RESOURCE) { if (returned_zval) zval_ptr_dtor(&returned_zval); return 0; } number_of_arguments=2; arguments[0]=db; arguments[1]=&returned_zval; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mssql_select_db", &select_db_zval, number_of_arguments, arguments); if (!select_db_zval || (Z_TYPE_P(select_db_zval)==IS_BOOL && Z_LVAL_P(select_db_zval)==0) ) { if (select_db_zval) zval_ptr_dtor(&select_db_zval); /* also close connection */ number_of_arguments=1; arguments[0]=&returned_zval; zend_list_addref(Z_LVAL_P(returned_zval)); dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mssql_close", &select_db_zval, number_of_arguments, arguments); if (select_db_zval) zval_ptr_dtor(&select_db_zval); zval_ptr_dtor(&returned_zval); return 0; } zval_ptr_dtor(&select_db_zval); MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_mssql_close(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS) { /* returns 1 as long on success or 0 as long on failure */ int number_of_arguments=1; zval **arguments[1]; zval *returned_zval=NULL; arguments[0]=dbx_handle; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mssql_close", &returned_zval, number_of_arguments, arguments); if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_BOOL) { if (returned_zval) zval_ptr_dtor(&returned_zval); return 0; } MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_mssql_query(zval **rv, zval **dbx_handle, zval **db_name, zval **sql_statement, INTERNAL_FUNCTION_PARAMETERS) { /* returns 1 as long or a result identifier as resource on success or 0 as long on failure */ int number_of_arguments=2; zval **arguments[2]; zval *returned_zval=NULL; zval *select_db_zval=NULL; number_of_arguments=2; arguments[0]=db_name; arguments[1]=dbx_handle; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mssql_select_db", &select_db_zval, number_of_arguments, arguments); zval_ptr_dtor(&select_db_zval); number_of_arguments=2; arguments[0]=sql_statement; arguments[1]=dbx_handle; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mssql_query", &returned_zval, number_of_arguments, arguments); /* mssql_query returns a bool for success or failure, or a result_identifier for select statements */ if (!returned_zval || (Z_TYPE_P(returned_zval)!=IS_BOOL && Z_TYPE_P(returned_zval)!=IS_RESOURCE)) { if (returned_zval) zval_ptr_dtor(&returned_zval); return 0; } MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_mssql_getcolumncount(zval **rv, zval **result_handle, INTERNAL_FUNCTION_PARAMETERS) { /* returns column-count as long on success or 0 as long on failure */ int number_of_arguments=1; zval **arguments[1]; zval *returned_zval=NULL; arguments[0]=result_handle; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mssql_num_fields", &returned_zval, number_of_arguments, arguments); if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_LONG) { if (returned_zval) zval_ptr_dtor(&returned_zval); return 0; } MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_mssql_getcolumnname(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS) { /* returns column-name as string on success or 0 as long on failure */ int number_of_arguments=2; zval **arguments[2]; zval *zval_column_index; zval *returned_zval=NULL; MAKE_STD_ZVAL(zval_column_index); ZVAL_LONG(zval_column_index, column_index); arguments[0]=result_handle; arguments[1]=&zval_column_index; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mssql_field_name", &returned_zval, number_of_arguments, arguments); /* mssql_field_name returns a string */ if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) { if (returned_zval) zval_ptr_dtor(&returned_zval); FREE_ZVAL(zval_column_index); return 0; } FREE_ZVAL(zval_column_index); MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_mssql_getcolumntype(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS) { /* returns column-type as string on success or 0 as long on failure */ int number_of_arguments=2; zval **arguments[2]; zval *zval_column_index; zval *returned_zval=NULL; MAKE_STD_ZVAL(zval_column_index); ZVAL_LONG(zval_column_index, column_index); arguments[0]=result_handle; arguments[1]=&zval_column_index; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mssql_field_type", &returned_zval, number_of_arguments, arguments); /* mssql_field_name returns a string */ if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) { if (returned_zval) zval_ptr_dtor(&returned_zval); FREE_ZVAL(zval_column_index); return 0; } FREE_ZVAL(zval_column_index); MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_mssql_getrow(zval **rv, zval **result_handle, long row_number, INTERNAL_FUNCTION_PARAMETERS) { /* returns array[0..columncount-1] as strings on success or 0 as long on failure */ int number_of_arguments=1; zval **arguments[1]; zval *returned_zval=NULL; arguments[0]=result_handle; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mssql_fetch_row", &returned_zval, number_of_arguments, arguments); if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_ARRAY) { if (returned_zval) zval_ptr_dtor(&returned_zval); return 0; } MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_mssql_error(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS) { /* returns string */ int number_of_arguments=1; zval **arguments[1]; zval *returned_zval=NULL; arguments[0]=dbx_handle; if (!dbx_handle) number_of_arguments=0; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mssql_get_last_message", &returned_zval, number_of_arguments, arguments); if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) { if (returned_zval) zval_ptr_dtor(&returned_zval); return 0; } MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_mssql_esc(zval **rv, zval **dbx_handle, zval **string, INTERNAL_FUNCTION_PARAMETERS) { /* returns escaped string */ /* replace ' with '' */ char * str; int len; char * tmpstr; int tmplen; if (Z_STRLEN_PP(string) == 0) { ZVAL_EMPTY_STRING(*rv); return 1; } tmpstr = estrdup(Z_STRVAL_PP(string)); tmplen = Z_STRLEN_PP(string); /* php_str_to_str uses a smart_str that allocates memory */ /* this memory must be freed or passed on to rv */ str = php_str_to_str(tmpstr, tmplen, "'", 1, "''", 2, &len); efree(tmpstr); ZVAL_STRINGL(*rv, str, len, 0); return 1; } /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: */ php-4.4.8/ext/dbx/dbx_mssql.h0000644000175000017500000000661710736114306015337 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | dbx module version 1.0 | +----------------------------------------------------------------------+ | Copyright (c) 2001 Guidance Rotterdam BV | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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 : Marc Boeren | +----------------------------------------------------------------------+ */ /* $Id: dbx_mssql.h,v 1.8.2.1.8.3 2007/12/31 07:22:46 sebastian Exp $ */ #ifndef ZEND_DBX_MSSQL_H #define ZEND_DBX_MSSQL_H #ifndef INIT_FUNC_ARGS #include "zend_modules.h" #endif #include "php.h" int dbx_mssql_connect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS); /* returns connection handle as resource on success or 0 as long on failure */ int dbx_mssql_pconnect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS); /* returns persistent connection handle as resource on success or 0 as long on failure */ int dbx_mssql_close(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS); /* returns 1 as long on success or 0 as long on failure */ int dbx_mssql_query(zval **rv, zval **dbx_handle, zval **db_name, zval **sql_statement, INTERNAL_FUNCTION_PARAMETERS); /* returns 1 as long or a result identifier as resource on success or 0 as long on failure */ int dbx_mssql_getcolumncount(zval **rv, zval **result_handle, INTERNAL_FUNCTION_PARAMETERS); /* returns column-count as long on success or 0 as long on failure */ int dbx_mssql_getcolumnname(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS); /* returns column-name as string on success or 0 as long on failure */ int dbx_mssql_getcolumntype(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS); /* returns column-type as string on success or 0 as long on failure */ int dbx_mssql_getrow(zval **rv, zval **result_handle, long row_number, INTERNAL_FUNCTION_PARAMETERS); /* returns array[0..columncount-1] as strings on success or 0 as long on failure */ int dbx_mssql_error(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS); /* returns string */ int dbx_mssql_esc(zval **rv, zval **dbx_handle, zval **string, INTERNAL_FUNCTION_PARAMETERS); /* returns escaped string */ #endif /* ZEND_DBX_MSSQL_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: */ php-4.4.8/ext/dbx/dbx_oci8.c0000644000175000017500000002636610736114306015040 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | dbx module version 1.0 | +----------------------------------------------------------------------+ | Copyright (c) 2001 Guidance Rotterdam BV | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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 : Marc Boeren | +----------------------------------------------------------------------+ */ /* $Id: dbx_oci8.c,v 1.13.2.1.8.3 2007/12/31 07:22:46 sebastian Exp $ */ #include "dbx.h" #include "dbx_oci8.h" #define OCI_ASSOC 1<<0 #define OCI_NUM 1<<1 #define OCI_RETURN_NULLS 1<<2 #define OCI_RETURN_LOBS 1<<3 int dbx_oci8_connect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS) { /* returns connection handle as resource on success or 0 as long on failure */ int number_of_arguments=3; zval **arguments[3]; zval *returned_zval=NULL; arguments[0]=username; arguments[1]=password; arguments[2]=db; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "OCILogon", &returned_zval, number_of_arguments, arguments); if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_RESOURCE) { if (returned_zval) zval_ptr_dtor(&returned_zval); return 0; } MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_oci8_pconnect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS) { /* returns connection handle as resource on success or 0 as long on failure */ int number_of_arguments=3; zval **arguments[3]; zval *returned_zval=NULL; arguments[0]=username; arguments[1]=password; arguments[2]=db; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "OCIPLogon", &returned_zval, number_of_arguments, arguments); if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_RESOURCE) { if (returned_zval) zval_ptr_dtor(&returned_zval); return 0; } MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_oci8_close(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS) { /* returns 1 as long on success or 0 as long on failure */ /* actually, ocilogoff officially does nothing, so what should I return? */ /* I will just return NULL right now and change the test accordingly */ int number_of_arguments=1; zval **arguments[1]; zval *returned_zval=NULL; arguments[0]=dbx_handle; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "OCILogOff", &returned_zval, number_of_arguments, arguments); if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_BOOL) { if (returned_zval) zval_ptr_dtor(&returned_zval); return 0; } MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_oci8_query(zval **rv, zval **dbx_handle, zval **db_name, zval **sql_statement, INTERNAL_FUNCTION_PARAMETERS) { /* returns 1 as long or a result identifier as resource on success or 0 as long on failure */ int number_of_arguments=2; zval **arguments[2]; zval *returned_zval=NULL; zval *execute_zval=NULL; zval *statementtype_zval=NULL; arguments[0]=dbx_handle; arguments[1]=sql_statement; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "OCIParse", &returned_zval, number_of_arguments, arguments); /* OCIParse returns a bool for failure, or a statement_identifier for valid sql_statements */ if (!returned_zval || (Z_TYPE_P(returned_zval)!=IS_BOOL && Z_TYPE_P(returned_zval)!=IS_RESOURCE)) { if (returned_zval) zval_ptr_dtor(&returned_zval); return 0; } number_of_arguments=1; arguments[0]=&returned_zval; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "OCIExecute", &execute_zval, number_of_arguments, arguments); /* OCIExecute returns a bool for success or failure */ if (!execute_zval || Z_TYPE_P(execute_zval)!=IS_BOOL || Z_BVAL_P(execute_zval)==0) { if (execute_zval) zval_ptr_dtor(&execute_zval); zval_ptr_dtor(&returned_zval); return 0; } number_of_arguments=1; arguments[0]=&returned_zval; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "OCIStatementType", &statementtype_zval, number_of_arguments, arguments); /* OCIStatementType returns a string. 'SELECT' means there are results */ if (!statementtype_zval || Z_TYPE_P(statementtype_zval)!=IS_STRING) { if (statementtype_zval) zval_ptr_dtor(&statementtype_zval); if (execute_zval) zval_ptr_dtor(&execute_zval); zval_ptr_dtor(&returned_zval); return 0; } if (!zend_binary_strcmp(Z_STRVAL_P(statementtype_zval), Z_STRLEN_P(statementtype_zval), "SELECT", sizeof("SELECT")-sizeof(""))) { /* it is a select, so results are returned */ MOVE_RETURNED_TO_RV(rv, returned_zval); } else { /* it is not a select, so just return success */ zval_ptr_dtor(&returned_zval); MAKE_STD_ZVAL(returned_zval); ZVAL_BOOL(returned_zval, 1); MOVE_RETURNED_TO_RV(rv, returned_zval); } if (statementtype_zval) zval_ptr_dtor(&statementtype_zval); if (execute_zval) zval_ptr_dtor(&execute_zval); return 1; } int dbx_oci8_getcolumncount(zval **rv, zval **result_handle, INTERNAL_FUNCTION_PARAMETERS) { /* returns column-count as long on success or 0 as long on failure */ int number_of_arguments=1; zval **arguments[1]; zval *returned_zval=NULL; arguments[0]=result_handle; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "OCINumCols", &returned_zval, number_of_arguments, arguments); if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_LONG) { if (returned_zval) zval_ptr_dtor(&returned_zval); return 0; } MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_oci8_getcolumnname(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS) { /* returns column-name as string on success or 0 as long on failure */ int number_of_arguments=2; zval **arguments[2]; zval *zval_column_index; zval *returned_zval=NULL; MAKE_STD_ZVAL(zval_column_index); /* dbx uses 0-based column-indices, oci8 uses 1-based indices... */ ZVAL_LONG(zval_column_index, column_index+1); arguments[0]=result_handle; arguments[1]=&zval_column_index; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "OCIColumnName", &returned_zval, number_of_arguments, arguments); /* OCIColumnName returns a string */ if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) { if (returned_zval) zval_ptr_dtor(&returned_zval); FREE_ZVAL(zval_column_index); return 0; } FREE_ZVAL(zval_column_index); MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_oci8_getcolumntype(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS) { /* returns column-type as string on success or 0 as long on failure */ int number_of_arguments=2; zval **arguments[2]; zval *zval_column_index; zval *returned_zval=NULL; MAKE_STD_ZVAL(zval_column_index); /* dbx uses 0-based column-indices, oci8 uses 1-based indices... */ ZVAL_LONG(zval_column_index, column_index+1); arguments[0]=result_handle; arguments[1]=&zval_column_index; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "OCIColumnType", &returned_zval, number_of_arguments, arguments); /* OCIColumnType returns a string??? */ if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) { if (returned_zval) zval_ptr_dtor(&returned_zval); FREE_ZVAL(zval_column_index); return 0; } FREE_ZVAL(zval_column_index); MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_oci8_getrow(zval **rv, zval **result_handle, long row_number, INTERNAL_FUNCTION_PARAMETERS) { /* returns array[0..columncount-1] as strings on success or 0 as long on failure */ int number_of_arguments=3; zval **arguments[3]; zval *zval_resulttype=NULL; zval *zval_returned_array=NULL; zval *returned_zval=NULL; MAKE_STD_ZVAL(zval_returned_array); /* no value needed, it will be overwritten anyway */ ZVAL_EMPTY_STRING(zval_returned_array); /* there seems to be some weird mem-bug, so assigning a value anyway */ MAKE_STD_ZVAL(zval_resulttype); ZVAL_LONG(zval_resulttype, OCI_NUM | OCI_RETURN_NULLS | OCI_RETURN_LOBS); /* no ASSOC, dbx handles that part */ arguments[0]=result_handle; arguments[1]=&zval_returned_array; arguments[2]=&zval_resulttype; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "OCIFetchInto", &returned_zval, number_of_arguments, arguments); /* OCIFetchInto returns the number of columns as an integer on success and FALSE */ /* on failure. The actual array is passed back in arg[1] */ if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_LONG || Z_LVAL_P(returned_zval)==0) { if (returned_zval) zval_ptr_dtor(&returned_zval); FREE_ZVAL(zval_resulttype); FREE_ZVAL(zval_returned_array); return 0; } FREE_ZVAL(zval_resulttype); zval_ptr_dtor(&returned_zval); MOVE_RETURNED_TO_RV(rv, zval_returned_array); return 1; } int dbx_oci8_error(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS) { /* returns string */ /* OCIError needs a statement handle most of the times, and I can only provide */ /* a db-handle which is only needed some of the time. For now, I have disabled */ /* the dbx_error for the oci8 extension */ int number_of_arguments=1; zval **arguments[1]; zval *returned_zval=NULL; zval *returned_message_zval=NULL; arguments[0]=dbx_handle; if (!dbx_handle) number_of_arguments=0; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "OCIError", &returned_zval, number_of_arguments, arguments); /* OCIError should returns an assoc array containing code & message, dbx needs the message */ if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_ARRAY) { if (returned_zval) zval_ptr_dtor(&returned_zval); return 0; } /* get the messagestring here */ if (zend_hash_find(Z_ARRVAL_P(returned_zval), "message", strlen("message")+1, (void **) &returned_message_zval)==FAILURE) { /* oops! no msg? */ zval_ptr_dtor(&returned_zval); return 0; } MOVE_RETURNED_TO_RV(rv, returned_message_zval); zval_ptr_dtor(&returned_zval); return 1; } int dbx_oci8_esc(zval **rv, zval **dbx_handle, zval **string, INTERNAL_FUNCTION_PARAMETERS) { /* returns escaped string */ /* replace ' with '' */ char * str; int len; char * tmpstr; int tmplen; if (Z_STRLEN_PP(string) == 0) { ZVAL_EMPTY_STRING(*rv); return 1; } tmpstr = estrdup(Z_STRVAL_PP(string)); tmplen = Z_STRLEN_PP(string); /* php_str_to_str uses a smart_str that allocates memory */ /* this memory must be freed or passed on to rv */ str = php_str_to_str(tmpstr, tmplen, "'", 1, "''", 2, &len); efree(tmpstr); ZVAL_STRINGL(*rv, str, len, 0); return 1; } /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: */ php-4.4.8/ext/dbx/dbx_oci8.h0000644000175000017500000000660110736114306015033 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | dbx module version 1.0 | +----------------------------------------------------------------------+ | Copyright (c) 2001 Guidance Rotterdam BV | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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 : Marc Boeren | +----------------------------------------------------------------------+ */ /* $Id: dbx_oci8.h,v 1.5.2.1.8.3 2007/12/31 07:22:46 sebastian Exp $ */ #ifndef ZEND_DBX_OCI8_H #define ZEND_DBX_OCI8_H #ifndef INIT_FUNC_ARGS #include "zend_modules.h" #endif #include "php.h" int dbx_oci8_connect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS); /* returns connection handle as resource on success or 0 as long on failure */ int dbx_oci8_pconnect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS); /* returns persistent connection handle as resource on success or 0 as long on failure */ int dbx_oci8_close(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS); /* returns 1 as long on success or 0 as long on failure */ int dbx_oci8_query(zval **rv, zval **dbx_handle, zval **db_name, zval **sql_statement, INTERNAL_FUNCTION_PARAMETERS); /* returns 1 as long or a result identifier as resource on success or 0 as long on failure */ int dbx_oci8_getcolumncount(zval **rv, zval **result_handle, INTERNAL_FUNCTION_PARAMETERS); /* returns column-count as long on success or 0 as long on failure */ int dbx_oci8_getcolumnname(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS); /* returns column-name as string on success or 0 as long on failure */ int dbx_oci8_getcolumntype(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS); /* returns column-type as string on success or 0 as long on failure */ int dbx_oci8_getrow(zval **rv, zval **result_handle, long row_number, INTERNAL_FUNCTION_PARAMETERS); /* returns array[0..columncount-1] as strings on success or 0 as long on failure */ int dbx_oci8_error(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS); /* returns string */ int dbx_oci8_esc(zval **rv, zval **dbx_handle, zval **string, INTERNAL_FUNCTION_PARAMETERS); /* returns escaped string */ #endif /* ZEND_DBX_OCI8_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: */ php-4.4.8/ext/dbx/dbx_odbc.c0000644000175000017500000002457610736114306015106 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | dbx module version 1.0 | +----------------------------------------------------------------------+ | Copyright (c) 2001 Guidance Rotterdam BV | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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 : Marc Boeren | +----------------------------------------------------------------------+ */ /* $Id: dbx_odbc.c,v 1.19.2.1.8.3 2007/12/31 07:22:46 sebastian Exp $ */ #include "dbx.h" #include "dbx_odbc.h" #define ODBC_ASSOC 1 #define ODBC_NUM 2 int dbx_odbc_connect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS) { /* returns connection handle as resource on success or 0 as long on failure */ int number_of_arguments=3; zval **arguments[3]; zval *returned_zval=NULL; arguments[0]=db; arguments[1]=username; arguments[2]=password; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "odbc_connect", &returned_zval, number_of_arguments, arguments); if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_RESOURCE) { if (returned_zval) zval_ptr_dtor(&returned_zval); return 0; } MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_odbc_pconnect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS) { /* returns connection handle as resource on success or 0 as long on failure */ int number_of_arguments=3; zval **arguments[3]; zval *returned_zval=NULL; arguments[0]=db; arguments[1]=username; arguments[2]=password; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "odbc_pconnect", &returned_zval, number_of_arguments, arguments); if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_RESOURCE) { if (returned_zval) zval_ptr_dtor(&returned_zval); return 0; } MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_odbc_close(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS) { /* returns 1 as long on success or 0 as long on failure */ int number_of_arguments=1; zval **arguments[1]; zval *returned_zval=NULL; int actual_resource_type; void *resource; resource = zend_list_find(Z_LVAL_PP(dbx_handle), &actual_resource_type); if (!resource) { return 0; } arguments[0]=dbx_handle; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "odbc_close", &returned_zval, number_of_arguments, arguments); if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_NULL) { if (returned_zval) zval_ptr_dtor(&returned_zval); return 0; } convert_to_long_ex(&returned_zval); Z_LVAL_P(returned_zval)=1; MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_odbc_query(zval **rv, zval **dbx_handle, zval **db_name, zval **sql_statement, INTERNAL_FUNCTION_PARAMETERS) { /* returns 1 as long or a result identifier as resource on success or 0 as long on failure */ int number_of_arguments=2; zval **arguments[2]; zval *queryresult_zval=NULL; zval *num_fields_zval=NULL; /* db_name is not used in this function */ arguments[0]=dbx_handle; arguments[1]=sql_statement; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "odbc_exec", &queryresult_zval, number_of_arguments, arguments); /* odbc_query returns a bool for failure, or a result_identifier for success */ if (!queryresult_zval || Z_TYPE_P(queryresult_zval)!=IS_RESOURCE) { if (queryresult_zval) zval_ptr_dtor(&queryresult_zval); return 0; } MAKE_STD_ZVAL(num_fields_zval); ZVAL_LONG(num_fields_zval, 0); if (!dbx_odbc_getcolumncount(&num_fields_zval, &queryresult_zval, INTERNAL_FUNCTION_PARAM_PASSTHRU)) { FREE_ZVAL(num_fields_zval); if (queryresult_zval) zval_ptr_dtor(&queryresult_zval); return 0; } if (Z_LVAL_P(num_fields_zval)==0) { Z_TYPE_PP(rv)=IS_BOOL; Z_LVAL_PP(rv)=1; /* success, but no data */ FREE_ZVAL(num_fields_zval); if (queryresult_zval) zval_ptr_dtor(&queryresult_zval); return 1; } FREE_ZVAL(num_fields_zval); MOVE_RETURNED_TO_RV(rv, queryresult_zval); return 1; } int dbx_odbc_getcolumncount(zval **rv, zval **result_handle, INTERNAL_FUNCTION_PARAMETERS) { /* returns column-count as long on success or 0 as long on failure */ int number_of_arguments=1; zval **arguments[1]; zval *returned_zval=NULL; arguments[0]=result_handle; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "odbc_num_fields", &returned_zval, number_of_arguments, arguments); if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_LONG || Z_LVAL_P(returned_zval)<0) { if (returned_zval) zval_ptr_dtor(&returned_zval); return 0; } MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_odbc_getcolumnname(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS) { /* returns column-name as string on success or 0 as long on failure */ int number_of_arguments=2; zval **arguments[2]; zval *zval_column_index; zval *returned_zval=NULL; MAKE_STD_ZVAL(zval_column_index); ZVAL_LONG(zval_column_index, column_index+1); arguments[0]=result_handle; arguments[1]=&zval_column_index; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "odbc_field_name", &returned_zval, number_of_arguments, arguments); /* odbc_field_name returns a string */ if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) { if (returned_zval) zval_ptr_dtor(&returned_zval); FREE_ZVAL(zval_column_index); return 0; } FREE_ZVAL(zval_column_index); MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_odbc_getcolumntype(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS) { /* returns column-type as string on success or 0 as long on failure */ int number_of_arguments=2; zval **arguments[2]; zval *zval_column_index; zval *returned_zval=NULL; MAKE_STD_ZVAL(zval_column_index); ZVAL_LONG(zval_column_index, column_index+1); arguments[0]=result_handle; arguments[1]=&zval_column_index; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "odbc_field_type", &returned_zval, number_of_arguments, arguments); /* odbc_field_name returns a string */ if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) { if (returned_zval) zval_ptr_dtor(&returned_zval); FREE_ZVAL(zval_column_index); return 0; } FREE_ZVAL(zval_column_index); MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_odbc_getrow(zval **rv, zval **result_handle, long row_number, INTERNAL_FUNCTION_PARAMETERS) { /* returns array[0..columncount-1] as strings on success or 0 as long on failure */ int number_of_arguments; zval **arguments[2]; zval *num_fields_zval=NULL; zval *fetch_row_result_zval=NULL; zval *field_result_zval=NULL; zval *field_index_zval; zval *returned_zval=NULL; long field_index; long field_count=-1; /* get # fields */ MAKE_STD_ZVAL(num_fields_zval); ZVAL_LONG(num_fields_zval, 0); if (!dbx_odbc_getcolumncount(&num_fields_zval, result_handle, INTERNAL_FUNCTION_PARAM_PASSTHRU)) { return 0; } field_count=Z_LVAL_P(num_fields_zval); FREE_ZVAL(num_fields_zval); /* fetch row */ number_of_arguments=1; arguments[0]=result_handle; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "odbc_fetch_row", &fetch_row_result_zval, number_of_arguments, arguments); if (!fetch_row_result_zval || Z_TYPE_P(fetch_row_result_zval)!=IS_BOOL) { if (fetch_row_result_zval) zval_ptr_dtor(&fetch_row_result_zval); return 0; } if (Z_LVAL_P(fetch_row_result_zval)==0) { Z_TYPE_PP(rv)=IS_LONG; Z_LVAL_PP(rv)=0; /* ok, no more rows */ zval_ptr_dtor(&fetch_row_result_zval); return 0; } zval_ptr_dtor(&fetch_row_result_zval); /* fill array with field results... */ MAKE_STD_ZVAL(returned_zval); if (array_init(returned_zval) != SUCCESS) { zend_error(E_ERROR, "dbx_odbc_getrow: unable to create result-array..."); FREE_ZVAL(returned_zval); return 0; } MAKE_STD_ZVAL(field_index_zval); ZVAL_LONG(field_index_zval, 0); number_of_arguments=2; for (field_index=0; field_index | +----------------------------------------------------------------------+ */ /* $Id: dbx_odbc.h,v 1.12.2.1.8.3 2007/12/31 07:22:46 sebastian Exp $ */ #ifndef ZEND_DBX_ODBC_H #define ZEND_DBX_ODBC_H #ifndef INIT_FUNC_ARGS #include "zend_modules.h" #endif #include "php.h" int dbx_odbc_connect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS); /* returns connection handle as resource on success or 0 as long on failure */ int dbx_odbc_pconnect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS); /* returns persisten connection handle as resource on success or 0 as long on failure */ int dbx_odbc_close(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS); /* returns 1 as long on success or 0 as long on failure */ int dbx_odbc_query(zval **rv, zval **dbx_handle, zval **db_name, zval **sql_statement, INTERNAL_FUNCTION_PARAMETERS); /* returns 1 as long or a result identifier as resource on success or 0 as long on failure */ int dbx_odbc_getcolumncount(zval **rv, zval **result_handle, INTERNAL_FUNCTION_PARAMETERS); /* returns column-count as long on success or 0 as long on failure */ int dbx_odbc_getcolumnname(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS); /* returns column-name as string on success or 0 as long on failure */ int dbx_odbc_getcolumntype(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS); /* returns column-type as string on success or 0 as long on failure */ int dbx_odbc_getrow(zval **rv, zval **result_handle, long row_number, INTERNAL_FUNCTION_PARAMETERS); /* returns array[0..columncount-1] as strings on success or 0 as long on failure */ int dbx_odbc_error(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS); /* returns string */ int dbx_odbc_esc(zval **rv, zval **dbx_handle, zval **string, INTERNAL_FUNCTION_PARAMETERS); /* returns escaped string */ #endif /* ZEND_DBX_ODBC_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: */ php-4.4.8/ext/dbx/dbx_mysql.c0000644000175000017500000002542710736114306015340 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | dbx module version 1.0 | +----------------------------------------------------------------------+ | Copyright (c) 2001 Guidance Rotterdam BV | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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 : Marc Boeren | +----------------------------------------------------------------------+ */ /* $Id: dbx_mysql.c,v 1.17.2.1.8.3 2007/12/31 07:22:46 sebastian Exp $ */ #include "dbx.h" #include "dbx_mysql.h" #define MYSQL_ASSOC 1<<0 #define MYSQL_NUM 1<<1 int dbx_mysql_connect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS) { /* returns connection handle as resource on success or 0 as long on failure */ int number_of_arguments=3; zval **arguments[3]; zval *returned_zval=NULL; zval *select_db_zval=NULL; arguments[0]=host; arguments[1]=username; arguments[2]=password; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mysql_connect", &returned_zval, number_of_arguments, arguments); if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_RESOURCE) { if (returned_zval) zval_ptr_dtor(&returned_zval); return 0; } number_of_arguments=2; arguments[0]=db; arguments[1]=&returned_zval; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mysql_select_db", &select_db_zval, number_of_arguments, arguments); if (!select_db_zval || (Z_TYPE_P(select_db_zval)==IS_BOOL && Z_LVAL_P(select_db_zval)==0) ) { if (select_db_zval) zval_ptr_dtor(&select_db_zval); /* also close connection */ number_of_arguments=1; arguments[0]=&returned_zval; zend_list_addref(Z_LVAL_P(returned_zval)); dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mysql_close", &select_db_zval, number_of_arguments, arguments); if (select_db_zval) zval_ptr_dtor(&select_db_zval); zval_ptr_dtor(&returned_zval); return 0; } zval_ptr_dtor(&select_db_zval); MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_mysql_pconnect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS) { /* returns persistent connection handle as resource on success or 0 as long on failure */ int number_of_arguments=3; zval **arguments[3]; zval *returned_zval=NULL; zval *select_db_zval=NULL; arguments[0]=host; arguments[1]=username; arguments[2]=password; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mysql_pconnect", &returned_zval, number_of_arguments, arguments); if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_RESOURCE) { if (returned_zval) zval_ptr_dtor(&returned_zval); return 0; } number_of_arguments=2; arguments[0]=db; arguments[1]=&returned_zval; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mysql_select_db", &select_db_zval, number_of_arguments, arguments); if (!select_db_zval || (Z_TYPE_P(select_db_zval)==IS_BOOL && Z_LVAL_P(select_db_zval)==0) ) { if (select_db_zval) zval_ptr_dtor(&select_db_zval); /* also close connection */ number_of_arguments=1; arguments[0]=&returned_zval; zend_list_addref(Z_LVAL_P(returned_zval)); dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mysql_close", &select_db_zval, number_of_arguments, arguments); if (select_db_zval) zval_ptr_dtor(&select_db_zval); zval_ptr_dtor(&returned_zval); return 0; } zval_ptr_dtor(&select_db_zval); MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_mysql_close(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS) { /* returns 1 as long on success or 0 as long on failure */ int number_of_arguments=1; zval **arguments[1]; zval *returned_zval=NULL; arguments[0]=dbx_handle; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mysql_close", &returned_zval, number_of_arguments, arguments); if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_BOOL) { if (returned_zval) zval_ptr_dtor(&returned_zval); return 0; } MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_mysql_query(zval **rv, zval **dbx_handle, zval **db_name, zval **sql_statement, INTERNAL_FUNCTION_PARAMETERS) { /* returns 1 as long or a result identifier as resource on success or 0 as long on failure */ int number_of_arguments=2; zval **arguments[2]; zval *returned_zval=NULL; zval *select_db_zval=NULL; number_of_arguments=2; arguments[0]=db_name; arguments[1]=dbx_handle; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mysql_select_db", &select_db_zval, number_of_arguments, arguments); zval_ptr_dtor(&select_db_zval); number_of_arguments=2; arguments[0]=sql_statement; arguments[1]=dbx_handle; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mysql_query", &returned_zval, number_of_arguments, arguments); /* mysql_query returns a bool for success or failure, or a result_identifier for select statements */ if (!returned_zval || (Z_TYPE_P(returned_zval)!=IS_BOOL && Z_TYPE_P(returned_zval)!=IS_RESOURCE)) { if (returned_zval) zval_ptr_dtor(&returned_zval); return 0; } MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_mysql_getcolumncount(zval **rv, zval **result_handle, INTERNAL_FUNCTION_PARAMETERS) { /* returns column-count as long on success or 0 as long on failure */ int number_of_arguments=1; zval **arguments[1]; zval *returned_zval=NULL; arguments[0]=result_handle; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mysql_num_fields", &returned_zval, number_of_arguments, arguments); if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_LONG) { if (returned_zval) zval_ptr_dtor(&returned_zval); return 0; } MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_mysql_getcolumnname(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS) { /* returns column-name as string on success or 0 as long on failure */ int number_of_arguments=2; zval **arguments[2]; zval *zval_column_index; zval *returned_zval=NULL; MAKE_STD_ZVAL(zval_column_index); ZVAL_LONG(zval_column_index, column_index); arguments[0]=result_handle; arguments[1]=&zval_column_index; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mysql_field_name", &returned_zval, number_of_arguments, arguments); /* mysql_field_name returns a string */ if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) { if (returned_zval) zval_ptr_dtor(&returned_zval); FREE_ZVAL(zval_column_index); return 0; } FREE_ZVAL(zval_column_index); MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_mysql_getcolumntype(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS) { /* returns column-type as string on success or 0 as long on failure */ int number_of_arguments=2; zval **arguments[2]; zval *zval_column_index; zval *returned_zval=NULL; MAKE_STD_ZVAL(zval_column_index); ZVAL_LONG(zval_column_index, column_index); arguments[0]=result_handle; arguments[1]=&zval_column_index; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mysql_field_type", &returned_zval, number_of_arguments, arguments); /* mysql_field_name returns a string */ if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) { if (returned_zval) zval_ptr_dtor(&returned_zval); FREE_ZVAL(zval_column_index); return 0; } FREE_ZVAL(zval_column_index); MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_mysql_getrow(zval **rv, zval **result_handle, long row_number, INTERNAL_FUNCTION_PARAMETERS) { /* returns array[0..columncount-1] as strings on success or 0 as long on failure */ int number_of_arguments=2; zval **arguments[2]; zval *zval_resulttype=NULL; zval *returned_zval=NULL; MAKE_STD_ZVAL(zval_resulttype); ZVAL_LONG(zval_resulttype, MYSQL_NUM); arguments[0]=result_handle; arguments[1]=&zval_resulttype; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mysql_fetch_array", &returned_zval, number_of_arguments, arguments); if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_ARRAY) { if (returned_zval) zval_ptr_dtor(&returned_zval); FREE_ZVAL(zval_resulttype); return 0; } FREE_ZVAL(zval_resulttype); MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_mysql_error(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS) { /* returns string */ int number_of_arguments=1; zval **arguments[1]; zval *returned_zval=NULL; arguments[0]=dbx_handle; if (!dbx_handle) number_of_arguments=0; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mysql_error", &returned_zval, number_of_arguments, arguments); if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) { if (returned_zval) zval_ptr_dtor(&returned_zval); return 0; } MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_mysql_esc(zval **rv, zval **dbx_handle, zval **string, INTERNAL_FUNCTION_PARAMETERS) { /* returns escaped string */ int number_of_arguments=2; zval **arguments[2]; zval *returned_zval=NULL; char * str; int len; char * tmpstr; int tmplen; if (Z_STRLEN_PP(string) == 0) { ZVAL_EMPTY_STRING(*rv); return 1; } arguments[0]=string; arguments[1]=dbx_handle; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mysql_real_escape_string", &returned_zval, number_of_arguments, arguments); if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) { if (returned_zval) zval_ptr_dtor(&returned_zval); /* mysql_real_escape_string failed, just do my own escaping then */ /* replace \ with \\ */ /* ' with '' */ tmpstr = estrdup(Z_STRVAL_PP(string)); tmplen = Z_STRLEN_PP(string); /* php_str_to_str uses a smart_str that allocates memory */ /* this memory must be freed or passed on to rv */ str = php_str_to_str(tmpstr, tmplen, "\\", 1, "\\\\", 2, &len); efree(tmpstr); tmpstr=str; tmplen=len; str = php_str_to_str(tmpstr, tmplen, "'", 1, "''", 2, &len); efree(tmpstr); ZVAL_STRINGL(*rv, str, len, 0); return 1; } MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: */ php-4.4.8/ext/dbx/dbx_mysql.h0000644000175000017500000000662010736114306015337 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | dbx module version 1.0 | +----------------------------------------------------------------------+ | Copyright (c) 2001 Guidance Rotterdam BV | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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 : Marc Boeren | +----------------------------------------------------------------------+ */ /* $Id: dbx_mysql.h,v 1.12.2.1.8.3 2007/12/31 07:22:46 sebastian Exp $ */ #ifndef ZEND_DBX_MYSQL_H #define ZEND_DBX_MYSQL_H #ifndef INIT_FUNC_ARGS #include "zend_modules.h" #endif #include "php.h" int dbx_mysql_connect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS); /* returns connection handle as resource on success or 0 as long on failure */ int dbx_mysql_pconnect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS); /* returns persistent connection handle as resource on success or 0 as long on failure */ int dbx_mysql_close(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS); /* returns 1 as long on success or 0 as long on failure */ int dbx_mysql_query(zval **rv, zval **dbx_handle, zval **db_name, zval **sql_statement, INTERNAL_FUNCTION_PARAMETERS); /* returns 1 as long or a result identifier as resource on success or 0 as long on failure */ int dbx_mysql_getcolumncount(zval **rv, zval **result_handle, INTERNAL_FUNCTION_PARAMETERS); /* returns column-count as long on success or 0 as long on failure */ int dbx_mysql_getcolumnname(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS); /* returns column-name as string on success or 0 as long on failure */ int dbx_mysql_getcolumntype(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS); /* returns column-type as string on success or 0 as long on failure */ int dbx_mysql_getrow(zval **rv, zval **result_handle, long row_number, INTERNAL_FUNCTION_PARAMETERS); /* returns array[0..columncount-1] as strings on success or 0 as long on failure */ int dbx_mysql_error(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS); /* returns string */ int dbx_mysql_esc(zval **rv, zval **dbx_handle, zval **string, INTERNAL_FUNCTION_PARAMETERS); /* returns escaped string */ #endif /* ZEND_DBX_MYSQL_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: */ php-4.4.8/ext/dbx/dbx_pgsql.c0000644000175000017500000002255310736114306015316 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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 : Rui Hirokawa | +----------------------------------------------------------------------+ */ /* $Id: dbx_pgsql.c,v 1.20.2.2.8.3 2007/12/31 07:22:46 sebastian Exp $ */ #include "dbx.h" #include "php_dbx.h" #include "dbx_pgsql.h" #include #define PGSQL_ASSOC 1<<0 #define PGSQL_NUM 1<<1 int dbx_pgsql_connect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS) { /* returns connection handle as resource on success or 0 as long on failure */ int nargs=5; char *port="5432", *connstring=NULL; zval **args[5], *rarg = NULL; zval *conn_zval = NULL; zval *returned_zval=NULL; MAKE_STD_ZVAL(conn_zval); ZVAL_LONG(conn_zval, 0); if (Z_STRLEN_PP(username)>0) { int len; len = Z_STRLEN_PP(host)+Z_STRLEN_PP(db)+strlen(port); len += Z_STRLEN_PP(username)+Z_STRLEN_PP(password)+45; connstring = (char *)emalloc(len+1); sprintf(connstring, "host='%s' port='%s' dbname='%s' user='%s' password='%s'", Z_STRVAL_PP(host), port, Z_STRVAL_PP(db), Z_STRVAL_PP(username), Z_STRVAL_PP(password)); ZVAL_STRING(conn_zval, connstring, 0); args[0] = &conn_zval; nargs = 1; } else { int k; args[0] = host; for (k=1;k<4;k++){ MAKE_STD_ZVAL(rarg); ZVAL_EMPTY_STRING(rarg); args[k] = &rarg; } args[4] = db; } dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "pg_connect", &returned_zval, nargs, args); zval_dtor(conn_zval); FREE_ZVAL(conn_zval); if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_RESOURCE) { if (returned_zval) zval_ptr_dtor(&returned_zval); return 0; } MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_pgsql_pconnect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS) { /* returns persistent connection handle as resource on success or 0 as long on failure */ int nargs=5; char *port="5432", *connstring=NULL; zval **args[5], *rarg = NULL; zval *conn_zval = NULL; zval *returned_zval=NULL; MAKE_STD_ZVAL(conn_zval); ZVAL_LONG(conn_zval, 0); if (Z_STRLEN_PP(username)>0) { int len; len = Z_STRLEN_PP(host)+Z_STRLEN_PP(db)+strlen(port); len += Z_STRLEN_PP(username)+Z_STRLEN_PP(password)+45; connstring = (char *)emalloc(len+1); sprintf(connstring, "host='%s' port='%s' dbname='%s' user='%s' password='%s'", Z_STRVAL_PP(host), port, Z_STRVAL_PP(db), Z_STRVAL_PP(username), Z_STRVAL_PP(password)); ZVAL_STRING(conn_zval, connstring, 0); args[0] = &conn_zval; nargs = 1; } else { int k; args[0] = host; for (k=1;k<4;k++){ MAKE_STD_ZVAL(rarg); ZVAL_EMPTY_STRING(rarg); args[k] = &rarg; } args[4] = db; } dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "pg_pconnect", &returned_zval, nargs, args); zval_dtor(conn_zval); FREE_ZVAL(conn_zval); if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_RESOURCE) { if (returned_zval) zval_ptr_dtor(&returned_zval); return 0; } MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_pgsql_close(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS) { /* returns 1 as long on success or 0 as long on failure */ int number_of_arguments=1; zval **arguments[1]; zval *returned_zval=NULL; arguments[0]=dbx_handle; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "pg_close", &returned_zval, number_of_arguments, arguments); if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_BOOL) { if (returned_zval) zval_ptr_dtor(&returned_zval); return 0; } MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_pgsql_query(zval **rv, zval **dbx_handle, zval **db_name, zval **sql_statement, INTERNAL_FUNCTION_PARAMETERS) { /* returns 1 as long or a result identifier as resource on success or 0 as long on failure */ int nargs=2; zval **args[2]; zval *returned_zval=NULL; /* db_name is not used in this function */ args[0]=dbx_handle; args[1]=sql_statement; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "pg_exec", &returned_zval, nargs, args); /* pg_query returns a bool for success or failure, or a result_identifier for select statements */ if (!returned_zval || (Z_TYPE_P(returned_zval)!=IS_BOOL && Z_TYPE_P(returned_zval)!=IS_RESOURCE)) { if (returned_zval) zval_ptr_dtor(&returned_zval); return 0; } MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_pgsql_getcolumncount(zval **rv, zval **result_handle, INTERNAL_FUNCTION_PARAMETERS) { /* returns column-count as long on success or 0 as long on failure */ int number_of_arguments=1; zval **arguments[1]; zval *returned_zval=NULL; arguments[0]=result_handle; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "pg_numfields", &returned_zval, number_of_arguments, arguments); if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_LONG) { if (returned_zval) zval_ptr_dtor(&returned_zval); return 0; } MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_pgsql_getcolumnname(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS) { /* returns column-name as string on success or 0 as long on failure */ int number_of_arguments=2; zval **arguments[2]; zval *zval_column_index; zval *returned_zval=NULL; MAKE_STD_ZVAL(zval_column_index); ZVAL_LONG(zval_column_index, column_index); arguments[0]=result_handle; arguments[1]=&zval_column_index; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "pg_fieldname", &returned_zval, number_of_arguments, arguments); /* pg_fieldname returns a string */ if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) { if (returned_zval) zval_ptr_dtor(&returned_zval); FREE_ZVAL(zval_column_index); return 0; } FREE_ZVAL(zval_column_index); MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_pgsql_getcolumntype(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS) { /* returns column-type as string on success or 0 as long on failure */ int number_of_arguments=2; zval **arguments[2]; zval *zval_column_index; zval *returned_zval=NULL; MAKE_STD_ZVAL(zval_column_index); ZVAL_LONG(zval_column_index, column_index); arguments[0]=result_handle; arguments[1]=&zval_column_index; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "pg_fieldtype", &returned_zval, number_of_arguments, arguments); /* pg_fieldtype returns a string */ if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) { if (returned_zval) zval_ptr_dtor(&returned_zval); FREE_ZVAL(zval_column_index); return 0; } FREE_ZVAL(zval_column_index); MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_pgsql_getrow(zval **rv, zval **result_handle, long row_number, INTERNAL_FUNCTION_PARAMETERS) { /* returns array[0..columncount-1] as strings on success or 0 as long on failure */ int number_of_arguments=1; zval **arguments[1]; zval *returned_zval=NULL; arguments[0]=result_handle; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "pg_fetch_array", &returned_zval, number_of_arguments, arguments); if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_ARRAY) { if (returned_zval) zval_ptr_dtor(&returned_zval); return 0; } MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_pgsql_error(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS) { /* returns string */ int number_of_arguments=1; zval **arguments[1]; zval *returned_zval=NULL; arguments[0]=dbx_handle; if (!dbx_handle) number_of_arguments=0; dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "pg_errormessage", &returned_zval, number_of_arguments, arguments); if (!returned_zval || Z_TYPE_P(returned_zval)!=IS_STRING) { if (returned_zval) zval_ptr_dtor(&returned_zval); return 0; } MOVE_RETURNED_TO_RV(rv, returned_zval); return 1; } int dbx_pgsql_esc(zval **rv, zval **dbx_handle, zval **string, INTERNAL_FUNCTION_PARAMETERS) { /* returns escaped string */ /* replace \ with \\ */ /* ' with '' */ char * str; int len; char * tmpstr; int tmplen; if (Z_STRLEN_PP(string) == 0) { ZVAL_EMPTY_STRING(*rv); return 1; } tmpstr = estrdup(Z_STRVAL_PP(string)); tmplen = Z_STRLEN_PP(string); /* php_str_to_str uses a smart_str that allocates memory */ /* this memory must be freed or passed on to rv */ str = php_str_to_str(tmpstr, tmplen, "\\", 1, "\\\\", 2, &len); efree(tmpstr); tmpstr=str; tmplen=len; str = php_str_to_str(tmpstr, tmplen, "'", 1, "''", 2, &len); efree(tmpstr); ZVAL_STRINGL(*rv, str, len, 0); return 1; } /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: */ php-4.4.8/ext/dbx/dbx_pgsql.h0000644000175000017500000000614110736114306015316 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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 : Rui Hirokawa | +----------------------------------------------------------------------+ */ /* $Id: dbx_pgsql.h,v 1.11.2.1.8.3 2007/12/31 07:22:46 sebastian Exp $ */ #ifndef ZEND_DBX_PGSQL_H #define ZEND_DBX_PGSQL_H #ifndef INIT_FUNC_ARGS #include "zend_modules.h" #endif #include "php.h" int dbx_pgsql_connect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS); /* returns connection handle as resource on success or 0 as long on failure */ int dbx_pgsql_pconnect(zval **rv, zval **host, zval **db, zval **username, zval **password, INTERNAL_FUNCTION_PARAMETERS); /* returns persistent connection handle as resource on success or 0 as long on failure */ int dbx_pgsql_close(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS); /* returns 1 as long on success or 0 as long on failure */ int dbx_pgsql_query(zval **rv, zval **dbx_handle, zval **db_name, zval **sql_statement, INTERNAL_FUNCTION_PARAMETERS); /* returns 1 as long or a result identifier as resource on success or 0 as long on failure */ int dbx_pgsql_getcolumncount(zval **rv, zval **result_handle, INTERNAL_FUNCTION_PARAMETERS); /* returns column-count as long on success or 0 as long on failure */ int dbx_pgsql_getcolumnname(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS); /* returns column-name as string on success or 0 as long on failure */ int dbx_pgsql_getcolumntype(zval **rv, zval **result_handle, long column_index, INTERNAL_FUNCTION_PARAMETERS); /* returns column-type as string on success or 0 as long on failure */ int dbx_pgsql_getrow(zval **rv, zval **result_handle, long row_number, INTERNAL_FUNCTION_PARAMETERS); /* returns array[0..columncount-1] as strings on success or 0 as long on failure */ int dbx_pgsql_error(zval **rv, zval **dbx_handle, INTERNAL_FUNCTION_PARAMETERS); /* returns string */ int dbx_pgsql_esc(zval **rv, zval **dbx_handle, zval **string, INTERNAL_FUNCTION_PARAMETERS); /* returns escaped string */ #endif /* ZEND_DBX_PGSQL_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: */ php-4.4.8/ext/dbx/php_dbx.h0000644000175000017500000000545310736114306014764 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | dbx module version 1.0 | +----------------------------------------------------------------------+ | Copyright (c) 2001 Guidance Rotterdam BV | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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 : Marc Boeren | +----------------------------------------------------------------------+ */ /* $Id: php_dbx.h,v 1.13.2.1.8.3 2007/12/31 07:22:46 sebastian Exp $ */ #ifndef ZEND_PHP_DBX_H #define ZEND_PHP_DBX_H #ifndef INIT_FUNC_ARGS #include "zend_modules.h" #endif extern zend_module_entry dbx_module_entry; #define phpext_dbx_ptr &dbx_module_entry #ifdef ZEND_WIN32 #define ZEND_DBX_API __declspec(dllexport) #else #define ZEND_DBX_API #endif ZEND_MINIT_FUNCTION(dbx); ZEND_MSHUTDOWN_FUNCTION(dbx); /* ZEND_RINIT_FUNCTION(dbx); */ /* ZEND_RSHUTDOWN_FUNCTION(dbx); */ ZEND_MINFO_FUNCTION(dbx); ZEND_FUNCTION(dbx_connect); ZEND_FUNCTION(dbx_close); ZEND_FUNCTION(dbx_query); ZEND_FUNCTION(dbx_error); ZEND_FUNCTION(dbx_escape_string); ZEND_FUNCTION(dbx_sort); ZEND_FUNCTION(dbx_compare); /* Declare any global variables you may need between the BEGIN and END macros here: */ /* ZEND_BEGIN_MODULE_GLOBALS(dbx) ZEND_END_MODULE_GLOBALS(dbx) */ /* In every function that needs to use variables in php_dbx_globals, do call dbxLS_FETCH(); after declaring other variables used by that function, and always refer to them as dbxG(variable). You are encouraged to rename these macros something shorter, see examples in any other php module directory. */ #ifdef ZTS #define DBXG(v) TSRMG(dbx_globals_id, zend_dbx_globals *, v) #else #define DBXG(v) (dbx_globals.v) #endif #endif /* ZEND_PHP_DBX_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: */ php-4.4.8/ext/dbx/INSTALL0000644000175000017500000000115207314104547014214 0ustar derickderick If you downloaded this separately, you can place the dbx folder in the php-source-folders under the ext/ folder. Be sure to use buildconf to rebuild the configure script. Linux: Compile php with the --enable-dbx switch Windows: This should set all includepaths to the right relative folders. Open the .dsp and compile. You could also add this project to the php_modules project. It generates a php_dbx.dll in your extensions folder, and you must enable it in your php.ini file. When you run phpinfo(), dbx-support should be visible in the resulting table. Good luck and enjoy! Marc Boeren march 16th, 2001 php-4.4.8/ext/dbx/CREDITS0000644000175000017500000000010707440153445014203 0ustar derickderickdbx (database abstraction) Marc Boeren, Rui Hirokawa, Frank M. Kromann php-4.4.8/ext/com/0000755000175000017500000000000010737115146013165 5ustar derickderickphp-4.4.8/ext/com/TODO0000644000175000017500000000207007462544005013655 0ustar derickderick1) Multi-dimenstional array support 4) Documentation (internal and user) and howtos 5) IEnumVariant::All() which would be like IEnumVariant::Next(IDispatch::Count) 7) Test component (goes with the docs) 8) Test suite (Needs test component) 10) lets try if we are able to call non IDispatch - only Typelib components -- delayed till PHP5: 3) WithEvents -- delayed till PHP5: 9) reduce the need for VARIANT() ad 6.) check vbsample.php (new VARIANT(*, *|VT_BYREF)) GPs -- done 2) IErrorInfo -- done 6) Look for memory leaks and AdRef/Release problems - I KNOW there are some... -- done 11) IEnumVariant::Next() without parameter should only return an object, not an array with one element -- done 12) VARIANT->value as lvalue -- done 13) export VARIANT through the COM module -- done 14) trap exceptions and errors -- donne ad 4.) faq (i've collected a few questions from various lists) variant attributes !! to be discussed: - mts support (getcontext) - adsi support (ads* functions) -- delayed till PHP 5: try serialisation support (if component implements IPersist) php-4.4.8/ext/com/COM.c0000644000175000017500000020052310736114305013744 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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 | | Harald Radi | | Alan Brown | | Wez Furlong | +----------------------------------------------------------------------+ */ /* $Id: COM.c,v 1.90.2.11.2.3 2007/12/31 07:22:45 sebastian Exp $ */ /* * This module implements support for COM components that support the IDispatch * interface. Both local (COM) and remote (DCOM) components can be accessed. * * Type libraries can be loaded (in order for PHP to recognize automation constants) * by specifying a typelib_file in the PHP .ini file. That file should contain * paths to type libraries, one in every line. By default, constants are registered * as case-sensitive. If you want them to be defined as case-insensitive, add * #case_insensitive or #cis at the end of the type library path. * * This is also the first module to demonstrate Zend's OO syntax overloading * capabilities. CORBA coders are invited to write a CORBA module as well! * * Zeev */ /* * 28.12.2000 * unicode conversion fixed by Harald Radi * * now all these strange '?'s should be disapeared */ /* * 28.1.2001 * VARIANT datatype and pass_by_reference support */ /* * 03.6.2001 * Enhanced Typelib support to include a search by name */ #ifdef PHP_WIN32 #define _WIN32_DCOM #define COBJMACROS #include #include #include #include "php.h" #include "php_ini.h" #include "php_COM.h" #include "php_VARIANT.h" static ITypeLib *php_COM_find_typelib(char *search_string, int mode TSRMLS_DC); static int do_COM_offget(VARIANT *result, comval *array, pval *property, int cleanup TSRMLS_DC); static int do_COM_propget(VARIANT *var_result, comval *obj, pval *arg_property, int cleanup TSRMLS_DC); static void php_register_COM_class(TSRMLS_D); static void php_COM_init(int module_number TSRMLS_DC); static char *php_string_from_clsid(const CLSID *clsid TSRMLS_DC); static int com_enable_events(comval *obj, int enable); static int le_comval; static int codepage; #ifdef _DEBUG int resourcecounter = 1; #endif static unsigned char arg1and2_force_ref[] = { 2, BYREF_FORCE, BYREF_FORCE }; function_entry COM_functions[] = { PHP_FE(com_load, NULL) PHP_FE(com_invoke, NULL) PHP_FE(com_invoke_ex, NULL) PHP_FE(com_addref, NULL) PHP_FE(com_release, NULL) PHP_FE(com_propget, NULL) PHP_FE(com_propput, NULL) PHP_FE(com_load_typelib, NULL) PHP_FE(com_isenum, NULL) PHP_FE(com_event_sink, arg1and2_force_ref) PHP_FE(com_message_pump, NULL) PHP_FE(com_print_typeinfo, NULL) PHP_FALIAS(com_get, com_propget, NULL) PHP_FALIAS(com_propset, com_propput, NULL) PHP_FALIAS(com_set, com_propput, NULL) { NULL, NULL, NULL } }; static PHP_MINFO_FUNCTION(COM) { DISPLAY_INI_ENTRIES(); } PHPAPI HRESULT php_COM_invoke(comval *obj, DISPID dispIdMember, WORD wFlags, DISPPARAMS FAR* pDispParams, VARIANT FAR* pVarResult, char **ErrString TSRMLS_DC) { HRESULT hr; int failed = FALSE; unsigned int ArgErr; EXCEPINFO ExceptInfo; *ErrString = NULL; /* @todo use DispInvoke here ? */ if (C_ISREFD(obj)) { hr = C_DISPATCH_VT(obj)->Invoke(C_DISPATCH(obj), dispIdMember, &IID_NULL, LOCALE_SYSTEM_DEFAULT, wFlags, pDispParams, pVarResult, &ExceptInfo, &ArgErr); if (FAILED(hr)) { switch (hr) { case DISP_E_EXCEPTION: { char *src = NULL; int srclen = 0; char *desc = NULL; int desclen = 0; if (ExceptInfo.bstrSource) { src = php_OLECHAR_to_char(ExceptInfo.bstrSource, &srclen, codepage TSRMLS_CC); SysFreeString(ExceptInfo.bstrSource); } else { src = estrdup("Unavailable"); srclen = strlen(src); } if (ExceptInfo.bstrDescription) { desc = php_OLECHAR_to_char(ExceptInfo.bstrDescription, &desclen, codepage TSRMLS_CC); SysFreeString(ExceptInfo.bstrDescription); } else { desc = estrdup("Unavailable"); desclen = strlen(desc); } *ErrString = pemalloc(srclen+desclen+50, 1); sprintf(*ErrString, "Source: %s Description: %s", src, desc); efree(src); efree(desc); if (ExceptInfo.bstrHelpFile) { SysFreeString(ExceptInfo.bstrHelpFile); } } break; case DISP_E_PARAMNOTFOUND: case DISP_E_TYPEMISMATCH: *ErrString = pemalloc(25, 1); sprintf(*ErrString, "Argument: %d", pDispParams->cArgs-ArgErr+1); break; } } if (pVarResult && (V_VT(pVarResult) == VT_EMPTY)) { V_VT(pVarResult) = VT_I4; V_I4(pVarResult) = hr; } return hr; } else { return DISP_E_UNKNOWNINTERFACE; } } PHPAPI HRESULT php_COM_get_ids_of_names(comval *obj, OLECHAR FAR* FAR* rgszNames, DISPID FAR* rgDispId TSRMLS_DC) { HRESULT hr; if (C_ISREFD(obj)) { if (C_HASTLIB(obj)) { hr = C_TYPEINFO_VT(obj)->GetIDsOfNames(C_TYPEINFO(obj), rgszNames, 1, rgDispId); if (FAILED(hr)) { hr = C_DISPATCH_VT(obj)->GetIDsOfNames(C_DISPATCH(obj), &IID_NULL, rgszNames, 1, LOCALE_SYSTEM_DEFAULT, rgDispId); if (SUCCEEDED(hr)) { /* * ITypLib doesn't work * Release ITypeLib and fall back to IDispatch */ C_TYPEINFO_VT(obj)->Release(C_TYPEINFO(obj)); C_HASTLIB(obj) = FALSE; C_TYPEINFO(obj) = NULL; } } } else { hr = C_DISPATCH_VT(obj)->GetIDsOfNames(C_DISPATCH(obj), &IID_NULL, rgszNames, 1, LOCALE_SYSTEM_DEFAULT, rgDispId); } return hr; } else { return DISP_E_UNKNOWNINTERFACE; } } PHPAPI HRESULT php_COM_release(comval *obj TSRMLS_DC) { HRESULT hr; if (obj->refcount > 1) { C_RELEASE(obj); } else if (obj->refcount == 1) { if (C_HASTLIB(obj)) { C_TYPEINFO_VT(obj)->Release(C_TYPEINFO(obj)); C_TYPEINFO(obj) = NULL; C_HASTLIB(obj) = FALSE; } if (C_HASENUM(obj)) { hr = C_ENUMVARIANT_VT(obj)->Release(C_ENUMVARIANT(obj)); C_ENUMVARIANT(obj) = NULL; C_HASENUM(obj) = FALSE; } hr = C_DISPATCH_VT(obj)->Release(C_DISPATCH(obj)); C_RELEASE(obj); C_DISPATCH(obj) = NULL; } return obj->refcount; } PHPAPI HRESULT php_COM_addref(comval *obj TSRMLS_DC) { if (C_ISREFD(obj)) { C_ADDREF(obj); } return obj->refcount; } PHPAPI HRESULT php_COM_set(comval *obj, IDispatch FAR* FAR* ppDisp, int cleanup TSRMLS_DC) { HRESULT hr = 1; DISPPARAMS dispparams; VARIANT *var_result; IDispatch FAR* pDisp; pDisp = *ppDisp; if (cleanup) { *ppDisp = NULL; } C_REFCOUNT(obj) = 1; C_DISPATCH(obj) = pDisp; C_HASTLIB(obj) = SUCCEEDED(C_DISPATCH_VT(obj)->GetTypeInfo(C_DISPATCH(obj), 0, LANG_NEUTRAL, &C_TYPEINFO(obj))); dispparams.rgvarg = NULL; dispparams.rgdispidNamedArgs = NULL; dispparams.cArgs = 0; dispparams.cNamedArgs = 0; ALLOC_VARIANT(var_result); if (C_HASENUM(obj) = SUCCEEDED(C_DISPATCH_VT(obj)->Invoke(C_DISPATCH(obj), DISPID_NEWENUM, &IID_NULL, LOCALE_SYSTEM_DEFAULT, DISPATCH_METHOD|DISPATCH_PROPERTYGET, &dispparams, var_result, NULL, NULL))) { if (V_VT(var_result) == VT_UNKNOWN) { C_HASENUM(obj) = SUCCEEDED(V_UNKNOWN(var_result)->lpVtbl->QueryInterface(V_UNKNOWN(var_result), &IID_IEnumVARIANT, (void**)&C_ENUMVARIANT(obj))); } else if (V_VT(var_result) == VT_DISPATCH) { C_HASENUM(obj) = SUCCEEDED(V_DISPATCH(var_result)->lpVtbl->QueryInterface(V_DISPATCH(var_result), &IID_IEnumVARIANT, (void**)&C_ENUMVARIANT(obj))); } } FREE_VARIANT(var_result); if (!cleanup) { hr = C_DISPATCH_VT(obj)->AddRef(C_DISPATCH(obj)); } #ifdef _DEBUG obj->resourceindex = resourcecounter++; #endif return hr; } PHPAPI HRESULT php_COM_clone(comval *obj, comval *clone, int cleanup TSRMLS_DC) { HRESULT hr; C_HASTLIB(obj) = C_HASTLIB(clone); C_HASENUM(obj) = C_HASENUM(obj); C_DISPATCH(obj) = C_DISPATCH(clone); C_TYPEINFO(obj) = C_TYPEINFO(clone); if (cleanup || !C_ISREFD(obj)) { obj->refcount = clone->refcount; clone->refcount = 0; } else { if (C_HASTLIB(obj)) { C_TYPEINFO_VT(obj)->AddRef(C_TYPEINFO(obj)); } if (C_HASENUM(obj)) { C_ENUMVARIANT_VT(obj)->AddRef(C_ENUMVARIANT(obj)); } hr = C_DISPATCH_VT(obj)->AddRef(C_DISPATCH(obj)); obj->refcount = 1; } #ifdef _DEBUG obj->resourceindex = resourcecounter++; #endif return hr; } PHPAPI char *php_COM_error_message(HRESULT hr TSRMLS_DC) { void *pMsgBuf; if (!FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, hr, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &pMsgBuf, 0, NULL)) { char error_string[] = "No description available"; pMsgBuf = LocalAlloc(LMEM_FIXED, sizeof(error_string)); memcpy(pMsgBuf, error_string, sizeof(error_string)); } return pMsgBuf; } static char *php_string_from_clsid(const CLSID *clsid TSRMLS_DC) { LPOLESTR ole_clsid; char *clsid_str; StringFromCLSID(clsid, &ole_clsid); clsid_str = php_OLECHAR_to_char(ole_clsid, NULL, codepage TSRMLS_CC); LocalFree(ole_clsid); return clsid_str; } PHPAPI HRESULT php_COM_destruct(comval *obj TSRMLS_DC) { HRESULT hr = S_OK; com_enable_events(obj, FALSE); if (obj->sinkdispatch) obj->sinkdispatch->lpVtbl->Release(obj->sinkdispatch); if (C_ISREFD(obj)) { C_REFCOUNT(obj) = 1; hr = php_COM_release(obj TSRMLS_CC); } efree(obj); return hr; } static void php_comval_destructor(zend_rsrc_list_entry *rsrc TSRMLS_DC) { php_COM_destruct(rsrc->ptr TSRMLS_CC); } static PHP_INI_MH(OnTypelibFileChange) { FILE *typelib_file; char *typelib_name_buffer; char *strtok_buf = NULL; int interactive; interactive = CG(interactive); if (!new_value || (typelib_file = VCWD_FOPEN(new_value, "r"))==NULL) { return FAILURE; } if (interactive) { printf("Loading type libraries..."); fflush(stdout); } 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 (interactive) { printf("\rLoading %-60s\r", typelib_name); } if ((pTL = php_COM_find_typelib(typelib_name, mode TSRMLS_CC)) != NULL) { php_COM_load_typelib(pTL, mode TSRMLS_CC); pTL->lpVtbl->Release(pTL); } } efree(typelib_name_buffer); fclose(typelib_file); if (interactive) { printf("\r%70s\r", ""); } return SUCCESS; } PHP_INI_BEGIN() PHP_INI_ENTRY_EX("com.allow_dcom", "0", PHP_INI_SYSTEM, NULL, php_ini_boolean_displayer_cb) PHP_INI_ENTRY_EX("com.autoregister_typelib", "0", PHP_INI_SYSTEM, NULL, php_ini_boolean_displayer_cb) PHP_INI_ENTRY_EX("com.autoregister_verbose", "0", PHP_INI_SYSTEM, NULL, php_ini_boolean_displayer_cb) PHP_INI_ENTRY_EX("com.autoregister_casesensitive", "1", PHP_INI_SYSTEM, NULL, php_ini_boolean_displayer_cb) PHP_INI_ENTRY("com.typelib_file", "", PHP_INI_SYSTEM, OnTypelibFileChange) PHP_INI_END() /* {{{ proto int com_load(string module_name [, string remote_host [, int codepage [, string typelib]]]) Loads a COM module */ PHP_FUNCTION(com_load) { pval *module_name, *code_page, *typelib = NULL, *server_name = NULL, *user_name=NULL, *password=NULL, *domain=NULL; CLSID clsid; HRESULT hr; OLECHAR *ProgID; comval *obj; char *error_message; char *clsid_str; int mode = 0; ITypeLib *pTL; CLSCTX flags = CLSCTX_SERVER; codepage = CP_ACP; switch (ZEND_NUM_ARGS()) { case 1: zend_get_parameters(ht, 1, &module_name); break; case 2: zend_get_parameters(ht, 2, &module_name, &server_name); break; case 3: zend_get_parameters(ht, 3, &module_name, &server_name, &code_page); convert_to_long_ex(&code_page); codepage = Z_LVAL_P(code_page); break; case 4: zend_get_parameters(ht, 4, &module_name, &server_name, &code_page, &typelib); convert_to_string_ex(&typelib); convert_to_long_ex(&code_page); codepage = Z_LVAL_P(code_page); break; default: ZEND_WRONG_PARAM_COUNT(); } if (server_name != NULL) { /* What is server name? A String or an array? */ if (Z_TYPE_P(server_name) == IS_NULL) { server_name = NULL; } else if (Z_TYPE_P(server_name) == IS_ARRAY) { pval **tmp; /* DAB: 22 Sept 2001 * Aha - we have a number of possible arguments. * They are in the hash By name: Server, Domain, Username, Password * Flags. * This has been crafted to maintian maximum backward compatability. * If the server name is specified as a string, then the function * should behave as before by defaulting username and password and * using the (I believe) incorrect CLSCTX_SERVER instantiation * paramter. However if server is specified in this array then we * use either CLSCTX_REMOTE_SERVER or whatever flags are specified * in the array */ HashTable *ht = Z_ARRVAL(*server_name); if (FAILURE == zend_hash_find(ht, "Server", 7, (void **) &tmp)) { server_name = NULL; } else { server_name = *tmp; convert_to_string_ex(&server_name); /* CLSCTX_SERVER includes INPROC and LOCAL SERVER. This means * that any local server will be instantiated BEFORE even * looking on a remote server. Thus if we have a server name, * probably we want to access a remote machine or we would not * have bothered specifying it. So it would be wrong to to * connect locally. Futher, unless the name passed is a GUID, * there has to be something to map the Prog.Id to GUID and * unless that has been modified to remove the information * about local instantiation CLSCTX_SERVER would force a local * instantiation This setting can be overridden below if the * user specifies a flags element */ flags = CLSCTX_REMOTE_SERVER; } if (FAILURE == zend_hash_find(ht, "Username", 9, (void **) &tmp)) { user_name = NULL; } else { user_name = *tmp; convert_to_string_ex(&user_name); } if (FAILURE == zend_hash_find(ht, "Domain", 7, (void **) &tmp)) { domain = NULL; } else { domain = *tmp; convert_to_string_ex(&domain); } if (FAILURE == zend_hash_find(ht, "Password", 9, (void **) &tmp)) { password=NULL; } else { password = *tmp; convert_to_string_ex(&password); } if (SUCCESS == zend_hash_find(ht, "Flags", 6, (void **) &tmp)) { convert_to_long_ex(tmp); flags = (CLSCTX) Z_LVAL_PP(tmp); } } else { if (!INI_INT("com.allow_dcom")) { php_error(E_WARNING, "%s(): DCOM is disabled", get_active_function_name(TSRMLS_C)); RETURN_NULL(); } else { flags = CLSCTX_REMOTE_SERVER; convert_to_string_ex(&server_name); } } } ALLOC_COM(obj); convert_to_string_ex(&module_name); ProgID = php_char_to_OLECHAR(Z_STRVAL_P(module_name), Z_STRLEN_P(module_name), codepage TSRMLS_CC); /* obtain CLSID */ if (FAILED(CLSIDFromString(ProgID, &clsid))) { /* Perhaps this is a Moniker? */ IBindCtx *pBindCtx; IMoniker *pMoniker; ULONG ulEaten; /* @todo if (server_name) */ if (!server_name) { /* @todo shouldn't the bind context be fetched on module startup and kept as a global shared instance ? * all calls to BindToObject would deliver the same instance then (as desired) * IBindCtx::RegisterObjectBound() should be called then after mkparsedisplayname() * * @todo use mkparsedisplaynameex() ? */ if (SUCCEEDED(hr = CreateBindCtx(0, &pBindCtx))) { if (SUCCEEDED(hr = MkParseDisplayName(pBindCtx, ProgID, &ulEaten, &pMoniker))) { hr = pMoniker->lpVtbl->BindToObject(pMoniker, pBindCtx, NULL, &IID_IDispatch, (LPVOID *) &C_DISPATCH(obj)); pMoniker->lpVtbl->Release(pMoniker); } pBindCtx->lpVtbl->Release(pBindCtx); } } else { hr = MK_E_SYNTAX; } efree(ProgID); if (FAILED(hr)) { php_COM_destruct(obj TSRMLS_CC); error_message = php_COM_error_message(hr TSRMLS_CC); php_error(E_WARNING, "%s(): Invalid ProgID, GUID string, or Moniker: %s", get_active_function_name(TSRMLS_C), error_message); LocalFree(error_message); RETURN_NULL(); } } else { efree(ProgID); /* obtain IDispatch */ if (!server_name) { hr = CoCreateInstance(&clsid, NULL, flags, &IID_IDispatch, (LPVOID *) &C_DISPATCH(obj)); } else { COSERVERINFO server_info; MULTI_QI pResults; COAUTHIDENTITY authid; COAUTHINFO authinfo = {RPC_C_AUTHN_WINNT, RPC_C_AUTHZ_NONE, NULL, RPC_C_AUTHN_LEVEL_DEFAULT, RPC_C_IMP_LEVEL_IMPERSONATE, &authid, EOAC_NONE}; server_info.dwReserved1=0; server_info.dwReserved2=0; server_info.pwszName = php_char_to_OLECHAR(Z_STRVAL_P(server_name), Z_STRLEN_P(server_name), codepage TSRMLS_CC); if (user_name) { /* Z_STRVAL_P(user_name); */ /* Parse Username into domain\username */ authid.User = (WCHAR *) Z_STRVAL_P(user_name); authid.UserLength = Z_STRLEN_P(user_name); if (password) { authid.Password = (USHORT *) Z_STRVAL_P(password); authid.PasswordLength = Z_STRLEN_P(password); } else { authid.Password = (USHORT *) ""; authid.PasswordLength = 0; } if (domain) { authid.Domain = (USHORT *) Z_STRVAL_P(domain); authid.DomainLength = Z_STRLEN_P(domain); } else { authid.Domain = (USHORT *) ""; authid.DomainLength = 0; } authid.Flags = SEC_WINNT_AUTH_IDENTITY_ANSI; server_info.pAuthInfo=&authinfo; } else { server_info.pAuthInfo=NULL; } pResults.pIID = &IID_IDispatch; pResults.pItf = NULL; pResults.hr = S_OK; hr=CoCreateInstanceEx(&clsid, NULL, flags, &server_info, 1, &pResults); if (SUCCEEDED(hr)) { hr = pResults.hr; C_DISPATCH(obj) = (IDispatch *) pResults.pItf; } efree(server_info.pwszName); } if (FAILED(hr)) { error_message = php_COM_error_message(hr TSRMLS_CC); clsid_str = php_string_from_clsid(&clsid TSRMLS_CC); php_error(E_WARNING, "%s(): Unable to obtain IDispatch interface for CLSID %s: %s", get_active_function_name(TSRMLS_C), clsid_str, error_message); LocalFree(error_message); efree(clsid_str); php_COM_destruct(obj TSRMLS_CC); RETURN_NULL(); } } php_COM_set(obj, &C_DISPATCH(obj), TRUE TSRMLS_CC); if (INI_INT("com.autoregister_casesensitive")) { mode |= CONST_CS; } if (C_HASTLIB(obj)) { if (INI_INT("com.autoregister_typelib")) { unsigned int idx; /* @todo check if typlib isn't already loaded */ if (C_TYPEINFO_VT(obj)->GetContainingTypeLib(C_TYPEINFO(obj), &pTL, &idx) == S_OK) { php_COM_load_typelib(pTL, mode TSRMLS_CC); pTL->lpVtbl->Release(pTL); } } } else { if (typelib != NULL) { ITypeLib *pTL; if ((pTL = php_COM_find_typelib(Z_STRVAL_P(typelib), mode TSRMLS_CC)) != NULL) { C_HASTLIB(obj) = SUCCEEDED(pTL->lpVtbl->GetTypeInfo(pTL, 0, &C_TYPEINFO(obj))); /* idx 0 should deliver the ITypeInfo for the IDispatch Interface */ if (INI_INT("com.autoregister_typelib")) { php_COM_load_typelib(pTL, mode TSRMLS_CC); } pTL->lpVtbl->Release(pTL); } } } RETVAL_COM(obj); } /* }}} */ static int do_COM_invoke(comval *obj, WORD dispflags, pval *function_name, VARIANT *var_result, pval **arguments, int arg_count TSRMLS_DC) { DISPID dispid, altdispid; DISPPARAMS dispparams; HRESULT hr; OLECHAR *funcname; SAFEARRAY *pSA; SAFEARRAYBOUND rgsabound[1]; VARIANT *variant_args; char *error_message; int current_arg, current_variant; unsigned long count; if (C_HASENUM(obj) && strstr(Z_STRVAL_P(function_name), "next")) { /* Grab one argument off the stack, allocate enough * VARIANTs * Get the IEnumVariant interface and call ->Next(); */ switch (arg_count) { case 0: count = 1; break; case 1: convert_to_long_ex(&arguments[0]); count = Z_LVAL_P(arguments[0]); break; default: php_error(E_WARNING, "%s(): Wrong argument count to IEnumVariant::Next()", get_active_function_name(TSRMLS_C)); return FAILURE; } rgsabound[0].lLbound = 0; rgsabound[0].cElements = count; if ((pSA = SafeArrayCreate(VT_VARIANT, 1, rgsabound)) == NULL) { VariantInit(var_result); return FAILURE; } else { V_ARRAY(var_result) = pSA; V_VT(var_result) = VT_VARIANT|VT_ARRAY; } if (FAILED(hr = C_ENUMVARIANT_VT(obj)->Next(C_ENUMVARIANT(obj), count, pSA->pvData, &count))) { char *error_message = php_COM_error_message(hr TSRMLS_CC); php_error(E_WARNING, "%s(): IEnumVariant::Next() failed: %s", get_active_function_name(TSRMLS_C), error_message); efree(error_message); VariantClear(var_result); return FAILURE; } if (count != rgsabound[0].cElements) { rgsabound[0].cElements = count; if (FAILED(SafeArrayRedim(pSA, rgsabound))) { char *error_message = php_COM_error_message(hr TSRMLS_CC); php_error(E_WARNING, "%s(): IEnumVariant::Next() failed: %s", get_active_function_name(TSRMLS_C), error_message); efree(error_message); VariantClear(var_result); return FAILURE; } } /* return a single element if next() was called without count */ if ((arg_count == 0) && (count == 1)) { long index[] = {0}; SafeArrayGetElement(pSA, index, var_result); SafeArrayDestroy(pSA); } return SUCCESS; } else if (C_HASENUM(obj) && strstr(Z_STRVAL_P(function_name), "all")) { #define FETCH_BLOCKSIZE 10 /* fetch blocks of 10 elements */ count = FETCH_BLOCKSIZE; rgsabound[0].lLbound = 0; rgsabound[0].cElements = count; if ((pSA = SafeArrayCreate(VT_VARIANT, 1, rgsabound)) == NULL) { VariantInit(var_result); return FAILURE; } else { V_ARRAY(var_result) = pSA; V_VT(var_result) = VT_VARIANT|VT_ARRAY; } /* blah*/ } else if (C_HASENUM(obj) && strstr(Z_STRVAL_P(function_name), "reset")) { if (FAILED(hr = C_ENUMVARIANT_VT(obj)->Reset(C_ENUMVARIANT(obj)))) { char *error_message = php_COM_error_message(hr TSRMLS_CC); php_error(E_WARNING,"%s(): IEnumVariant::Next() failed: %s", get_active_function_name(TSRMLS_C), error_message); efree(error_message); return FAILURE; } return SUCCESS; } else if (C_HASENUM(obj) && strstr(Z_STRVAL_P(function_name), "skip")) { unsigned long count; switch (arg_count) { case 0: count = 1; break; case 1: convert_to_long_ex(&arguments[0]); count = Z_LVAL_P(arguments[0]); break; default: php_error(E_WARNING, "%s(): Wrong argument count to IEnumVariant::Skip()", get_active_function_name(TSRMLS_C)); return FAILURE; } if (FAILED(hr = C_ENUMVARIANT_VT(obj)->Skip(C_ENUMVARIANT(obj), count))) { char *error_message = php_COM_error_message(hr TSRMLS_CC); php_error(E_WARNING,"%s(): IEnumVariant::Next() failed: %s", get_active_function_name(TSRMLS_C), error_message); efree(error_message); return FAILURE; } return SUCCESS; } else { char *ErrString; funcname = php_char_to_OLECHAR(Z_STRVAL_P(function_name), Z_STRLEN_P(function_name), codepage TSRMLS_CC); hr = php_COM_get_ids_of_names(obj, &funcname, &dispid TSRMLS_CC); if (FAILED(hr)) { error_message = php_COM_error_message(hr TSRMLS_CC); php_error(E_WARNING, "%s(): Unable to lookup %s: %s", get_active_function_name(TSRMLS_C), Z_STRVAL_P(function_name), error_message); LocalFree(error_message); efree(funcname); return FAILURE; } variant_args = (VARIANT *) emalloc(sizeof(VARIANT) * arg_count); for (current_arg=0; current_argIDispatch */ VariantClear(&variant_args[current_arg]); } } efree(variant_args); if (FAILED(hr)) { error_message = php_COM_error_message(hr TSRMLS_CC); if (ErrString) { php_error(E_WARNING, "%s(): Invoke() failed: %s %s", get_active_function_name(TSRMLS_C), error_message, ErrString); pefree(ErrString, 1); } else { php_error(E_WARNING, "%s(): Invoke() failed: %s", get_active_function_name(TSRMLS_C), error_message); } LocalFree(error_message); return FAILURE; } } return SUCCESS; } /* {{{ proto mixed com_invoke_ex(int module, int invokeflags, string handler_name [, mixed arg [, mixed ...]]) Invokes a COM module */ PHP_FUNCTION(com_invoke_ex) { pval **arguments; pval *object, *function_name, *invokeflags; comval *obj = NULL; WORD dispflags = 0; int arg_count = ZEND_NUM_ARGS(); VARIANT *var_result; if (arg_count<3) { ZEND_WRONG_PARAM_COUNT(); } arguments = (pval **) emalloc(sizeof(pval *)*arg_count); if (zend_get_parameters_array(ht, arg_count, arguments) == FAILURE) { RETURN_NULL(); } object = arguments[0]; function_name = arguments[2]; invokeflags = arguments[1]; /* obtain property/method handler */ convert_to_string_ex(&function_name); convert_to_long(invokeflags); dispflags = (WORD)Z_LVAL_P(invokeflags); /* obtain IDispatch interface */ FETCH_COM_SAFE(object, obj); ALLOC_VARIANT(var_result); if (do_COM_invoke(obj, dispflags, function_name, var_result, arguments+3, arg_count-3 TSRMLS_CC)==FAILURE) { FREE_VARIANT(var_result); efree(arguments); RETURN_NULL(); } RETVAL_VARIANT(var_result); efree(arguments); } /* }}} */ /* {{{ proto mixed com_invoke(int module, string handler_name [, mixed arg [, mixed ...]]) Invokes a COM module */ PHP_FUNCTION(com_invoke) { pval **arguments; pval *object, *function_name; comval *obj; int arg_count = ZEND_NUM_ARGS(); VARIANT *var_result; if (arg_count<2) { ZEND_WRONG_PARAM_COUNT(); } arguments = (pval **) emalloc(sizeof(pval *)*arg_count); if (zend_get_parameters_array(ht, arg_count, arguments) == FAILURE) { RETURN_NULL(); } object = arguments[0]; function_name = arguments[1]; /* obtain IDispatch interface */ FETCH_COM_SAFE(object, obj); /* obtain property/method handler */ convert_to_string_ex(&function_name); ALLOC_VARIANT(var_result); if (do_COM_invoke(obj, DISPATCH_METHOD|DISPATCH_PROPERTYGET, function_name, var_result, arguments+2, arg_count-2 TSRMLS_CC)==FAILURE) { FREE_VARIANT(var_result); efree(arguments); RETURN_NULL(); } RETVAL_VARIANT(var_result); efree(arguments); } /* }}} */ /* {{{ proto mixed com_release(int module) Releases a COM object */ PHP_FUNCTION(com_release) { pval *object; comval *obj; int arg_count = ZEND_NUM_ARGS(); if (arg_count != 1) { ZEND_WRONG_PARAM_COUNT(); } if (zend_get_parameters(ht, 1, &object)==FAILURE) { RETURN_FALSE; } /* obtain IDispatch interface */ FETCH_COM_SAFE(object, obj); RETURN_LONG(php_COM_release(obj TSRMLS_CC)) } /* }}} */ /* {{{ proto mixed com_addref(int module) Increases the reference counter on a COM object */ PHP_FUNCTION(com_addref) { pval *object; comval *obj; int arg_count = ZEND_NUM_ARGS(); if (arg_count != 1) { ZEND_WRONG_PARAM_COUNT(); } if (zend_get_parameters(ht, 1, &object)==FAILURE) { RETURN_FALSE; } /* obtain IDispatch interface */ FETCH_COM_SAFE(object, obj); RETURN_LONG(php_COM_addref(obj TSRMLS_CC)); } /* }}} */ /* {{{ 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; 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; } } /* }}} */ static int com_enable_events(comval *obj, int enable) { if (obj->sinkdispatch) { IConnectionPointContainer *cont; IConnectionPoint *point; if (SUCCEEDED(C_DISPATCH_VT(obj)->QueryInterface(C_DISPATCH(obj), &IID_IConnectionPointContainer, (void**)&cont))) { if (SUCCEEDED(cont->lpVtbl->FindConnectionPoint(cont, &obj->sinkid, &point))) { if (enable) { point->lpVtbl->Advise(point, (IUnknown*)obj->sinkdispatch, &obj->sinkcookie); } else { point->lpVtbl->Unadvise(point, obj->sinkcookie); } point->lpVtbl->Release(point); } cont->lpVtbl->Release(cont); } } return 0; } 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" }, { 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 int process_typeinfo(ITypeInfo *typeinfo, HashTable *id_to_name, int printdef, GUID *guid TSRMLS_DC) { TYPEATTR *attr; FUNCDESC *func; int i; OLECHAR *olename; char *ansiname = NULL; unsigned int ansinamelen; int ret = 0; if (FAILED(typeinfo->lpVtbl->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; typeinfo->lpVtbl->GetDocumentation(typeinfo, MEMBERID_NIL, &olename, NULL, NULL, NULL); ansiname = php_OLECHAR_to_char(olename, &ansinamelen, codepage TSRMLS_CC); SysFreeString(olename); guidstring = php_string_from_clsid(&attr->guid 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(typeinfo->lpVtbl->GetFuncDesc(typeinfo, i, &func))) break; isprop = (func->invkind & DISPATCH_PROPERTYGET || func->invkind & DISPATCH_PROPERTYPUT); if (!isprop || lastid != func->memid) { lastid = func->memid; typeinfo->lpVtbl->GetDocumentation(typeinfo, func->memid, &olename, NULL, NULL, NULL); ansiname = php_OLECHAR_to_char(olename, &ansinamelen, codepage TSRMLS_CC); SysFreeString(olename); if (printdef) { int j; char *funcdesc; unsigned int funcdesclen, cnames = 0; BSTR *names; names = (BSTR*)emalloc((func->cParams + 1) * sizeof(BSTR)); typeinfo->lpVtbl->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) { typeinfo->lpVtbl->GetDocumentation(typeinfo, func->memid, NULL, &olename, NULL, NULL); if (olename) { funcdesc = php_OLECHAR_to_char(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_OLECHAR_to_char(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"); typeinfo->lpVtbl->GetDocumentation(typeinfo, func->memid, NULL, &olename, NULL, NULL); if (olename) { funcdesc = php_OLECHAR_to_char(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); } } typeinfo->lpVtbl->ReleaseFuncDesc(typeinfo, func); } if (printdef) php_printf("}\n"); ret = 1; } else { zend_error(E_WARNING, "Thats not a dispatchable interface!! type kind = %08x", attr->typekind); } typeinfo->lpVtbl->ReleaseTypeAttr(typeinfo, attr); return ret; } static ITypeInfo *locate_typeinfo(char *typelibname, comval *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(C_DISPATCH_VT(obj)->QueryInterface(C_DISPATCH(obj), &IID_IProvideClassInfo2, (void**)&pci2))) { gotguid = SUCCEEDED(pci2->lpVtbl->GetGUID(pci2, GUIDKIND_DEFAULT_SOURCE_DISP_IID, &iid)); pci2->lpVtbl->Release(pci2); } if (!gotguid && SUCCEEDED(C_DISPATCH_VT(obj)->QueryInterface(C_DISPATCH(obj), &IID_IProvideClassInfo, (void**)&pci))) { /* examine the available interfaces */ /* TODO: write some code here */ pci->lpVtbl->Release(pci); } } else if (dispname && C_HASTLIB(obj)) { unsigned int idx; /* get the library from the object; the rest will be dealt with later */ C_TYPEINFO_VT(obj)->GetContainingTypeLib(C_TYPEINFO(obj), &typelib, &idx); } else if (typelibname == NULL) { C_DISPATCH_VT(obj)->GetTypeInfo(C_DISPATCH(obj), 0, LANG_NEUTRAL, &typeinfo); } } else if (typelibname) { /* Fetch the typelibrary and use that to look things up */ typelib = php_COM_find_typelib(typelibname, CONST_CS TSRMLS_CC); } if (!gotguid && dispname && typelib) { unsigned short cfound; MEMBERID memid; OLECHAR *olename = php_char_to_OLECHAR(dispname, strlen(dispname), CP_ACP TSRMLS_CC); cfound = 1; if (FAILED(typelib->lpVtbl->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(typelib->lpVtbl->GetTypeInfoOfGuid(typelib, &coclass, &coinfo))) { /* enumerate implemented interfaces and pick the one as indicated by sink */ TYPEATTR *attr; int i; coinfo->lpVtbl->GetTypeAttr(coinfo, &attr); for (i = 0; i < attr->cImplTypes; i++) { HREFTYPE rt; int tf; if (FAILED(coinfo->lpVtbl->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(coinfo->lpVtbl->GetRefTypeOfImplType(coinfo, i, &rt))) if (SUCCEEDED(coinfo->lpVtbl->GetRefTypeInfo(coinfo, rt, &typeinfo))) break; } } coinfo->lpVtbl->ReleaseTypeAttr(coinfo, attr); coinfo->lpVtbl->Release(coinfo); } } efree(olename); } else if (gotguid) { typelib->lpVtbl->GetTypeInfoOfGuid(typelib, &iid, &typeinfo); } if (typelib) typelib->lpVtbl->Release(typelib); return typeinfo; } /* {{{ proto bool com_print_typeinfo(mixed 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; comval *obj = NULL; ITypeInfo *typeinfo; if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/s!b", &arg1, &ifacename, &ifacelen, &wantsink)) { RETURN_FALSE; } if (Z_TYPE_P(arg1) == IS_OBJECT) { FETCH_COM_SAFE(arg1, obj); } else { convert_to_string(arg1); typelibname = Z_STRVAL_P(arg1); } typeinfo = locate_typeinfo(typelibname, obj, ifacename, wantsink TSRMLS_CC); if (typeinfo) { process_typeinfo(typeinfo, NULL, 1, NULL TSRMLS_CC); typeinfo->lpVtbl->Release(typeinfo); RETURN_TRUE; } else { zend_error(E_WARNING, "Unable to find typeinfo using the parameters supplied"); } RETURN_FALSE; } /* }}} */ /* {{{ proto bool com_event_sink(mixed 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; comval *obj; ITypeInfo *typeinfo = NULL; RETVAL_FALSE; if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz|z/", &object, &sinkobject, &sink)) { RETURN_FALSE; } FETCH_COM_SAFE(object, obj); 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 = locate_typeinfo(typelibname, obj, dispname, 1 TSRMLS_CC); if (typeinfo) { HashTable *id_to_name; ALLOC_HASHTABLE(id_to_name); if (process_typeinfo(typeinfo, id_to_name, 0, &obj->sinkid TSRMLS_CC)) { /* Create the COM wrapper for this sink */ obj->sinkdispatch = php_COM_export_as_sink(sinkobject, &obj->sinkid, id_to_name TSRMLS_CC); /* Now hook it up to the source */ com_enable_events(obj, TRUE); RETVAL_TRUE; } else { FREE_HASHTABLE(id_to_name); } } if (typeinfo) typeinfo->lpVtbl->Release(typeinfo); } /* }}} */ static int do_COM_offget(VARIANT *result, comval *array, pval *property, int cleanup TSRMLS_DC) { pval function_name; int retval; ZVAL_STRINGL(&function_name, "Item", 4, 0); retval = do_COM_invoke(array, DISPATCH_METHOD|DISPATCH_PROPERTYGET, &function_name, result, &property, 1 TSRMLS_CC); if (cleanup) { php_COM_destruct(array TSRMLS_CC); } return retval; } static int do_COM_propget(VARIANT *var_result, comval *obj, pval *arg_property, int cleanup TSRMLS_DC) { DISPID dispid; HRESULT hr; OLECHAR *propname; char *error_message; DISPPARAMS dispparams; char *ErrString; /* obtain property handler */ propname = php_char_to_OLECHAR(Z_STRVAL_P(arg_property), Z_STRLEN_P(arg_property), codepage TSRMLS_CC); hr = php_COM_get_ids_of_names(obj, &propname, &dispid TSRMLS_CC); if (FAILED(hr)) { error_message = php_COM_error_message(hr TSRMLS_CC); php_error(E_WARNING, "%s(): Unable to lookup %s: %s", get_active_function_name(TSRMLS_C), Z_STRVAL_P(arg_property), error_message); LocalFree(error_message); efree(propname); if (cleanup) { php_COM_destruct(obj TSRMLS_CC); } return FAILURE; } dispparams.cArgs = 0; dispparams.cNamedArgs = 0; hr = php_COM_invoke(obj, dispid, DISPATCH_PROPERTYGET, &dispparams, var_result, &ErrString TSRMLS_CC); if (FAILED(hr)) { error_message = php_COM_error_message(hr TSRMLS_CC); if (ErrString) { php_error(E_WARNING, "%s(): PropGet() failed: %s %s", get_active_function_name(TSRMLS_C), error_message, ErrString); pefree(ErrString, 1); } else { php_error(E_WARNING, "%s(): PropGet() failed: %s", get_active_function_name(TSRMLS_C), error_message); } LocalFree(error_message); efree(propname); if (cleanup) { php_COM_destruct(obj TSRMLS_CC); } return FAILURE; } efree(propname); if (cleanup) { php_COM_destruct(obj TSRMLS_CC); } return SUCCESS; } static void do_COM_propput(pval *return_value, comval *obj, pval *arg_property, pval *value TSRMLS_DC) { DISPID dispid; HRESULT hr; OLECHAR *propname; char *error_message; VARIANT *var_result, *new_value; DISPPARAMS dispparams; DISPID mydispid = DISPID_PROPERTYPUT; char *ErrString; ALLOC_VARIANT(var_result); ALLOC_VARIANT(new_value); /* obtain property handler */ propname = php_char_to_OLECHAR(Z_STRVAL_P(arg_property), Z_STRLEN_P(arg_property), codepage TSRMLS_CC); hr = php_COM_get_ids_of_names(obj, &propname, &dispid TSRMLS_CC); if (FAILED(hr)) { error_message = php_COM_error_message(hr TSRMLS_CC); php_error(E_WARNING, "%s(): Unable to lookup %s: %s", get_active_function_name(TSRMLS_C), Z_STRVAL_P(arg_property), error_message); LocalFree(error_message); efree(propname); FREE_VARIANT(var_result); FREE_VARIANT(new_value); if (return_value) { RETVAL_NULL(); } return; } php_pval_to_variant(value, new_value, codepage TSRMLS_CC); dispparams.rgvarg = new_value; dispparams.rgdispidNamedArgs = &mydispid; dispparams.cArgs = 1; dispparams.cNamedArgs = 1; hr = php_COM_invoke(obj, dispid, DISPATCH_PROPERTYPUT, &dispparams, NULL, &ErrString TSRMLS_CC); if (FAILED(hr)) { error_message = php_COM_error_message(hr TSRMLS_CC); if (ErrString) { php_error(E_WARNING, "%s(): PropPut() failed: %s %s", get_active_function_name(TSRMLS_C), error_message, ErrString); pefree(ErrString, 1); } else { php_error(E_WARNING, "%s(): PropPut() failed: %s", get_active_function_name(TSRMLS_C), error_message); } LocalFree(error_message); FREE_VARIANT(var_result); /* free the string we allocated; invoked object made its own copy */ if (V_VT(new_value) == VT_BSTR) { VariantClear(new_value); } efree(new_value); efree(propname); if (return_value) { RETVAL_NULL(); } return; } if (return_value) { dispparams.cArgs = 0; dispparams.cNamedArgs = 0; hr = php_COM_invoke(obj, dispid, DISPATCH_PROPERTYGET, &dispparams, var_result, &ErrString TSRMLS_CC); if (SUCCEEDED(hr)) { RETVAL_VARIANT(var_result); } else { FREE_VARIANT(var_result); *return_value = *value; zval_copy_ctor(return_value); } if (ErrString) { pefree(ErrString, 1); } } else { FREE_VARIANT(var_result); } /* free the string we allocated; invoked object made its own copy */ if (V_VT(new_value) == VT_BSTR) { VariantClear(new_value); } efree(new_value); efree(propname); } /* {{{ proto mixed com_propget(int module, string property_name [, mixed arg ... ]) Gets properties from a COM module */ PHP_FUNCTION(com_propget) { zval **arguments; zval *object, *function_name; comval *obj = NULL; int arg_count = ZEND_NUM_ARGS(); VARIANT *var_result; if (arg_count < 2) { ZEND_WRONG_PARAM_COUNT(); } arguments = (zval **) emalloc(sizeof(pval *)*arg_count); if (zend_get_parameters_array(ht, arg_count, arguments) == FAILURE) { RETURN_NULL(); } object = arguments[0]; function_name = arguments[1]; FETCH_COM_SAFE(object, obj); /* obtain property/method handler */ convert_to_string_ex(&function_name); ALLOC_VARIANT(var_result); if (do_COM_invoke(obj, DISPATCH_PROPERTYGET, function_name, var_result, arguments+2, arg_count-2 TSRMLS_CC)==FAILURE) { FREE_VARIANT(var_result); efree(arguments); RETURN_NULL(); } RETVAL_VARIANT(var_result); efree(arguments); } /* }}} */ /* {{{ proto bool com_propput(int module, string property_name, mixed value, ...) Puts the properties for a module */ PHP_FUNCTION(com_propput) { zval **arguments; zval *object, *function_name; comval *obj; int arg_count = ZEND_NUM_ARGS(); VARIANT *var_result; if (arg_count<3) { ZEND_WRONG_PARAM_COUNT(); } arguments = (zval **) emalloc(sizeof(pval *)*arg_count); if (zend_get_parameters_array(ht, arg_count, arguments) == FAILURE) { RETURN_NULL(); } object = arguments[0]; function_name = arguments[1]; FETCH_COM_SAFE(object, obj); /* obtain property/method handler */ convert_to_string_ex(&function_name); ALLOC_VARIANT(var_result); if (do_COM_invoke(obj, DISPATCH_PROPERTYPUT, function_name, var_result, arguments+2, arg_count-2 TSRMLS_CC)==FAILURE) { FREE_VARIANT(var_result); efree(arguments); RETURN_NULL(); } RETVAL_VARIANT(var_result); efree(arguments); } /* }}} */ /* {{{ proto bool com_load_typelib(string typelib_name [, int case_insensitive]) Loads a Typelib */ PHP_FUNCTION(com_load_typelib) { pval *arg_typelib, *arg_cis; ITypeLib *pTL; int mode = CONST_CS; switch (ZEND_NUM_ARGS()) { case 1: zend_get_parameters(ht, 1, &arg_typelib); break; case 2: zend_get_parameters(ht, 2, &arg_typelib, &arg_cis); convert_to_boolean_ex(&arg_cis); if (Z_LVAL_P(arg_cis)) { mode &= ~CONST_CS; } break; default: ZEND_WRONG_PARAM_COUNT(); } convert_to_string_ex(&arg_typelib); pTL = php_COM_find_typelib(Z_STRVAL_P(arg_typelib), mode TSRMLS_CC); if (php_COM_load_typelib(pTL, mode TSRMLS_CC) == SUCCESS) { pTL->lpVtbl->Release(pTL); RETURN_TRUE; } else { RETURN_FALSE; } } /* }}} */ PHPAPI pval php_COM_get_property_handler(zend_property_reference *property_reference) { zend_overloaded_element *overloaded_property; zend_llist_element *element; pval retval; pval **comval_handle; pval *object = property_reference->object; int type; comval *obj, *obj_prop; VARIANT *var_result; TSRMLS_FETCH(); INIT_ZVAL(retval); ZVAL_NULL(&retval); /* fetch the IDispatch interface */ zend_hash_index_find(Z_OBJPROP_P(object), 0, (void **) &comval_handle); obj = (comval *) zend_list_find(Z_LVAL_P(*comval_handle), &type); if (!obj || (type != IS_COM)) { return retval; } ALLOC_COM(obj_prop); ALLOC_VARIANT(var_result); for (element=property_reference->elements_list->head; element; element=element->next) { overloaded_property = (zend_overloaded_element *) element->data; switch (Z_TYPE_P(overloaded_property)) { case OE_IS_ARRAY: if (do_COM_offget(var_result, obj, &overloaded_property->element, FALSE TSRMLS_CC) == FAILURE) { FREE_VARIANT(var_result); FREE_COM(obj_prop); return retval; } break; case OE_IS_OBJECT: if (do_COM_propget(var_result, obj, &overloaded_property->element, FALSE TSRMLS_CC) == FAILURE) { FREE_VARIANT(var_result); FREE_COM(obj_prop); return retval; } break; case OE_IS_METHOD: FREE_VARIANT(var_result); if (obj != obj_prop) { efree(obj_prop); retval = *object; zval_copy_ctor(&retval); } else { ZVAL_COM(&retval, obj); } return retval; } zval_dtor(&overloaded_property->element); if (V_VT(var_result) == VT_DISPATCH) { if (V_DISPATCH(var_result) == NULL) { FREE_VARIANT(var_result); FREE_COM(obj_prop); return retval; } obj = obj_prop; php_COM_set(obj, &V_DISPATCH(var_result), TRUE TSRMLS_CC); VariantInit(var_result); /* to protect C_DISPATCH(obj) from being freed when var_result is destructed */ } else { php_variant_to_pval(var_result, &retval, codepage TSRMLS_CC); FREE_COM(obj_prop); obj_prop = NULL; } } if (obj_prop != NULL) { ZVAL_COM(&retval, obj); } FREE_VARIANT(var_result); return retval; } PHPAPI int php_COM_set_property_handler(zend_property_reference *property_reference, pval *value) { zend_overloaded_element *overloaded_property; zend_llist_element *element; pval **comval_handle; pval *object = property_reference->object; comval *obj, *obj_prop; int type; VARIANT *var_result; TSRMLS_FETCH(); /* fetch the IDispatch interface */ zend_hash_index_find(Z_OBJPROP_P(object), 0, (void **) &comval_handle); obj = (comval *)zend_list_find(Z_LVAL_P(*comval_handle), &type); if (!obj || (type != IS_COM)) { return FAILURE; } ALLOC_COM(obj_prop); ALLOC_VARIANT(var_result); for (element=property_reference->elements_list->head; element != property_reference->elements_list->tail; element=element->next) { overloaded_property = (zend_overloaded_element *) element->data; switch (Z_TYPE_P(overloaded_property)) { case OE_IS_ARRAY: if (do_COM_offget(var_result, obj, &overloaded_property->element, FALSE TSRMLS_CC) == FAILURE) { FREE_VARIANT(var_result); FREE_COM(obj_prop); return FAILURE; } break; case OE_IS_OBJECT: if (do_COM_propget(var_result, obj, &overloaded_property->element, FALSE TSRMLS_CC) == FAILURE) { FREE_VARIANT(var_result); FREE_COM(obj_prop); return FAILURE; } break; case OE_IS_METHOD: /* this shouldn't happen */ return FAILURE; break; } if (V_VT(var_result) == VT_DISPATCH) { if (V_DISPATCH(var_result) == NULL) { FREE_VARIANT(var_result); FREE_COM(obj_prop); return FAILURE; } obj = obj_prop; php_COM_set(obj, &V_DISPATCH(var_result), TRUE TSRMLS_CC); } else { FREE_COM(obj_prop); FREE_VARIANT(var_result); return FAILURE; } VariantInit(var_result); /* to protect C_DISPATCH(obj) from being freed when var_result is destructed */ zval_dtor(&overloaded_property->element); } FREE_VARIANT(var_result); overloaded_property = (zend_overloaded_element *) element->data; do_COM_propput(NULL, obj, &overloaded_property->element, value TSRMLS_CC); FREE_COM(obj_prop); zval_dtor(&overloaded_property->element); return SUCCESS; } /* create an overloaded COM object from a dispatch pointer */ PHPAPI zval *php_COM_object_from_dispatch(IDispatch *disp, zval *val TSRMLS_DC) { comval *obj; zval *zobj; ALLOC_COM(obj); MAKE_STD_ZVAL(zobj); php_COM_set(obj, &disp, FALSE TSRMLS_CC); ZVAL_COM_EX(zobj, obj, val); return zobj; } PHPAPI void php_COM_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_property_reference *property_reference) { pval property, **handle; pval *object = property_reference->object; zend_overloaded_element *function_name = (zend_overloaded_element *) property_reference->elements_list->tail->data; comval *obj; int type; if (zend_llist_count(property_reference->elements_list)==1 && !strcmp(Z_STRVAL(function_name->element), "com")) { zval *tmp; /* constructor */ PHP_FN(com_load)(INTERNAL_FUNCTION_PARAM_PASSTHRU); zend_hash_index_find(Z_OBJPROP_P(return_value), 0, (void**)&handle); zend_list_addref(Z_RESVAL_PP(handle)); MAKE_STD_ZVAL(tmp); ZVAL_RESOURCE(tmp, Z_RESVAL_PP(handle)); zend_hash_index_update(Z_OBJPROP_P(object), 0, &tmp, sizeof(tmp), NULL); zval_dtor(&function_name->element); return; } RETVAL_NULL(); property = php_COM_get_property_handler(property_reference); if (Z_TYPE(property) != IS_OBJECT) { zval_dtor(&property); zval_dtor(&function_name->element); /* error message - function call on a non-object */ return; } zend_hash_index_find(Z_OBJPROP(property), 0, (void **) &handle); obj = (comval *)zend_list_find(Z_LVAL_PP(handle), &type); if (!obj || (type != IS_COM)) { zval_dtor(&property); zval_dtor(&function_name->element); return; } if (zend_llist_count(property_reference->elements_list)==1 && !strcmp(Z_STRVAL_P(&function_name->element), "release")) { RETVAL_LONG(php_COM_release(obj TSRMLS_CC)); } else if (zend_llist_count(property_reference->elements_list)==1 && !strcmp(Z_STRVAL_P(&function_name->element), "addref")) { RETVAL_LONG(php_COM_addref(obj TSRMLS_CC)); } else { pval **arguments; VARIANT *var_result; int arg_count = ZEND_NUM_ARGS(); ALLOC_VARIANT(var_result); arguments = (zval **) emalloc(sizeof(zval *)*arg_count); zend_get_parameters_array(ht, arg_count, arguments); if (do_COM_invoke(obj , DISPATCH_METHOD|DISPATCH_PROPERTYGET, &function_name->element, var_result, arguments, arg_count TSRMLS_CC) == SUCCESS) { RETVAL_VARIANT(var_result); } else { FREE_VARIANT(var_result); } efree(arguments); } zval_dtor(&property); zval_dtor(&function_name->element); } static ITypeLib *php_COM_find_typelib(char *search_string, int mode TSRMLS_DC) { ITypeLib *TypeLib = NULL; char *strtok_buf, *major, *minor; CLSID clsid; OLECHAR *p; /* Type Libraries: * The string we have is 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" * Searching for the name will be more expensive that the * other two, so we will do that when both other attempts * fail. */ 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_char_to_OLECHAR(search_string, strlen(search_string), codepage TSRMLS_CC); /* Is the string a GUID ? */ if (!FAILED(CLSIDFromString(p, &clsid))) { HRESULT hr; WORD major_i = 1; WORD minor_i = 0; /* We have a valid GUID, check to see if a major/minor */ /* version was specified otherwise assume 1,0 */ if ((major != NULL) && (minor != NULL)) { major_i = (WORD) atoi(major); minor_i = (WORD) atoi(minor); } /* The GUID will either be a typelibrary or a CLSID */ hr = LoadRegTypeLib((REFGUID) &clsid, major_i, minor_i, LANG_NEUTRAL, &TypeLib); /* If the LoadRegTypeLib fails, let's try to instantiate */ /* the class itself and then QI for the TypeInfo and */ /* retrieve the type info from that interface */ if (FAILED(hr) && (!major || !minor)) { IDispatch *Dispatch; ITypeInfo *TypeInfo; int idx; if (FAILED(CoCreateInstance(&clsid, NULL, CLSCTX_SERVER, &IID_IDispatch, (LPVOID *) &Dispatch))) { efree(p); return NULL; } if (FAILED(Dispatch->lpVtbl->GetTypeInfo(Dispatch, 0, LANG_NEUTRAL, &TypeInfo))) { Dispatch->lpVtbl->Release(Dispatch); efree(p); return NULL; } Dispatch->lpVtbl->Release(Dispatch); if (FAILED(TypeInfo->lpVtbl->GetContainingTypeLib(TypeInfo, &TypeLib, &idx))) { TypeInfo->lpVtbl->Release(TypeInfo); efree(p); return NULL; } TypeInfo->lpVtbl->Release(TypeInfo); } } else { if (FAILED(LoadTypeLib(p, &TypeLib))) { /* Walk HKCR/TypeLib looking for the string */ /* If that succeeds, call ourself recursively */ /* using the CLSID found, else give up and bail */ HKEY hkey, hsubkey; DWORD SubKeys, MaxSubKeyLength; char *keyname; register unsigned int ii, jj; DWORD VersionCount; char version[20]; /* All the version keys are 1.0, 4.6, ... */ char *libname; DWORD libnamelen; /* No Need for Unicode version any more */ efree(p); /* Starting at HKEY_CLASSES_ROOT/TypeLib */ /* Walk all subkeys (Typelib GUIDs) looking */ /* at each version for a string match to the */ /* supplied argument */ if (ERROR_SUCCESS != RegOpenKey(HKEY_CLASSES_ROOT, "TypeLib",&hkey)) { /* This is pretty bad - better bail */ return NULL; } if (ERROR_SUCCESS != RegQueryInfoKey(hkey, NULL, NULL, NULL, &SubKeys, &MaxSubKeyLength, NULL, NULL, NULL, NULL, NULL, NULL)) { RegCloseKey(hkey); return NULL; } MaxSubKeyLength++; /* \0 is not counted */ keyname = emalloc(MaxSubKeyLength); libname = emalloc(strlen(search_string)+1); for (ii=0;iimemid, &bstr_ids, 1, &NameCount); if (NameCount != 1) { ITypeInfo_ReleaseVarDesc(TypeInfo, pVarDesc); continue; } const_name = php_OLECHAR_to_char(bstr_ids, &c.name_len, codepage TSRMLS_CC); c.name = zend_strndup(const_name, c.name_len); efree(const_name); c.name_len++; /* length should include the NULL */ SysFreeString(bstr_ids); /* Before registering the contsnt, let's see if we can find it */ if (zend_get_constant(c.name, c.name_len - 1, &exists TSRMLS_CC)) { /* Oops, it already exists. No problem if it is defined as the same value */ /* Check to see if they are the same */ if (!compare_function(&results, &c.value, &exists TSRMLS_CC) && INI_INT("com.autoregister_verbose")) { php_error(E_WARNING, "%s(): Type library value %s is already defined and has a different value", get_active_function_name(TSRMLS_C), c.name); } free(c.name); ITypeInfo_ReleaseVarDesc(TypeInfo, pVarDesc); continue; } php_variant_to_pval(pVarDesc->lpvarValue, &value, codepage TSRMLS_CC); /* we only import enumerations (=int) */ 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; /* the module number is not available here */ zend_register_constant(&c TSRMLS_CC); } ITypeInfo_ReleaseVarDesc(TypeInfo, pVarDesc); } ITypeInfo_Release(TypeInfo); } } return SUCCESS; } /* {{{ proto bool com_isenum(object com_module) Grabs an IEnumVariant */ PHP_FUNCTION(com_isenum) { pval *object; comval *obj; if (ZEND_NUM_ARGS() != 1) { ZEND_WRONG_PARAM_COUNT(); } zend_get_parameters(ht, 1, &object); /* obtain IDispatch interface */ FETCH_COM_SAFE(object, obj); RETURN_BOOL(C_HASENUM(obj)); } /* }}} */ static void php_register_COM_class(TSRMLS_D) { INIT_OVERLOADED_CLASS_ENTRY(COM_class_entry, "COM", NULL, php_COM_call_function_handler, php_COM_get_property_handler, php_COM_set_property_handler); zend_register_internal_class(&COM_class_entry TSRMLS_CC); } static void php_COM_init(int module_number TSRMLS_DC) { le_comval = zend_register_list_destructors_ex(php_comval_destructor, NULL, "COM", module_number); php_register_COM_class(TSRMLS_C); } PHPAPI ZEND_DECLARE_MODULE_GLOBALS(com) static void php_com_init_globals(zend_com_globals *com_globals) { } PHP_MINIT_FUNCTION(COM) { ZEND_INIT_MODULE_GLOBALS(com, php_com_init_globals, NULL); php_COM_init(module_number TSRMLS_CC); php_VARIANT_init(module_number TSRMLS_CC); php_COM_dispatch_init(module_number TSRMLS_CC); REGISTER_LONG_CONSTANT("CLSCTX_INPROC_SERVER", CLSCTX_INPROC_SERVER, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("CLSCTX_INPROC_HANDLER", CLSCTX_INPROC_HANDLER, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("CLSCTX_LOCAL_SERVER", CLSCTX_LOCAL_SERVER, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("CLSCTX_REMOTE_SERVER", CLSCTX_REMOTE_SERVER, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("CLSCTX_SERVER", CLSCTX_SERVER, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("CLSCTX_ALL", CLSCTX_ALL, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("DISPATCH_METHOD", DISPATCH_METHOD, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("DISPATCH_PROPERTYGET", DISPATCH_PROPERTYGET, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("DISPATCH_PROPERTYPUT", DISPATCH_PROPERTYPUT, CONST_CS | CONST_PERSISTENT); REGISTER_INI_ENTRIES(); return SUCCESS; } PHP_MSHUTDOWN_FUNCTION(COM) { UNREGISTER_INI_ENTRIES(); return SUCCESS; } /* exports for external object creation */ zend_module_entry COM_module_entry = { STANDARD_MODULE_HEADER, "com", COM_functions, PHP_MINIT(COM), PHP_MSHUTDOWN(COM), NULL, NULL, PHP_MINFO(COM), NO_VERSION_YET, STANDARD_MODULE_PROPERTIES }; PHPAPI int php_COM_get_le_comval() { return le_comval; } #endif /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * indent-tabs-mode: t * End: */ php-4.4.8/ext/com/com.h0000644000175000017500000000465307626462274014136 0ustar derickderick#ifndef COM_H #define COM_H #if PHP_WIN32 BEGIN_EXTERN_C() #include typedef struct comval_ { #ifdef _DEBUG int resourceindex; #endif BOOL typelib; BOOL enumeration; int refcount; struct { IDispatch *dispatch; ITypeInfo *typeinfo; IEnumVARIANT *enumvariant; } i; IDispatch *sinkdispatch; GUID sinkid; DWORD sinkcookie; } comval; END_EXTERN_C() #define ZVAL_COM(z,o) { \ zval *handle = NULL; \ ZVAL_COM_EX(z,o,handle) \ } #define ZVAL_COM_EX(z,o,handle) { \ HashTable *properties; \ \ ALLOC_HASHTABLE(properties); \ zend_hash_init(properties, 0, NULL, ZVAL_PTR_DTOR, 0); \ \ if (handle == NULL) { \ MAKE_STD_ZVAL(handle); \ } \ ZVAL_RESOURCE(handle, zend_list_insert((o), IS_COM)); \ \ zend_hash_index_update(properties, 0, &handle, sizeof(zval *), NULL); \ object_and_properties_init(z, &COM_class_entry, properties); \ (z)->is_ref=1; \ } #define RETVAL_COM(o) ZVAL_COM(return_value, o); #define RETURN_COM(o) RETVAL_COM(o) \ return; #define ALLOC_COM(z) (z) = (comval *) ecalloc(1, sizeof(comval)); #define FREE_COM(z) php_COM_destruct(z TSRMLS_CC); #define FETCH_COM(z, obj) { \ zval **tmp; \ zend_hash_index_find(Z_OBJPROP_P(z), 0, (void**)&tmp); \ ZEND_FETCH_RESOURCE(obj, comval*, tmp, -1, "comval", IS_COM); \ } \ if (obj == NULL) { \ php_error(E_WARNING, "%d is not a COM object handler", Z_LVAL_P(z)); \ RETURN_NULL(); \ } #define FETCH_COM_SAFE(z, obj) \ if ((Z_TYPE_P(z) == IS_OBJECT) && (Z_OBJCE_P(z) == &COM_class_entry)) \ FETCH_COM(z, obj) #define IS_COM php_COM_get_le_comval() #define C_HASTLIB(x) ((x)->typelib) #define C_HASENUM(x) ((x)->enumeration) #define C_REFCOUNT(x) ((x)->refcount) #define C_ISREFD(x) C_REFCOUNT(x) #define C_ADDREF(x) (++((x)->refcount)) #define C_RELEASE(x) (--((x)->refcount)) #define C_DISPATCH(x) ((x)->i.dispatch) #define C_TYPEINFO(x) ((x)->i.typeinfo) #define C_ENUMVARIANT(x) ((x)->i.enumvariant) #define C_DISPATCH_VT(x) (C_DISPATCH(x)->lpVtbl) #define C_TYPEINFO_VT(x) (C_TYPEINFO(x)->lpVtbl) #define C_ENUMVARIANT_VT(x) (C_ENUMVARIANT(x)->lpVtbl) #endif /* PHP_WIN32 */ #endif /* COM_H */ php-4.4.8/ext/com/variant.h0000644000175000017500000000160007625136502015000 0ustar derickderick#ifndef VARIANT_H #define VARIANT_H #if PHP_WIN32 #define ALLOC_VARIANT(v) (v) = (VARIANT *) emalloc(sizeof(VARIANT)); \ VariantInit(v); #define FREE_VARIANT(v) VariantClear(v); \ efree(v); #define IS_VARIANT php_VARIANT_get_le_variant() #define ZVAL_VARIANT(z, v) if (V_VT(v) == VT_DISPATCH) { \ if (V_DISPATCH(v)) { \ comval *obj; \ ALLOC_COM(obj); \ php_COM_set(obj, &V_DISPATCH(v), TRUE TSRMLS_CC); \ ZVAL_COM((z), obj); \ efree(v); \ } else { \ ZVAL_NULL(z); \ } \ } else { \ php_variant_to_pval((v), (z), codepage TSRMLS_CC); \ FREE_VARIANT(v); \ } #define RETVAL_VARIANT(v) ZVAL_VARIANT(return_value, (v)); #define RETURN_VARIANT(v) RETVAL_VARIANT(v) \ return; #endif /* PHP_WIN32 */ #endif /* VARIANT_H */ php-4.4.8/ext/com/VARIANT.c0000644000175000017500000003020710736114305014432 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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 | +----------------------------------------------------------------------+ */ /* * This module maps the VARIANT datastructure into PHP so that it can be used to * pass values to COM and DOTNET Objects by reference and not only by value. * * harald */ #ifdef PHP_WIN32 #include "php.h" #include "php_ini.h" #include "ext/standard/info.h" #include "php_VARIANT.h" #include static int do_VARIANT_propset(VARIANT *var_arg, pval *arg_property, pval *value TSRMLS_DC); static int php_VARIANT_set_property_handler(zend_property_reference *property_reference, pval *value); static pval php_VARIANT_get_property_handler(zend_property_reference *property_reference); static void php_VARIANT_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_property_reference *property_reference); static void php_VARIANT_destructor(zend_rsrc_list_entry *rsrc TSRMLS_DC); static void php_register_VARIANT_class(TSRMLS_D); static int le_variant; static int codepage; static zend_class_entry VARIANT_class_entry; void php_VARIANT_init(int module_number TSRMLS_DC) { le_variant = zend_register_list_destructors_ex(php_VARIANT_destructor, NULL, "VARIANT", module_number); /* variant datatypes */ REGISTER_LONG_CONSTANT("VT_NULL", VT_NULL, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("VT_EMPTY", VT_EMPTY, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("VT_UI1", VT_UI1, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("VT_I2", VT_I2, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("VT_I4", VT_I4, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("VT_R4", VT_R4, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("VT_R8", VT_R8, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("VT_BOOL", VT_BOOL, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("VT_ERROR", VT_ERROR, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("VT_CY", VT_CY, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("VT_DATE", VT_DATE, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("VT_BSTR", VT_BSTR, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("VT_DECIMAL", VT_DECIMAL, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("VT_UNKNOWN", VT_UNKNOWN, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("VT_DISPATCH", VT_DISPATCH, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("VT_VARIANT", VT_VARIANT, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("VT_I1", VT_I1, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("VT_UI2", VT_UI2, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("VT_UI4", VT_UI4, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("VT_INT", VT_INT, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("VT_UINT", VT_UINT, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("VT_ARRAY", VT_ARRAY, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("VT_BYREF", VT_BYREF, CONST_CS | CONST_PERSISTENT); /* codepages */ REGISTER_LONG_CONSTANT("CP_ACP", CP_ACP, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("CP_MACCP", CP_MACCP, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("CP_OEMCP", CP_OEMCP, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("CP_UTF7", CP_UTF7, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("CP_UTF8", CP_UTF8, CONST_CS | CONST_PERSISTENT); #ifdef CP_SYMBOL REGISTER_LONG_CONSTANT("CP_SYMBOL", CP_SYMBOL, CONST_CS | CONST_PERSISTENT); #else # error "CP_SYMBOL undefined" #endif #ifdef CP_THREAD_ACP REGISTER_LONG_CONSTANT("CP_THREAD_ACP", CP_THREAD_ACP, CONST_CS | CONST_PERSISTENT); #else # error "CP_THREAD_ACP undefined" #endif php_register_VARIANT_class(TSRMLS_C); } PHPAPI int php_VARIANT_get_le_variant() { return le_variant; } static void php_VARIANT_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_property_reference *property_reference) { pval *object = property_reference->object; zend_overloaded_element *function_name = (zend_overloaded_element *) property_reference->elements_list->tail->data; VARIANT *pVar; if ((zend_llist_count(property_reference->elements_list)==1) && !strcmp(Z_STRVAL(function_name->element), "variant")) { /* constructor */ pval *object_handle, *data, *type, *code_page; ALLOC_VARIANT(pVar); VariantInit(pVar); switch (ZEND_NUM_ARGS()) { case 0: /* nothing to do */ break; case 1: zend_get_parameters(ht, 1, &data); php_pval_to_variant(data, pVar, codepage TSRMLS_CC); codepage = CP_ACP; break; case 2: zend_get_parameters(ht, 2, &data, &type); php_pval_to_variant_ex(data, pVar, type, codepage TSRMLS_CC); codepage = CP_ACP; break; case 3: zend_get_parameters(ht, 3, &data, &type, &code_page); php_pval_to_variant_ex(data, pVar, type, codepage TSRMLS_CC); convert_to_long(code_page); codepage = Z_LVAL_P(code_page); break; default: ZEND_WRONG_PARAM_COUNT(); break; } RETVAL_LONG(zend_list_insert(pVar, IS_VARIANT)); if (!zend_is_true(return_value)) { ZVAL_FALSE(object); return; } ALLOC_ZVAL(object_handle); *object_handle = *return_value; zval_copy_ctor(object_handle); INIT_PZVAL(object_handle); zend_hash_index_update(Z_OBJPROP_P(object), 0, &object_handle, sizeof(pval *), NULL); zval_dtor(&function_name->element); } } static pval php_VARIANT_get_property_handler(zend_property_reference *property_reference) { zend_overloaded_element *overloaded_property; int type; pval result, **var_handle, *object = property_reference->object; VARIANT *var_arg; TSRMLS_FETCH(); /* fetch the VARIANT structure */ zend_hash_index_find(Z_OBJPROP_P(object), 0, (void **) &var_handle); var_arg = zend_list_find(Z_LVAL_PP(var_handle), &type); if (!var_arg || (type != IS_VARIANT)) { ZVAL_FALSE(&result); } else { overloaded_property = (zend_overloaded_element *) property_reference->elements_list->head->data; switch (Z_TYPE_P(overloaded_property)) { case OE_IS_ARRAY: ZVAL_FALSE(&result); break; case OE_IS_OBJECT: if (!strcmp(Z_STRVAL(overloaded_property->element), "value")) { /* var_arg can't be an idispatch, so we don't care for the implicit AddRef() call here */ php_variant_to_pval(var_arg, &result, codepage TSRMLS_CC); } else if (!strcmp(Z_STRVAL(overloaded_property->element), "type")) { ZVAL_LONG(&result, V_VT(var_arg)) } else { ZVAL_FALSE(&result); php_error(E_WARNING, "Unknown member."); } break; case OE_IS_METHOD: ZVAL_FALSE(&result); php_error(E_WARNING, "Unknown method."); break; } } zval_dtor(&overloaded_property->element); return result; } static int php_VARIANT_set_property_handler(zend_property_reference *property_reference, pval *value) { zend_overloaded_element *overloaded_property; int type; pval **var_handle, *object = property_reference->object; VARIANT *var_arg; TSRMLS_FETCH(); /* fetch the VARIANT structure */ zend_hash_index_find(Z_OBJPROP_P(object), 0, (void **) &var_handle); var_arg = zend_list_find(Z_LVAL_PP(var_handle), &type); if (!var_arg || (type != IS_VARIANT)) { return FAILURE; } overloaded_property = (zend_overloaded_element *) property_reference->elements_list->head->data; do_VARIANT_propset(var_arg, &overloaded_property->element, value TSRMLS_CC); zval_dtor(&overloaded_property->element); return SUCCESS; } static int do_VARIANT_propset(VARIANT *var_arg, pval *arg_property, pval *value TSRMLS_DC) { VARTYPE type; if (!strcmp(Z_STRVAL_P(arg_property), "value")) { php_pval_to_variant(value, var_arg, codepage TSRMLS_CC); return SUCCESS; } else if (!strcmp(Z_STRVAL_P(arg_property), "bVal")) { type = VT_UI1; } else if (!strcmp(Z_STRVAL_P(arg_property), "iVal")) { type = VT_I2; } else if (!strcmp(Z_STRVAL_P(arg_property), "lVal")) { type = VT_I4; } else if (!strcmp(Z_STRVAL_P(arg_property), "fltVal")) { type = VT_R4; } else if (!strcmp(Z_STRVAL_P(arg_property), "dblVal")) { type = VT_R8; } else if (!strcmp(Z_STRVAL_P(arg_property), "boolVal")) { type = VT_BOOL; } else if (!strcmp(Z_STRVAL_P(arg_property), "scode")) { type = VT_ERROR; } else if (!strcmp(Z_STRVAL_P(arg_property), "cyVal")) { type = VT_CY; } else if (!strcmp(Z_STRVAL_P(arg_property), "date")) { type = VT_DATE; } else if (!strcmp(Z_STRVAL_P(arg_property), "bstrVal")) { type = VT_BSTR; } else if (!strcmp(Z_STRVAL_P(arg_property), "pdecVal")) { type = VT_DECIMAL|VT_BYREF; } else if (!strcmp(Z_STRVAL_P(arg_property), "punkVal")) { type = VT_UNKNOWN; } else if (!strcmp(Z_STRVAL_P(arg_property), "pdispVal")) { type = VT_DISPATCH; } else if (!strcmp(Z_STRVAL_P(arg_property), "parray")) { type = VT_ARRAY; } else if (!strcmp(Z_STRVAL_P(arg_property), "pbVal")) { type = VT_UI1|VT_BYREF; } else if (!strcmp(Z_STRVAL_P(arg_property), "piVal")) { type = VT_I2|VT_BYREF; } else if (!strcmp(Z_STRVAL_P(arg_property), "plVal")) { type = VT_I4|VT_BYREF; } else if (!strcmp(Z_STRVAL_P(arg_property), "pfltVal")) { type = VT_R4|VT_BYREF; } else if (!strcmp(Z_STRVAL_P(arg_property), "pdblVal")) { type = VT_R8|VT_BYREF; } else if (!strcmp(Z_STRVAL_P(arg_property), "pboolVal")) { type = VT_BOOL|VT_BYREF; } else if (!strcmp(Z_STRVAL_P(arg_property), "pscode")) { type = VT_ERROR|VT_BYREF; } else if (!strcmp(Z_STRVAL_P(arg_property), "pcyVal")) { type = VT_CY|VT_BYREF; } else if (!strcmp(Z_STRVAL_P(arg_property), "pdate")) { type = VT_DATE|VT_BYREF; } else if (!strcmp(Z_STRVAL_P(arg_property), "pbstrVal")) { type = VT_BSTR|VT_BYREF; } else if (!strcmp(Z_STRVAL_P(arg_property), "ppunkVal")) { type = VT_UNKNOWN|VT_BYREF; } else if (!strcmp(Z_STRVAL_P(arg_property), "ppdispVal")) { type = VT_DISPATCH|VT_BYREF; } else if (!strcmp(Z_STRVAL_P(arg_property), "pparray")) { type = VT_ARRAY|VT_BYREF; } else if (!strcmp(Z_STRVAL_P(arg_property), "pvarVal")) { type = VT_VARIANT|VT_BYREF; } else if (!strcmp(Z_STRVAL_P(arg_property), "byref")) { type = VT_BYREF; } else if (!strcmp(Z_STRVAL_P(arg_property), "cVal")) { type = VT_I1; } else if (!strcmp(Z_STRVAL_P(arg_property), "uiVal")) { type = VT_UI2; } else if (!strcmp(Z_STRVAL_P(arg_property), "ulVal")) { type = VT_UI4; } else if (!strcmp(Z_STRVAL_P(arg_property), "intVal")) { type = VT_INT; } else if (!strcmp(Z_STRVAL_P(arg_property), "uintVal")) { type = VT_UINT|VT_BYREF; } else if (!strcmp(Z_STRVAL_P(arg_property), "pcVal")) { type = VT_I1|VT_BYREF; } else if (!strcmp(Z_STRVAL_P(arg_property), "puiVal")) { type = VT_UI2|VT_BYREF; } else if (!strcmp(Z_STRVAL_P(arg_property), "pulVal")) { type = VT_UI4|VT_BYREF; } else if (!strcmp(Z_STRVAL_P(arg_property), "pintVal")) { type = VT_INT|VT_BYREF; } else if (!strcmp(Z_STRVAL_P(arg_property), "puintVal")) { type = VT_UINT|VT_BYREF; } else { php_error(E_WARNING, "Unknown member."); return FAILURE; } php_pval_to_variant_ex2(value, var_arg, type, codepage TSRMLS_CC); return SUCCESS; } static void php_VARIANT_destructor(zend_rsrc_list_entry *rsrc TSRMLS_DC) { FREE_VARIANT(rsrc->ptr); } static void php_register_VARIANT_class(TSRMLS_D) { INIT_OVERLOADED_CLASS_ENTRY(VARIANT_class_entry, "VARIANT", NULL, php_VARIANT_call_function_handler, php_VARIANT_get_property_handler, php_VARIANT_set_property_handler); zend_register_internal_class(&VARIANT_class_entry TSRMLS_CC); } #endif /* PHP_WIN32 */ php-4.4.8/ext/com/php_COM.h0000644000175000017500000000452007662420654014632 0ustar derickderick#ifndef PHP_COM_H #define PHP_COM_H #if PHP_WIN32 #include "com.h" BEGIN_EXTERN_C() PHP_MINIT_FUNCTION(COM); PHP_MSHUTDOWN_FUNCTION(COM); PHP_FUNCTION(com_load); PHP_FUNCTION(com_invoke); PHP_FUNCTION(com_invoke_ex); PHP_FUNCTION(com_addref); PHP_FUNCTION(com_release); PHP_FUNCTION(com_propget); PHP_FUNCTION(com_propput); PHP_FUNCTION(com_load_typelib); PHP_FUNCTION(com_isenum); PHP_FUNCTION(com_event_sink); PHP_FUNCTION(com_message_pump); PHP_FUNCTION(com_print_typeinfo); PHPAPI HRESULT php_COM_invoke(comval *obj, DISPID dispIdMember, WORD wFlags, DISPPARAMS FAR* pDispParams, VARIANT FAR* pVarResult, char **ErrString TSRMLS_DC); PHPAPI HRESULT php_COM_get_ids_of_names(comval *obj, OLECHAR FAR* FAR* rgszNames, DISPID FAR* rgDispId TSRMLS_DC); PHPAPI HRESULT php_COM_release(comval *obj TSRMLS_DC); PHPAPI HRESULT php_COM_addref(comval *obj TSRMLS_DC); PHPAPI HRESULT php_COM_destruct(comval *obj TSRMLS_DC); PHPAPI HRESULT php_COM_set(comval *obj, IDispatch FAR* FAR* pDisp, int cleanup TSRMLS_DC); PHPAPI HRESULT php_COM_clone(comval *obj, comval *clone, int cleanup TSRMLS_DC); PHPAPI char *php_COM_error_message(HRESULT hr TSRMLS_DC); PHPAPI int php_COM_get_le_comval(); PHPAPI int php_COM_set_property_handler(zend_property_reference *property_reference, pval *value); PHPAPI pval php_COM_get_property_handler(zend_property_reference *property_reference); PHPAPI void php_COM_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_property_reference *property_reference); PHPAPI zval *php_COM_object_from_dispatch(IDispatch *disp, zval *val TSRMLS_DC); PHPAPI int php_COM_load_typelib(ITypeLib *TypeLib, int mode TSRMLS_DC); /* dispatch.c */ PHPAPI IDispatch *php_COM_export_object(zval *val TSRMLS_DC); PHPAPI IDispatch *php_COM_export_as_sink(zval *val, GUID *sinkid, HashTable *id_to_name TSRMLS_DC); int php_COM_dispatch_init(int module_number TSRMLS_DC); zend_module_entry COM_module_entry; zend_class_entry COM_class_entry; #ifdef DEBUG extern int resourcecounter; #endif END_EXTERN_C() #define phpext_com_ptr &COM_module_entry ZEND_BEGIN_MODULE_GLOBALS(com) int nothing; ZEND_END_MODULE_GLOBALS(com) PHPAPI ZEND_EXTERN_MODULE_GLOBALS(com) #ifdef ZTS #define COMG(v) TSRMG(com_globals_id, zend_com_globals *, v) #else #define COMG(v) (com_globals.v) #endif #else #define phpext_com_ptr NULL #endif /* PHP_WIN32 */ #endif /* PHP_COM_H */ php-4.4.8/ext/com/conversion.c0000644000175000017500000005670110736114305015522 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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 | | Alan Brown | | Paul Shortis | +----------------------------------------------------------------------+ */ /* * 03.6.2001 * Added SafeArray ==> Hash support */ /* * Paul Shortis June 7, 2001 - Added code to support SafeArray passing * to COM objects. Support includes passing arrays of variants as well * as typed arrays. */ #ifdef PHP_WIN32 #include "php.h" #include "php_COM.h" #include "php_VARIANT.h" /* prototypes */ static void comval_to_variant(pval *pval_arg, VARIANT *var_arg TSRMLS_DC); /* implementations */ PHPAPI void php_pval_to_variant(pval *pval_arg, VARIANT *var_arg, int codepage TSRMLS_DC) { VARTYPE type = VT_EMPTY; /* default variant type */ switch (Z_TYPE_P(pval_arg)) { case IS_NULL: type = VT_NULL; break; case IS_BOOL: type = VT_BOOL; break; case IS_OBJECT: if (!strcmp(Z_OBJCE_P(pval_arg)->name, "VARIANT")) { type = VT_VARIANT|VT_BYREF; } else { type = VT_DISPATCH; } break; case IS_ARRAY: type = VT_ARRAY; break; case IS_RESOURCE: case IS_CONSTANT: case IS_CONSTANT_ARRAY: /* ?? */ break; case IS_LONG: type = VT_I4; /* assuming 32-bit platform */ break; case IS_DOUBLE: type = VT_R8; /* assuming 64-bit double precision */ break; case IS_STRING: type = VT_BSTR; break; } php_pval_to_variant_ex2(pval_arg, var_arg, type, codepage TSRMLS_CC); } PHPAPI void php_pval_to_variant_ex(pval *pval_arg, VARIANT *var_arg, pval *pval_type, int codepage TSRMLS_DC) { php_pval_to_variant_ex2(pval_arg, var_arg, (unsigned short) Z_LVAL_P(pval_type), codepage TSRMLS_CC); } PHPAPI void php_pval_to_variant_ex2(pval *pval_arg, VARIANT *var_arg, VARTYPE type, int codepage TSRMLS_DC) { OLECHAR *unicode_str; VariantInit(var_arg); V_VT(var_arg) = type; if (V_VT(var_arg) & VT_ARRAY) { /* For now we'll just handle single dimension arrays, we'll use the data type of the first element for the output data type */ HashTable *ht = Z_ARRVAL(*pval_arg); int numberOfElements = zend_hash_num_elements(ht); SAFEARRAY *safeArray; SAFEARRAYBOUND bounds[1]; VARIANT *v, var; zval **entry; /* An entry in the input array */ type &= ~VT_ARRAY; if (V_VT(var_arg) == (VT_ARRAY|VT_BYREF)) { /* == is intended, because VT_*|VT_BYREF|VT_ARRAY means something diffrent */ type &= ~VT_BYREF; ALLOC_VARIANT(V_VARIANTREF(var_arg)); var_arg = V_VARIANTREF(var_arg); /* put the array in that VARIANT */ } if (!type) { /* if no type is given we take the variant type */ type = VT_VARIANT; } bounds[0].lLbound = 0; bounds[0].cElements = numberOfElements; safeArray = SafeArrayCreate(type, 1, bounds); if (NULL == safeArray) { php_error( E_WARNING,"Unable to convert php array to VARIANT array - %s", numberOfElements ? "" : "(Empty input array)"); ZVAL_FALSE(pval_arg); } else { V_ARRAY(var_arg) = safeArray; V_VT(var_arg) = VT_ARRAY|type; /* Now have a valid safe array allocated */ if (SUCCEEDED(SafeArrayLock(safeArray))) { ulong i; UINT size = SafeArrayGetElemsize(safeArray); zend_hash_internal_pointer_reset(ht); for (i = 0; i < (ulong)numberOfElements; ++i) { if ((zend_hash_get_current_data(ht, (void **)&entry) == SUCCESS) && (entry != NULL)) { /* Get a pointer to the php array element */ /* Add another value to the safe array */ if (SUCCEEDED(SafeArrayPtrOfIndex(safeArray, &i, &v))) { /* Pointer to output element entry retrieved successfully */ if (type == VT_VARIANT) { php_pval_to_variant(*entry, v, codepage TSRMLS_CC); /* Do the required conversion */ } else { php_pval_to_variant_ex2(*entry, &var, type, codepage TSRMLS_CC); /* Do the required conversion */ memcpy(v, &(var.byref), size); } } else { php_error( E_WARNING,"phpArrayToSafeArray() - Unable to retrieve pointer to output element number (%d)", i); } } zend_hash_move_forward(ht); } SafeArrayUnlock( safeArray); } else { php_error( E_WARNING,"phpArrayToSafeArray() - Unable to lock safeArray"); } } } else { switch (V_VT(var_arg)) { case VT_NULL: case VT_VOID: ZVAL_NULL(pval_arg); break; case VT_UI1: convert_to_long_ex(&pval_arg); V_UI1(var_arg) = (unsigned char) Z_LVAL_P(pval_arg); break; case VT_I2: convert_to_long_ex(&pval_arg); V_I2(var_arg) = (short) Z_LVAL_P(pval_arg); break; case VT_I4: convert_to_long_ex(&pval_arg); V_I4(var_arg) = Z_LVAL_P(pval_arg); break; case VT_R4: convert_to_double_ex(&pval_arg); V_R4(var_arg) = (float) Z_DVAL_P(pval_arg); break; case VT_R8: convert_to_double_ex(&pval_arg); V_R8(var_arg) = Z_DVAL_P(pval_arg); break; case VT_BOOL: convert_to_boolean_ex(&pval_arg); if (Z_LVAL_P(pval_arg)) { V_BOOL(var_arg) = VT_TRUE; } else { V_BOOL(var_arg) = VT_FALSE; } break; case VT_ERROR: convert_to_long_ex(&pval_arg); V_ERROR(var_arg) = Z_LVAL_P(pval_arg); break; case VT_CY: convert_to_double_ex(&pval_arg); VarCyFromR8(Z_DVAL_P(pval_arg), &V_CY(var_arg)); break; case VT_DATE: { SYSTEMTIME wintime; struct tm *phptime; switch (Z_TYPE_P(pval_arg)) { case IS_DOUBLE: /* already a VariantTime value */ V_DATE(var_arg) = Z_DVAL_P(pval_arg); break; /** @todo case IS_STRING: */ /* string representation of a time value */ default: /* a PHP time value ? */ convert_to_long_ex(&pval_arg); phptime = gmtime(&(Z_LVAL_P(pval_arg))); memset(&wintime, 0, sizeof(wintime)); wintime.wYear = phptime->tm_year + 1900; wintime.wMonth = phptime->tm_mon + 1; wintime.wDay = phptime->tm_mday; wintime.wHour = phptime->tm_hour; wintime.wMinute = phptime->tm_min; wintime.wSecond = phptime->tm_sec; SystemTimeToVariantTime(&wintime, &V_DATE(var_arg)); break; } } break; case VT_BSTR: convert_to_string_ex(&pval_arg); unicode_str = php_char_to_OLECHAR(Z_STRVAL_P(pval_arg), Z_STRLEN_P(pval_arg), codepage TSRMLS_CC); V_BSTR(var_arg) = SysAllocStringByteLen((char *) unicode_str, Z_STRLEN_P(pval_arg) * sizeof(OLECHAR)); efree(unicode_str); break; case VT_DECIMAL: convert_to_string_ex(&pval_arg); unicode_str = php_char_to_OLECHAR(Z_STRVAL_P(pval_arg), Z_STRLEN_P(pval_arg), codepage TSRMLS_CC); VarDecFromStr(unicode_str, LOCALE_SYSTEM_DEFAULT, 0, &V_DECIMAL(var_arg)); break; case VT_DECIMAL|VT_BYREF: convert_to_string_ex(&pval_arg); unicode_str = php_char_to_OLECHAR(Z_STRVAL_P(pval_arg), Z_STRLEN_P(pval_arg), codepage TSRMLS_CC); VarDecFromStr(unicode_str, LOCALE_SYSTEM_DEFAULT, 0, V_DECIMALREF(var_arg)); break; case VT_UNKNOWN: comval_to_variant(pval_arg, var_arg TSRMLS_CC); if (V_VT(var_arg) != VT_DISPATCH) { VariantInit(var_arg); } else { V_VT(var_arg) = VT_UNKNOWN; V_UNKNOWN(var_arg) = (IUnknown *) V_DISPATCH(var_arg); } break; case VT_DISPATCH: if (!strcmp(Z_OBJCE_P(pval_arg)->name, "COM")) { comval_to_variant(pval_arg, var_arg TSRMLS_CC); } else { V_DISPATCH(var_arg) = php_COM_export_object(pval_arg TSRMLS_CC); if (V_DISPATCH(var_arg)) { V_VT(var_arg) = VT_DISPATCH; } } if (V_VT(var_arg) != VT_DISPATCH) { VariantInit(var_arg); } break; case VT_UI1|VT_BYREF: convert_to_long(pval_arg); V_UI1REF(var_arg) = (unsigned char FAR*) &Z_LVAL_P(pval_arg); break; case VT_I2|VT_BYREF: convert_to_long(pval_arg); V_I2REF(var_arg) = (short FAR*) &Z_LVAL_P(pval_arg); break; case VT_I4|VT_BYREF: convert_to_long(pval_arg); V_I4REF(var_arg) = (long FAR*) &Z_LVAL_P(pval_arg); break; case VT_R4|VT_BYREF: convert_to_double(pval_arg); V_R4REF(var_arg) = (float FAR*) &Z_LVAL_P(pval_arg); break; case VT_R8|VT_BYREF: convert_to_double(pval_arg); V_R8REF(var_arg) = (double FAR*) &Z_LVAL_P(pval_arg); break; case VT_BOOL|VT_BYREF: convert_to_boolean(pval_arg); /* emalloc or malloc ? */ V_BOOLREF(var_arg) = (short FAR*) pemalloc(sizeof(short), 1); if (Z_LVAL_P(pval_arg)) { *V_BOOLREF(var_arg) = VT_TRUE; } else { *V_BOOLREF(var_arg) = VT_TRUE; } break; case VT_ERROR|VT_BYREF: convert_to_long(pval_arg); V_ERRORREF(var_arg) = (long FAR*) &Z_LVAL_P(pval_arg); break; case VT_CY|VT_BYREF: convert_to_double_ex(&pval_arg); VarCyFromR8(Z_DVAL_P(pval_arg), var_arg->pcyVal); break; case VT_DATE|VT_BYREF: { SYSTEMTIME wintime; struct tm *phptime; phptime = gmtime(&(Z_LVAL_P(pval_arg))); memset(&wintime, 0, sizeof(wintime)); wintime.wYear = phptime->tm_year + 1900; wintime.wMonth = phptime->tm_mon + 1; wintime.wDay = phptime->tm_mday; wintime.wHour = phptime->tm_hour; wintime.wMinute = phptime->tm_min; wintime.wSecond = phptime->tm_sec; SystemTimeToVariantTime(&wintime, var_arg->pdate); } break; case VT_BSTR|VT_BYREF: convert_to_string(pval_arg); V_BSTRREF(var_arg) = (BSTR FAR*) emalloc(sizeof(BSTR FAR*)); unicode_str = php_char_to_OLECHAR(Z_STRVAL_P(pval_arg), Z_STRLEN_P(pval_arg), codepage TSRMLS_CC); *V_BSTRREF(var_arg) = SysAllocString(unicode_str); efree(unicode_str); break; case VT_UNKNOWN|VT_BYREF: comval_to_variant(pval_arg, var_arg TSRMLS_CC); if (V_VT(var_arg) != VT_DISPATCH) { VariantInit(var_arg); } else { V_VT(var_arg) = VT_UNKNOWN|VT_BYREF; V_UNKNOWNREF(var_arg) = (IUnknown **) &V_DISPATCH(var_arg); } break; case VT_DISPATCH|VT_BYREF: comval_to_variant(pval_arg, var_arg TSRMLS_CC); if (V_VT(var_arg) != VT_DISPATCH) { VariantInit(var_arg); } else { V_VT(var_arg) = VT_DISPATCH|VT_BYREF; V_DISPATCHREF(var_arg) = &V_DISPATCH(var_arg); } break; case VT_VARIANT: php_error(E_WARNING,"VT_VARIANT is invalid. Use VT_VARIANT|VT_BYREF instead."); /* break missing intentionally */ case VT_VARIANT|VT_BYREF: { int tp; pval **var_handle; /* fetch the VARIANT structure */ zend_hash_index_find(Z_OBJPROP_P(pval_arg), 0, (void **) &var_handle); V_VT(var_arg) = VT_VARIANT|VT_BYREF; V_VARIANTREF(var_arg) = (VARIANT FAR*) zend_list_find(Z_LVAL_P(*var_handle), &tp); if (!V_VARIANTREF(var_arg) && (tp != IS_VARIANT)) { VariantInit(var_arg); } } /* should be, but isn't :) if (V_VT(var_arg) != (VT_VARIANT|VT_BYREF)) { VariantInit(var_arg); } */ break; case VT_I1: convert_to_long_ex(&pval_arg); V_I1(var_arg) = (char)Z_LVAL_P(pval_arg); break; case VT_UI2: convert_to_long_ex(&pval_arg); V_UI2(var_arg) = (unsigned short)Z_LVAL_P(pval_arg); break; case VT_UI4: convert_to_long_ex(&pval_arg); V_UI4(var_arg) = (unsigned long)Z_LVAL_P(pval_arg); break; case VT_INT: convert_to_long_ex(&pval_arg); V_INT(var_arg) = (int)Z_LVAL_P(pval_arg); break; case VT_UINT: convert_to_long_ex(&pval_arg); V_UINT(var_arg) = (unsigned int)Z_LVAL_P(pval_arg); break; case VT_I1|VT_BYREF: convert_to_long(pval_arg); V_I1REF(var_arg) = (char FAR*) &Z_LVAL_P(pval_arg); break; case VT_UI2|VT_BYREF: convert_to_long(pval_arg); V_UI2REF(var_arg) = (unsigned short FAR*) &Z_LVAL_P(pval_arg); break; case VT_UI4|VT_BYREF: convert_to_long(pval_arg); V_UI4REF(var_arg) = (unsigned long FAR*) &Z_LVAL_P(pval_arg); break; case VT_INT|VT_BYREF: convert_to_long(pval_arg); V_INTREF(var_arg) = (int FAR*) &Z_LVAL_P(pval_arg); break; case VT_UINT|VT_BYREF: convert_to_long(pval_arg); V_UINTREF(var_arg) = (unsigned int FAR*) &Z_LVAL_P(pval_arg); break; default: php_error(E_WARNING,"Unsupported variant type: %d (0x%X)", V_VT(var_arg), V_VT(var_arg)); } } } PHPAPI int php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int codepage TSRMLS_DC) { /* Changed the function to return a value for recursive error testing */ /* Existing calls will be unaffected by the change - so it */ /* seemed like the smallest impact on unfamiliar code */ int ret = SUCCESS; INIT_PZVAL(pval_arg); /* Add SafeArray support */ if (V_ISARRAY(var_arg)) { SAFEARRAY *array = V_ARRAY(var_arg); LONG indices[1]; LONG lbound=0, ubound; VARTYPE vartype; register int ii; UINT Dims; VARIANT vv; pval *element; HRESULT hr; /* TODO: Add support for multi-dimensional SafeArrays */ /* For now just validate that the SafeArray has one dimension */ if (1 != (Dims = SafeArrayGetDim(array))) { php_error(E_WARNING,"Unsupported: multi-dimensional (%d) SafeArrays", Dims); ZVAL_NULL(pval_arg); return FAILURE; } SafeArrayLock(array); /* This call has failed for everything I have tried */ /* But best leave it to be on the safe side */ if (FAILED(SafeArrayGetVartype(array, &vartype)) || (vartype == VT_EMPTY)) { /* Fall back to what we do know */ /* Mask off the array bit and assume */ /* what is left is the type of the array */ /* elements */ vartype = V_VT(var_arg) & ~VT_ARRAY; } SafeArrayGetUBound(array, 1, &ubound); SafeArrayGetLBound(array, 1, &lbound); /* Since COM returned an array we set up the php */ /* return value to be an array */ array_init(pval_arg); /* Walk the safe array */ for (ii=lbound;ii<=ubound;ii++) { indices[0] = ii; VariantInit(&vv); /* Docs say this just set the vt field, but you never know */ /* Set up a variant to pass to a recursive call */ /* So that we do not need to have two copies */ /* of the code */ if (VT_VARIANT == vartype) { hr = SafeArrayGetElement(array, indices, (VOID *) &(vv)); } else { V_VT(&vv) = vartype; hr = SafeArrayGetElement(array, indices, (VOID *) &(vv.lVal)); } if (FAILED(hr)) { /* Failure to retieve an element probably means the array is sparse */ /* So leave the php array sparse too */ continue; } /* Create an element to be added to the array */ ALLOC_ZVAL(element); /* Call ourself again to handle the base type conversion */ /* If SafeArrayGetElement proclaims to allocate */ /* memory for a BSTR, so the recursive call frees */ /* the string correctly */ if (FAILURE == php_variant_to_pval(&vv, element, codepage TSRMLS_CC)) { /* Error occurred setting up array element */ /* Error was displayed by the recursive call */ FREE_ZVAL(element); /* TODO: Do we stop here, or go on and */ /* try to make sense of the rest of the array */ /* Going on leads to multiple errors displayed */ /* for the same conversion. For large arrays that */ /* could be very annoying */ /* And if we don't go on - what to do about */ /* the parts of the array that are OK? */ /* break; */ } else { /* Just insert the element into our return array */ add_index_zval(pval_arg, ii, element); } } SafeArrayUnlock(array); } else switch (var_arg->vt & ~VT_BYREF) { case VT_EMPTY: ZVAL_NULL(pval_arg); break; case VT_UI1: if (V_ISBYREF(var_arg)) { ZVAL_LONG(pval_arg, (long)*V_UI1REF(var_arg)); } else { ZVAL_LONG(pval_arg, (long)V_UI1(var_arg)); } break; case VT_I2: if (V_ISBYREF(var_arg)) { ZVAL_LONG(pval_arg, (long )*V_I2REF(var_arg)); } else { ZVAL_LONG(pval_arg, (long)V_I2(var_arg)); } break; case VT_I4: if (V_ISBYREF(var_arg)) { ZVAL_LONG(pval_arg, *V_I4REF(var_arg)); } else { ZVAL_LONG(pval_arg, V_I4(var_arg)); } break; case VT_R4: if (V_ISBYREF(var_arg)) { ZVAL_DOUBLE(pval_arg, (double)*V_R4REF(var_arg)); } else { ZVAL_DOUBLE(pval_arg, (double)V_R4(var_arg)); } break; case VT_R8: if (V_ISBYREF(var_arg)) { ZVAL_DOUBLE(pval_arg, *V_R8REF(var_arg)); } else { ZVAL_DOUBLE(pval_arg, V_R8(var_arg)); } break; /* 96bit uint */ case VT_DECIMAL: { OLECHAR *unicode_str; switch (VarBstrFromDec(&V_DECIMAL(var_arg), LOCALE_SYSTEM_DEFAULT, 0, &unicode_str)) { case S_OK: Z_STRVAL_P(pval_arg) = php_OLECHAR_to_char(unicode_str, &Z_STRLEN_P(pval_arg), codepage TSRMLS_CC); Z_TYPE_P(pval_arg) = IS_STRING; break; default: ZVAL_NULL(pval_arg); ret = FAILURE; php_error(E_WARNING, "Error converting DECIMAL value to PHP string"); break; } } break; /* Currency */ case VT_CY: if (V_ISBYREF(var_arg)) { VarR8FromCy(*V_CYREF(var_arg), &Z_DVAL_P(pval_arg)); } else { VarR8FromCy(V_CY(var_arg), &Z_DVAL_P(pval_arg)); } Z_TYPE_P(pval_arg) = IS_DOUBLE; break; case VT_BOOL: if (V_ISBYREF(var_arg)) { if (*V_BOOLREF(var_arg)) { ZVAL_BOOL(pval_arg, Z_TRUE); } else { ZVAL_BOOL(pval_arg, Z_FALSE); } } else { if (V_BOOL(var_arg)) { ZVAL_BOOL(pval_arg, Z_TRUE); } else { ZVAL_BOOL(pval_arg, Z_FALSE); } } break; case VT_NULL: case VT_VOID: ZVAL_NULL(pval_arg); break; case VT_VARIANT: php_variant_to_pval(V_VARIANTREF(var_arg), pval_arg, codepage TSRMLS_CC); break; case VT_BSTR: Z_TYPE_P(pval_arg) = IS_STRING; if (V_ISBYREF(var_arg)) { if (*V_BSTR(var_arg)) { Z_STRVAL_P(pval_arg) = php_OLECHAR_to_char(*V_BSTRREF(var_arg), &Z_STRLEN_P(pval_arg), codepage TSRMLS_CC); } else { ZVAL_NULL(pval_arg); } efree(V_BSTRREF(var_arg)); } else { if (V_BSTR(var_arg)) { Z_STRVAL_P(pval_arg) = php_OLECHAR_to_char(V_BSTR(var_arg), &Z_STRLEN_P(pval_arg), codepage TSRMLS_CC); } else { ZVAL_NULL(pval_arg); } } break; case VT_DATE: { BOOL success; SYSTEMTIME wintime; struct tm phptime; if (V_ISBYREF(var_arg)) { success = VariantTimeToSystemTime(*V_DATEREF(var_arg), &wintime); } else { success = VariantTimeToSystemTime(V_DATE(var_arg), &wintime); } if (success) { memset(&phptime, 0, sizeof(phptime)); phptime.tm_year = wintime.wYear - 1900; phptime.tm_mon = wintime.wMonth - 1; phptime.tm_mday = wintime.wDay; phptime.tm_hour = wintime.wHour; phptime.tm_min = wintime.wMinute; phptime.tm_sec = wintime.wSecond; phptime.tm_isdst = -1; tzset(); ZVAL_LONG(pval_arg, mktime(&phptime)); } else { ret = FAILURE; } } break; case VT_UNKNOWN: if (V_UNKNOWN(var_arg) == NULL) { V_DISPATCH(var_arg) = NULL; } else { HRESULT hr; hr = V_UNKNOWN(var_arg)->lpVtbl->QueryInterface(var_arg->punkVal, &IID_IDispatch, &V_DISPATCH(var_arg)); if (FAILED(hr)) { char *error_message; error_message = php_COM_error_message(hr TSRMLS_CC); php_error(E_WARNING,"Unable to obtain IDispatch interface: %s", error_message); LocalFree(error_message); V_DISPATCH(var_arg) = NULL; } } /* break missing intentionaly */ case VT_DISPATCH: { comval *obj; if (V_DISPATCH(var_arg) == NULL) { ret = FAILURE; ZVAL_NULL(pval_arg); } else { ALLOC_COM(obj); php_COM_set(obj, &V_DISPATCH(var_arg), FALSE TSRMLS_CC); ZVAL_COM(pval_arg, obj); } } break; case VT_I1: if (V_ISBYREF(var_arg)) { ZVAL_LONG(pval_arg, (long)*V_I1REF(var_arg)); } else { ZVAL_LONG(pval_arg, (long)V_I1(var_arg)); } break; case VT_UI2: if (V_ISBYREF(var_arg)) { ZVAL_LONG(pval_arg, (long)*V_UI2REF(var_arg)); } else { ZVAL_LONG(pval_arg, (long)V_UI2(var_arg)); } break; case VT_UI4: if (V_ISBYREF(var_arg)) { ZVAL_LONG(pval_arg, (long)*V_UI4REF(var_arg)); } else { ZVAL_LONG(pval_arg, (long)V_UI4(var_arg)); } break; case VT_INT: if (V_ISBYREF(var_arg)) { ZVAL_LONG(pval_arg, (long)*V_INTREF(var_arg)); } else { ZVAL_LONG(pval_arg, (long)V_INT(var_arg)); } break; case VT_UINT: if (V_ISBYREF(var_arg)) { ZVAL_LONG(pval_arg, (long)*V_UINTREF(var_arg)); } else { ZVAL_LONG(pval_arg, (long)V_UINT(var_arg)); } break; default: php_error(E_WARNING,"Unsupported variant type: %d (0x%X)", V_VT(var_arg), V_VT(var_arg)); ZVAL_NULL(pval_arg); ret = FAILURE; break; } return ret; } PHPAPI OLECHAR *php_char_to_OLECHAR(char *C_str, uint strlen, int codepage TSRMLS_DC) { BOOL error = FALSE; OLECHAR *unicode_str; if (strlen == -1) { /* request needed buffersize */ strlen = MultiByteToWideChar(codepage, (codepage == CP_UTF8 ? 0 : MB_PRECOMPOSED | MB_ERR_INVALID_CHARS), C_str, -1, NULL, 0); } else { /* \0 terminator */ strlen++; } if (strlen >= 0) { unicode_str = (OLECHAR *) emalloc(sizeof(OLECHAR) * strlen); /* convert string */ error = !MultiByteToWideChar(codepage, (codepage == CP_UTF8 ? 0 : MB_PRECOMPOSED | MB_ERR_INVALID_CHARS), C_str, strlen, unicode_str, strlen); } else { /* return a zero-length string */ unicode_str = (OLECHAR *) emalloc(sizeof(OLECHAR)); *unicode_str = 0; error = TRUE; } if (error) { switch (GetLastError()) { case ERROR_NO_UNICODE_TRANSLATION: php_error(E_WARNING, "No unicode translation available for the specified string"); break; case ERROR_INSUFFICIENT_BUFFER: php_error(E_WARNING, "Internal Error: Insufficient Buffer"); break; default: php_error(E_WARNING, "Unknown error in php_char_to_OLECHAR()"); } } return unicode_str; } PHPAPI char *php_OLECHAR_to_char(OLECHAR *unicode_str, uint *out_length, int codepage TSRMLS_DC) { char *C_str; uint length = 0; /* request needed buffersize */ uint reqSize = WideCharToMultiByte(codepage, codepage == CP_UTF8 ? 0 : WC_COMPOSITECHECK, unicode_str, -1, NULL, 0, NULL, NULL); if (reqSize) { C_str = (char *) emalloc(sizeof(char) * reqSize); /* convert string */ length = WideCharToMultiByte(codepage, codepage == CP_UTF8 ? 0 : WC_COMPOSITECHECK, unicode_str, -1, C_str, reqSize, NULL, NULL) - 1; } else { C_str = (char *) emalloc(sizeof(char)); *C_str = 0; php_error(E_WARNING,"Error in php_OLECHAR_to_char()"); } if (out_length) { *out_length = length; } return C_str; } static void comval_to_variant(pval *pval_arg, VARIANT *var_arg TSRMLS_DC) { pval **comval_handle; comval *obj; int type; /* fetch the comval structure */ zend_hash_index_find(Z_OBJPROP_P(pval_arg), 0, (void **) &comval_handle); obj = (comval *)zend_list_find(Z_LVAL_P(*comval_handle), &type); if (!obj || (type != IS_COM) || !C_ISREFD(obj)) { VariantInit(var_arg); } else { V_VT(var_arg) = VT_DISPATCH; V_DISPATCH(var_arg) = C_DISPATCH(obj); } } #endif /* PHP_WIN32 */ php-4.4.8/ext/com/conversion.h0000644000175000017500000000142407553376261015535 0ustar derickderick#ifndef CONVERSION_H #define CONVERSION_H /* isn't this defined somewhere else ? */ #define Z_TRUE 1 #define Z_FALSE 0 #define VT_TRUE -1 #define VT_FALSE 0 BEGIN_EXTERN_C() PHPAPI void php_pval_to_variant(pval *pval_arg, VARIANT *var_arg, int codepage TSRMLS_DC); PHPAPI void php_pval_to_variant_ex(pval *pval_arg, VARIANT *var_arg, pval *pval_type, int codepage TSRMLS_DC); PHPAPI void php_pval_to_variant_ex2(pval *pval_arg, VARIANT *var_arg, VARTYPE type, int codepage TSRMLS_DC); PHPAPI int php_variant_to_pval(VARIANT *var_arg, pval *pval_arg, int codepage TSRMLS_DC); PHPAPI OLECHAR *php_char_to_OLECHAR(char *C_str, uint strlen, int codepage TSRMLS_DC); PHPAPI char *php_OLECHAR_to_char(OLECHAR *unicode_str, uint *out_length, int codepage TSRMLS_DC); END_EXTERN_C() #endifphp-4.4.8/ext/com/dispatch.c0000644000175000017500000003720410736114305015131 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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: dispatch.c,v 1.3.6.2.4.3 2007/12/31 07:22:45 sebastian Exp $ */ /* * This module is used to export PHP objects to COM and DOTNET by exposing * them as objects implementing IDispatch. * */ #include "php.h" #include "php_COM.h" #include "php_VARIANT.h" #include "conversion.h" #include "variant.h" #define COBJMACROS #include /* IDispatch */ #include /* IDispatchEx */ typedef struct { /* This first part MUST match the declaration * of interface IDispatchEx */ CONST_VTBL struct IDispatchExVtbl *lpVtbl; /* now the PHP stuff */ THREAD_T 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 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); } static int le_dispatch; int php_COM_dispatch_init(int module_number TSRMLS_DC) { le_dispatch = zend_register_list_destructors_ex(dispatch_dtor, NULL, "COM:Dispatch", module_number); return le_dispatch; } /* {{{ trace */ static inline void trace(char *fmt, ...) { va_list ap; char buf[4096]; sprintf(buf, "T=%08x ", tsrm_thread_id()); OutputDebugString(buf); va_start(ap, fmt); vsnprintf(buf, sizeof(buf), fmt, ap); OutputDebugString(buf); va_end(ap); } /* }}} */ #define FETCH_DISP(methname) \ php_dispatchex *disp = (php_dispatchex*)This; \ trace(" PHP:%s %s\n", Z_OBJCE_P(disp->object)->name, methname); \ if (tsrm_thread_id() != disp->engine_thread) \ return E_UNEXPECTED; 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; TSRMLS_FETCH(); 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; TSRMLS_FETCH(); FETCH_DISP("GetIDsOfNames"); for (i = 0; i < cNames; i++) { char *name; unsigned int namelen; zval **tmp; name = php_OLECHAR_to_char(rgszNames[i], &namelen, CP_ACP 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; TSRMLS_FETCH(); FETCH_DISP("GetDispID"); name = php_OLECHAR_to_char(bstrName, &namelen, CP_ACP TSRMLS_CC); /* Lookup the name in the hash */ if (zend_hash_find(disp->name_to_dispid, name, namelen+1, (void**)&tmp) == SUCCESS) { *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; int codepage = CP_ACP; zval *retval = NULL; zval ***params = NULL; HRESULT ret = DISP_E_MEMBERNOTFOUND; TSRMLS_FETCH(); 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 flags=%08x args=%d\n", id, Z_STRVAL_PP(name), wFlags, pdp->cArgs); /* convert args into zvals. * Args are in reverse order */ params = (zval ***)emalloc(sizeof(zval **) * pdp->cArgs); 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); if (V_VT(arg) == VT_DISPATCH) { trace("arg %d is dispatchable\n", i); if (NULL == php_COM_object_from_dispatch(V_DISPATCH(arg), zarg TSRMLS_CC)) { trace("failed to convert arg %d to zval\n", i); ZVAL_NULL(zarg); } } else { /* arg can't be an idispatch, so we don't care for the implicit AddRef() call here */ if (FAILURE == php_variant_to_pval(arg, zarg, codepage TSRMLS_CC)) { trace("failed to convert arg %d to zval\n", i); ZVAL_NULL(zarg); } } params[i] = &zarg; } trace("arguments processed, prepare to do some work\n"); if (wFlags & DISPATCH_PROPERTYGET) { trace("trying to get a property\n"); zend_hash_find(Z_OBJPROP_P(disp->object), Z_STRVAL_PP(name), Z_STRLEN_PP(name)+1, (void**)&retval); } else if (wFlags & DISPATCH_PROPERTYPUT) { trace("trying to set a property\n"); add_property_zval(disp->object, Z_STRVAL_PP(name), *params[0]); } else if (wFlags & DISPATCH_METHOD) { trace("Trying to call user function\n"); if (SUCCESS == call_user_function_ex(EG(function_table), &disp->object, *name, &retval, pdp->cArgs, params, 1, NULL TSRMLS_CC)) { ret = S_OK; } else { ret = DISP_E_EXCEPTION; } } else { trace("Don't know how to handle this invocation %08x\n", wFlags); } /* release arguments */ for (i = 0; i < pdp->cArgs; i++) zval_ptr_dtor(params[i]); efree(params); /* return value */ if (retval) { if (pvarRes) { if (Z_TYPE_P(retval) == IS_OBJECT) { /* export the object using a dispatch like ourselves */ VariantInit(pvarRes); V_VT(pvarRes) = VT_DISPATCH; V_DISPATCH(pvarRes) = php_COM_export_object(retval TSRMLS_CC); } else { php_pval_to_variant(retval, pvarRes, codepage 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"); return S_FALSE; } static HRESULT STDMETHODCALLTYPE disp_deletememberbydispid( IDispatchEx *This, /* [in] */ DISPID id) { FETCH_DISP("DeleteMemberByDispID"); 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; TSRMLS_FETCH(); FETCH_DISP("GetMemberName"); if (SUCCESS == zend_hash_index_find(disp->dispid_to_name, id, (void**)&name)) { OLECHAR *olestr = php_char_to_OLECHAR(Z_STRVAL_P(name), Z_STRLEN_P(name), CP_ACP 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 */ zend_hash_internal_pointer_reset_ex(Z_OBJPROP_PP(&disp->object), &pos); while (HASH_KEY_NON_EXISTANT != (keytype = zend_hash_get_current_key_ex(Z_OBJPROP_PP(&disp->object), &name, &namelen, &pid, 0, &pos))) { char namebuf[32]; if (keytype == HASH_KEY_IS_LONG) { sprintf(namebuf, "%d", pid); name = namebuf; namelen = strlen(namebuf); } zend_hash_move_forward_ex(Z_OBJPROP_PP(&disp->object), &pos); /* Find the existing id */ if (zend_hash_find(disp->name_to_dispid, name, namelen+1, (void**)&tmp) == SUCCESS) continue; /* add the mappings */ MAKE_STD_ZVAL(tmp); ZVAL_STRINGL(tmp, name, namelen, 1); 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+1, (void*)&tmp, sizeof(zval *), NULL); } /* functions */ zend_hash_internal_pointer_reset_ex(&Z_OBJCE_PP(&disp->object)->function_table, &pos); while (HASH_KEY_NON_EXISTANT != (keytype = zend_hash_get_current_key_ex(&Z_OBJCE_PP(&disp->object)->function_table, &name, &namelen, &pid, 0, &pos))) { char namebuf[32]; if (keytype == HASH_KEY_IS_LONG) { sprintf(namebuf, "%d", pid); name = namebuf; namelen = strlen(namebuf); } zend_hash_move_forward_ex(Z_OBJPROP_PP(&disp->object), &pos); /* Find the existing id */ if (zend_hash_find(disp->name_to_dispid, name, namelen+1, (void**)&tmp) == SUCCESS) continue; /* add the mappings */ MAKE_STD_ZVAL(tmp); ZVAL_STRINGL(tmp, name, namelen, 1); 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+1, (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 proxy\n"); if (disp == NULL) return NULL; memset(disp, 0, sizeof(php_dispatchex)); disp->engine_thread = tsrm_thread_id(); 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(); trace("destroying COM wrapper for PHP object %s\n", 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_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_export_object(zval *val TSRMLS_DC) { php_dispatchex *disp = NULL; if (Z_TYPE_P(val) != IS_OBJECT) return NULL; if (Z_OBJCE_P(val) == &COM_class_entry || !strcmp(Z_OBJCE_P(val)->name, "COM")) { /* pass back it's IDispatch directly */ zval **tmp; comval *obj; int type; zend_hash_index_find(Z_OBJPROP_P(val), 0, (void**)&tmp); obj = (comval *)zend_list_find(Z_LVAL_PP(tmp), &type); if (type != IS_COM) return NULL; C_DISPATCH(obj)->lpVtbl->AddRef(C_DISPATCH(obj)); return C_DISPATCH(obj); } disp = disp_constructor(val TSRMLS_CC); generate_dispids(disp TSRMLS_CC); return (IDispatch*)disp; } php-4.4.8/ext/com/php_VARIANT.h0000644000175000017500000000047007357322433015315 0ustar derickderick#ifndef PHP_TYPEDEF_VARIANT_H #define PHP_TYPEDEF_VARIANT_H #if PHP_WIN32 BEGIN_EXTERN_C() #include "conversion.h" #include "variant.h" void php_VARIANT_init(int module_number TSRMLS_DC); PHPAPI int php_VARIANT_get_le_variant(); END_EXTERN_C() #endif /* PHP_WIN32 */ #endif /* PHP_TYPEDEF_VARIANT_H */ php-4.4.8/ext/com/CREDITS0000644000175000017500000000007407475642670014222 0ustar derickderickWin32 COM Alan Brown, Wez Furlong, Harald Radi, Zeev Suraskiphp-4.4.8/ext/dio/0000755000175000017500000000000010737115146013162 5ustar derickderickphp-4.4.8/ext/dio/dio.c0000644000175000017500000003457410736114306014112 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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 | +----------------------------------------------------------------------+ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "php.h" #include "php_ini.h" #include "ext/standard/info.h" #include "php_dio.h" #include #include #include #include #include /* e.g. IRIX does not have CRTSCTS */ #ifndef CRTSCTS # ifdef CNEW_RTSCTS # define CRTSCTS CNEW_RTSCTS # else # define CRTSCTS 0 # endif /* CNEW_RTSCTS */ #endif /* !CRTSCTS */ #define le_fd_name "Direct I/O File Descriptor" static int le_fd; function_entry dio_functions[] = { PHP_FE(dio_open, NULL) PHP_FE(dio_truncate, NULL) PHP_FE(dio_stat, NULL) PHP_FE(dio_seek, NULL) PHP_FE(dio_fcntl, NULL) PHP_FE(dio_read, NULL) PHP_FE(dio_write, NULL) PHP_FE(dio_close, NULL) PHP_FE(dio_tcsetattr, NULL) {NULL, NULL, NULL} }; zend_module_entry dio_module_entry = { STANDARD_MODULE_HEADER, "dio", dio_functions, PHP_MINIT(dio), NULL, NULL, NULL, PHP_MINFO(dio), "0.1", STANDARD_MODULE_PROPERTIES }; #ifdef COMPILE_DL_DIO ZEND_GET_MODULE(dio) #endif static void _dio_close_fd(zend_rsrc_list_entry *rsrc TSRMLS_DC) { php_fd_t *f = (php_fd_t *) rsrc->ptr; if (f) { close(f->fd); free(f); } } #define RDIOC(c) REGISTER_LONG_CONSTANT(#c, c, CONST_CS | CONST_PERSISTENT) #define DIO_UNDEF_CONST -1 PHP_MINIT_FUNCTION(dio) { le_fd = zend_register_list_destructors_ex(_dio_close_fd, NULL, le_fd_name, module_number); RDIOC(O_RDONLY); RDIOC(O_WRONLY); RDIOC(O_RDWR); RDIOC(O_CREAT); RDIOC(O_EXCL); RDIOC(O_TRUNC); RDIOC(O_APPEND); RDIOC(O_NONBLOCK); RDIOC(O_NDELAY); #ifdef O_SYNC RDIOC(O_SYNC); #endif #ifdef O_ASYNC RDIOC(O_ASYNC); #endif RDIOC(O_NOCTTY); RDIOC(S_IRWXU); RDIOC(S_IRUSR); RDIOC(S_IWUSR); RDIOC(S_IXUSR); RDIOC(S_IRWXG); RDIOC(S_IRGRP); RDIOC(S_IWGRP); RDIOC(S_IXGRP); RDIOC(S_IRWXO); RDIOC(S_IROTH); RDIOC(S_IWOTH); RDIOC(S_IXOTH); RDIOC(F_DUPFD); RDIOC(F_GETFD); RDIOC(F_GETFL); RDIOC(F_SETFL); RDIOC(F_GETLK); RDIOC(F_SETLK); RDIOC(F_SETLKW); RDIOC(F_SETOWN); RDIOC(F_GETOWN); RDIOC(F_UNLCK); RDIOC(F_RDLCK); RDIOC(F_WRLCK); return SUCCESS; } PHP_MINFO_FUNCTION(dio) { php_info_print_table_start(); php_info_print_table_row(2, "dio support", "enabled"); php_info_print_table_end(); } static int new_php_fd(php_fd_t **f, int fd) { if (!(*f = malloc(sizeof(php_fd_t)))) { return 0; } (*f)->fd = fd; return 1; } /* {{{ proto resource dio_open(string filename, int flags[, int mode]) Open a new filename with specified permissions of flags and creation permissions of mode */ PHP_FUNCTION(dio_open) { php_fd_t *f; char *file_name; int file_name_length; long flags; long mode = 0; int fd; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sl|l", &file_name, &file_name_length, &flags, &mode) == FAILURE) { return; } if (php_check_open_basedir(file_name TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(file_name, "wb+", CHECKUID_CHECK_MODE_PARAM))) { RETURN_FALSE; } if (ZEND_NUM_ARGS() == 3) { fd = open(file_name, flags, mode); } else { fd = open(file_name, flags); } if (fd == -1) { php_error(E_WARNING, "%s(): cannot open file %s with flags %ld and permissions %ld: %s", get_active_function_name(TSRMLS_C), file_name, flags, mode, strerror(errno)); RETURN_FALSE; } if (!new_php_fd(&f, fd)) { RETURN_FALSE; } ZEND_REGISTER_RESOURCE(return_value, f, le_fd); } /* }}} */ /* {{{ proto string dio_read(resource fd[, int n]) Read n bytes from fd and return them, if n is not specified, read 1k */ PHP_FUNCTION(dio_read) { zval *r_fd; php_fd_t *f; char *data; long bytes = 1024; ssize_t res; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &r_fd, &bytes) == FAILURE) { return; } ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd); if (bytes <= 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than 0."); RETURN_FALSE; } data = emalloc(bytes + 1); res = read(f->fd, data, bytes); if (res <= 0) { efree(data); RETURN_NULL(); } data = erealloc(data, res + 1); data[res] = 0; RETURN_STRINGL(data, res, 0); } /* }}} */ /* {{{ proto int dio_write(resource fd, string data[, int len]) Write data to fd with optional truncation at length */ PHP_FUNCTION(dio_write) { zval *r_fd; php_fd_t *f; char *data; int data_len; long trunc_len = 0; ssize_t res; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", &r_fd, &data, &data_len, &trunc_len) == FAILURE) { return; } if (trunc_len < 0 || trunc_len > data_len) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "length must be greater or equal to zero and less then the length of the specified string."); RETURN_FALSE; } ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd); res = write(f->fd, data, trunc_len ? trunc_len : data_len); if (res == -1) { php_error(E_WARNING, "%s(): cannot write data to file descriptor %d, %s", get_active_function_name(TSRMLS_C), f->fd, strerror(errno)); } RETURN_LONG(res); } /* }}} */ /* {{{ proto bool dio_truncate(resource fd, int offset) Truncate file descriptor fd to offset bytes */ PHP_FUNCTION(dio_truncate) { zval *r_fd; php_fd_t *f; long offset; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &r_fd, &offset) == FAILURE) { return; } ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd); if (ftruncate(f->fd, offset) == -1) { php_error(E_WARNING, "%s(): couldn't truncate %d to %ld bytes: %s", get_active_function_name(TSRMLS_C), f->fd, offset, strerror(errno)); RETURN_FALSE; } RETURN_TRUE; } /* }}} */ #define ADD_FIELD(f, v) add_assoc_long_ex(return_value, (f), sizeof(f), v); /* {{{ proto array dio_stat(resource fd) Get stat information about the file descriptor fd */ PHP_FUNCTION(dio_stat) { zval *r_fd; php_fd_t *f; struct stat s; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &r_fd) == FAILURE) { return; } ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd); if (fstat(f->fd, &s) == -1) { php_error(E_WARNING, "%s(): cannot stat %d: %s", get_active_function_name(TSRMLS_C), f->fd, strerror(errno)); RETURN_FALSE; } array_init(return_value); ADD_FIELD("device", s.st_dev); ADD_FIELD("inode", s.st_ino); ADD_FIELD("mode", s.st_mode); ADD_FIELD("nlink", s.st_nlink); ADD_FIELD("uid", s.st_uid); ADD_FIELD("gid", s.st_gid); ADD_FIELD("device_type", s.st_rdev); ADD_FIELD("size", s.st_size); ADD_FIELD("block_size", s.st_blksize); ADD_FIELD("blocks", s.st_blocks); ADD_FIELD("atime", s.st_atime); ADD_FIELD("mtime", s.st_mtime); ADD_FIELD("ctime", s.st_ctime); } /* }}} */ /* {{{ proto int dio_seek(resource fd, int pos, int whence) Seek to pos on fd from whence */ PHP_FUNCTION(dio_seek) { zval *r_fd; php_fd_t *f; long offset; long whence = SEEK_SET; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|l", &r_fd, &offset, &whence) == FAILURE) { return; } ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd); RETURN_LONG(lseek(f->fd, offset, whence)); } /* }}} */ /* {{{ proto mixed dio_fcntl(resource fd, int cmd[, mixed arg]) Perform a c library fcntl on fd */ PHP_FUNCTION(dio_fcntl) { zval *r_fd; zval *arg = NULL; php_fd_t *f; long cmd; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|z", &r_fd, &cmd, &arg) == FAILURE) { return; } ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd); switch (cmd) { case F_SETLK: case F_SETLKW: { zval **element; struct flock lk = {0}; HashTable *fh; if (!arg) { php_error(E_WARNING, "%s() expects argument 3 to be array or int, none given", get_active_function_name(TSRMLS_C)); RETURN_FALSE; } if (Z_TYPE_P(arg) == IS_ARRAY) { fh = HASH_OF(arg); if (zend_hash_find(fh, "start", sizeof("start"), (void **) &element) == FAILURE) { lk.l_start = 0; } else { lk.l_start = Z_LVAL_PP(element); } if (zend_hash_find(fh, "length", sizeof("length"), (void **) &element) == FAILURE) { lk.l_len = 0; } else { lk.l_len = Z_LVAL_PP(element); } if (zend_hash_find(fh, "whence", sizeof("whence"), (void **) &element) == FAILURE) { lk.l_whence = 0; } else { lk.l_whence = Z_LVAL_PP(element); } if (zend_hash_find(fh, "type", sizeof("type"), (void **) &element) == FAILURE) { lk.l_type = 0; } else { lk.l_type = Z_LVAL_PP(element); } } else if (Z_TYPE_P(arg) == IS_LONG) { lk.l_start = 0; lk.l_len = 0; lk.l_whence = SEEK_SET; lk.l_type = Z_LVAL_P(arg); } else { php_error(E_WARNING, "%s() expects argument 3 to be array or int, %s given", get_active_function_name(TSRMLS_C), zend_zval_type_name(arg)); RETURN_FALSE; } RETURN_LONG(fcntl(f->fd, cmd, &lk)); break; } case F_GETLK: { struct flock lk = {0}; fcntl(f->fd, cmd, &lk); array_init(return_value); add_assoc_long(return_value, "type", lk.l_type); add_assoc_long(return_value, "whence", lk.l_whence); add_assoc_long(return_value, "start", lk.l_start); add_assoc_long(return_value, "length", lk.l_len); add_assoc_long(return_value, "pid", lk.l_pid); break; } case F_DUPFD: { php_fd_t *new_f; if (!arg || Z_TYPE_P(arg) != IS_LONG) { php_error(E_WARNING, "%s() expects argument 3 to be int", get_active_function_name(TSRMLS_C)); RETURN_FALSE; } if (!new_php_fd(&new_f, fcntl(f->fd, cmd, Z_LVAL_P(arg)))) { RETURN_FALSE; } ZEND_REGISTER_RESOURCE(return_value, new_f, le_fd); break; } default: if (!arg || Z_TYPE_P(arg) != IS_LONG) { php_error(E_WARNING, "%s() expects argument 3 to be int", get_active_function_name(TSRMLS_C)); RETURN_FALSE; } RETURN_LONG(fcntl(f->fd, cmd, Z_LVAL_P(arg))); } } /* }}} */ /* {{{ proto mixed dio_tcsetattr(resource fd, array args ) Perform a c library tcsetattr on fd */ PHP_FUNCTION(dio_tcsetattr) { zval *r_fd; zval *arg = NULL; php_fd_t *f; struct termios newtio; int Baud_Rate, Data_Bits=8, Stop_Bits=1, Parity=0; long BAUD,DATABITS,STOPBITS,PARITYON,PARITY; HashTable *fh; zval **element; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rz", &r_fd, &arg) == FAILURE) { return; } ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd); if (Z_TYPE_P(arg) != IS_ARRAY) { zend_error(E_WARNING,"tcsetattr, third argument should be an associative array"); return; } fh = HASH_OF(arg); if (zend_hash_find(fh, "baud", sizeof("baud"), (void **) &element) == FAILURE) { Baud_Rate = 9600; } else { Baud_Rate = Z_LVAL_PP(element); } if (zend_hash_find(fh, "bits", sizeof("bits"), (void **) &element) == FAILURE) { Data_Bits = 8; } else { Data_Bits = Z_LVAL_PP(element); } if (zend_hash_find(fh, "stop", sizeof("stop"), (void **) &element) == FAILURE) { Stop_Bits = 1; } else { Stop_Bits = Z_LVAL_PP(element); } if (zend_hash_find(fh, "parity", sizeof("parity"), (void **) &element) == FAILURE) { Parity = 0; } else { Parity = Z_LVAL_PP(element); } /* assign to correct values... */ switch (Baud_Rate) { case 38400: BAUD = B38400; break; case 19200: BAUD = B19200; break; case 9600: BAUD = B9600; break; case 4800: BAUD = B4800; break; case 2400: BAUD = B2400; break; case 1800: BAUD = B1800; break; case 1200: BAUD = B1200; break; case 600: BAUD = B600; break; case 300: BAUD = B300; break; case 200: BAUD = B200; break; case 150: BAUD = B150; break; case 134: BAUD = B134; break; case 110: BAUD = B110; break; case 75: BAUD = B75; break; case 50: BAUD = B50; break; default: zend_error(E_WARNING, "invalid baud rate %d", Baud_Rate); RETURN_FALSE; } switch (Data_Bits) { case 8: DATABITS = CS8; break; case 7: DATABITS = CS7; break; case 6: DATABITS = CS6; break; case 5: DATABITS = CS5; break; default: zend_error(E_WARNING, "invalid data bits %d", Data_Bits); RETURN_FALSE; } switch (Stop_Bits) { case 1: STOPBITS = 0; break; case 2: STOPBITS = CSTOPB; break; default: zend_error(E_WARNING, "invalid stop bits %d", Stop_Bits); RETURN_FALSE; } switch (Parity) { case 0: PARITYON = 0; PARITY = 0; break; case 1: PARITYON = PARENB; PARITY = PARODD; break; case 2: PARITYON = PARENB; PARITY = 0; break; default: zend_error(E_WARNING, "invalid parity %d", Parity); RETURN_FALSE; } memset(&newtio, 0, sizeof(newtio)); tcgetattr(f->fd, &newtio); newtio.c_cflag = BAUD | CRTSCTS | DATABITS | STOPBITS | PARITYON | PARITY | CLOCAL | CREAD; newtio.c_iflag = IGNPAR; newtio.c_oflag = 0; newtio.c_lflag = 0; /* ICANON; */ newtio.c_cc[VMIN]=1; newtio.c_cc[VTIME]=0; tcflush(f->fd, TCIFLUSH); tcsetattr(f->fd,TCSANOW,&newtio); RETURN_TRUE; } /* }}} */ /* {{{ proto void dio_close(resource fd) Close the file descriptor given by fd */ PHP_FUNCTION(dio_close) { zval *r_fd; php_fd_t *f; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &r_fd) == FAILURE) { return; } ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd); zend_list_delete(Z_LVAL_P(r_fd)); } /* }}} */ /* * Local variables: * c-basic-offset: 4 * tab-width: 4 * End: * vim600: fdm=marker * vim: sw=4 ts=4 noet */ php-4.4.8/ext/dio/tests/0000755000175000017500000000000010737115146014324 5ustar derickderickphp-4.4.8/ext/dio/tests/001.phpt0000644000175000017500000000103707371753151015526 0ustar derickderick--TEST-- Check for dio presence --SKIPIF-- --POST-- --GET-- --FILE-- --EXPECT-- dio extension is availablephp-4.4.8/ext/dio/config.m40000644000175000017500000000040407443424702014670 0ustar derickderickdnl dnl $Id: config.m4,v 1.3 2002/03/12 16:16:02 sas Exp $ dnl PHP_ARG_ENABLE(dio, whether to enable direct I/O support, [ --enable-dio Enable direct I/O support]) if test "$PHP_DIO" != "no"; then PHP_NEW_EXTENSION(dio, dio.c, $ext_shared) fi php-4.4.8/ext/dio/php_dio.h0000644000175000017500000000333210736114306014752 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ */ #ifndef PHP_DIO_H #define PHP_DIO_H extern zend_module_entry dio_module_entry; #define phpext_dio_ptr &dio_module_entry #ifdef PHP_WIN32 #define PHP_DIO_API __declspec(dllexport) #else #define PHP_DIO_API #endif #ifdef ZTS #include "TSRM.h" #endif PHP_MINIT_FUNCTION(dio); PHP_MSHUTDOWN_FUNCTION(dio); PHP_RINIT_FUNCTION(dio); PHP_RSHUTDOWN_FUNCTION(dio); PHP_MINFO_FUNCTION(dio); PHP_FUNCTION(dio_open); PHP_FUNCTION(dio_truncate); PHP_FUNCTION(dio_stat); PHP_FUNCTION(dio_seek); PHP_FUNCTION(dio_read); PHP_FUNCTION(dio_write); PHP_FUNCTION(dio_fcntl); PHP_FUNCTION(dio_close); PHP_FUNCTION(dio_tcsetattr); typedef struct { int fd; } php_fd_t; #endif /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * indent-tabs-mode: t * End: */ php-4.4.8/ext/dio/EXPERIMENTAL0000644000175000017500000000000007371753151014774 0ustar derickderickphp-4.4.8/ext/fdf/0000755000175000017500000000000010737115146013146 5ustar derickderickphp-4.4.8/ext/fdf/fdf.c0000644000175000017500000012224310736114307014052 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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: fdf.c,v 1.66.2.13.2.6 2007/12/31 07:22:47 sebastian Exp $ */ /* 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); /* {{{ fdf_functions[] */ function_entry fdf_functions[] = { PHP_FE(fdf_add_template, NULL) PHP_FE(fdf_close, NULL) PHP_FE(fdf_create, NULL) PHP_FE(fdf_enum_values, NULL) PHP_FE(fdf_errno, NULL) PHP_FE(fdf_error, NULL) PHP_FE(fdf_get_ap, NULL) PHP_FE(fdf_get_encoding, NULL) PHP_FE(fdf_get_file, NULL) PHP_FE(fdf_get_flags, NULL) PHP_FE(fdf_get_opt, NULL) PHP_FE(fdf_get_status, NULL) PHP_FE(fdf_get_value, NULL) PHP_FE(fdf_get_version, NULL) PHP_FE(fdf_next_field_name, NULL) PHP_FE(fdf_open, NULL) PHP_FE(fdf_open_string, NULL) PHP_FE(fdf_remove_item, NULL) PHP_FE(fdf_save, NULL) PHP_FE(fdf_save_string, NULL) PHP_FE(fdf_set_ap, NULL) PHP_FE(fdf_set_encoding, NULL) PHP_FE(fdf_set_file, NULL) PHP_FE(fdf_set_flags, NULL) PHP_FE(fdf_set_javascript_action, NULL) PHP_FE(fdf_set_opt, NULL) PHP_FE(fdf_set_status, NULL) PHP_FE(fdf_set_submit_form_action, NULL) PHP_FE(fdf_set_value, NULL) PHP_FE(fdf_header, NULL) #ifdef HAVE_FDFTK_5 PHP_FE(fdf_add_doc_javascript, NULL) PHP_FE(fdf_get_attachment, NULL) PHP_FE(fdf_set_on_import_javascript, NULL) PHP_FE(fdf_set_target_frame, NULL) PHP_FE(fdf_set_version, NULL) #endif {NULL, NULL, NULL} }; /* }}} */ 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, STANDARD_MODULE_PROPERTIES }; #ifdef COMPILE_DL_FDF ZEND_GET_MODULE(fdf) #endif ZEND_DECLARE_MODULE_GLOBALS(fdf) #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 void php_fdf_init_globals(zend_fdf_globals *fdf_globals) { memset(fdf_globals, 0, sizeof(*fdf_globals)); } /* {{{ PHP_MINIT_FUNCTION */ PHP_MINIT_FUNCTION(fdf) { ZEND_INIT_MODULE_GLOBALS(fdf, php_fdf_init_globals, NULL); 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); /* 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) { 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); #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 bool 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 mixed 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 mixed 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) { for(p=value;*p;p++) if(*p=='\r') *p='\n'; if(lastfieldname) efree(lastfieldname); lastfieldname = estrdup(name); php_register_variable(name, value, 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 (Z_TYPE_P(callback) != IS_ARRAY && Z_TYPE_P(callback) != IS_STRING) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Wrong syntax for function name"); RETURN_FALSE; } convert_to_string_ex(&callback); 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 */ php-4.4.8/ext/fdf/tests/0000755000175000017500000000000010737115146014310 5ustar derickderickphp-4.4.8/ext/fdf/tests/02-values.phpt0000644000175000017500000000074407665102461016732 0ustar derickderick--TEST-- FDF open/save and set/get values --SKIPIF-- --POST-- --GET-- --FILE-- --EXPECT-- foo: bar bar: foo php-4.4.8/ext/fdf/tests/03-read-file.phpt0000644000175000017500000000055507665102462017265 0ustar derickderick--TEST-- FDF read file --SKIPIF-- --POST-- --GET-- --FILE-- --EXPECT-- foo: bar bar: foo php-4.4.8/ext/fdf/tests/01-general.phpt0000644000175000017500000000031607665102461017042 0ustar derickderick--TEST-- Adobe Form Data Format functions --SKIPIF-- --POST-- --GET-- --FILE-- --EXPECT-- OKphp-4.4.8/ext/fdf/tests/simple.fdf0000644000175000017500000000024407665102462016265 0ustar derickderick%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 php-4.4.8/ext/fdf/config.m40000644000175000017500000000350407736440704014665 0ustar derickderickdnl dnl $Id: config.m4,v 1.22.2.2 2003/10/01 02:53:56 sniper Exp $ 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 php-4.4.8/ext/fdf/fdf.dsp0000644000175000017500000001160207704635241014420 0ustar derickderick# 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 php4ts.lib /nologo /dll /machine:I386 # ADD LINK32 php4ts.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 php4ts_debug.lib /nologo /dll /machine:I386 # ADD LINK32 php4ts_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 php-4.4.8/ext/fdf/php_fdf.h0000644000175000017500000000566310736114307014734 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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: php_fdf.h,v 1.18.2.1.8.3 2007/12/31 07:22:47 sebastian Exp $ */ #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 */ php-4.4.8/ext/fdf/CREDITS0000644000175000017500000000002207206176566014172 0ustar derickderickFDF Uwe Steinmann php-4.4.8/ext/ftp/0000755000175000017500000000000010737115146013200 5ustar derickderickphp-4.4.8/ext/ftp/ftp.c0000644000175000017500000010327010736114307014135 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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: Andrew Skalski | | Stefan Esser (resume functions) | +----------------------------------------------------------------------+ */ /* $Id: ftp.c,v 1.68.2.22.2.7 2007/12/31 07:22:47 sebastian Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "php.h" #if HAVE_FTP #include #include #include #ifdef HAVE_UNISTD_H #include #endif #include #include #include #ifdef PHP_WIN32 #include #elif defined(NETWARE) #ifdef USE_WINSOCK /* Modified to use Winsock (NOVSOCK2.H), atleast for now */ #include #else #ifdef NEW_LIBC #include #include #include #else #include #endif #endif #else #ifdef HAVE_SYS_TYPES_H #include #endif #include #include #include #include #endif #include #if HAVE_SYS_TIME_H #include #endif #ifdef HAVE_SYS_SELECT_H #include #endif #include "ftp.h" #include "ext/standard/fsock.h" /* sends an ftp command, returns true on success, false on error. * it sends the string "cmd args\r\n" if args is non-null, or * "cmd\r\n" if args is null */ static int ftp_putcmd( ftpbuf_t *ftp, const char *cmd, const char *args); /* wrapper around send/recv to handle timeouts */ static int my_send(ftpbuf_t *ftp, int s, void *buf, size_t len); static int my_recv(ftpbuf_t *ftp, int s, void *buf, size_t len); static int my_accept(ftpbuf_t *ftp, int s, struct sockaddr *addr, socklen_t *addrlen); /* reads a line the socket , returns true on success, false on error */ static int ftp_readline(ftpbuf_t *ftp); /* reads an ftp response, returns true on success, false on error */ static int ftp_getresp(ftpbuf_t *ftp); /* sets the ftp transfer type */ static int ftp_type(ftpbuf_t *ftp, ftptype_t type); /* opens up a data stream */ static databuf_t* ftp_getdata(ftpbuf_t *ftp TSRMLS_DC); /* accepts the data connection, returns updated data buffer */ static databuf_t* data_accept(databuf_t *data, ftpbuf_t *ftp); /* closes the data connection, returns NULL */ static databuf_t* data_close(ftpbuf_t *ftp, databuf_t *data); /* generic file lister */ static char** ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC); /* IP and port conversion box */ union ipbox { struct in_addr ia[2]; unsigned short s[4]; unsigned char c[8]; }; /* {{{ ftp_open */ ftpbuf_t* ftp_open(const char *host, short port, long timeout_sec TSRMLS_DC) { ftpbuf_t *ftp; socklen_t size; struct timeval tv; /* alloc the ftp structure */ ftp = ecalloc(1, sizeof(*ftp)); tv.tv_sec = timeout_sec; tv.tv_usec = 0; ftp->fd = php_hostconnect(host, (unsigned short) (port ? port : 21), SOCK_STREAM, &tv TSRMLS_CC); if (ftp->fd == -1) { goto bail; } /* Default Settings */ ftp->timeout_sec = timeout_sec; ftp->nb = 0; size = sizeof(ftp->localaddr); memset(&ftp->localaddr, 0, size); if (getsockname(ftp->fd, (struct sockaddr*) &ftp->localaddr, &size) == -1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "getsockname failed: %s (%d)\n", strerror(errno), errno); goto bail; } if (!ftp_getresp(ftp) || ftp->resp != 220) { goto bail; } return ftp; bail: if (ftp->fd != -1) closesocket(ftp->fd); efree(ftp); return NULL; } /* }}} */ /* {{{ ftp_close */ ftpbuf_t* ftp_close(ftpbuf_t *ftp) { if (ftp == NULL) return NULL; if (ftp->data) data_close(ftp, ftp->data); if (ftp->fd != -1) { #ifdef HAVE_OPENSSL_EXT if (ftp->ssl_active) { SSL_shutdown(ftp->ssl_handle); } #endif closesocket(ftp->fd); } ftp_gc(ftp); efree(ftp); return NULL; } /* }}} */ /* {{{ ftp_gc */ void ftp_gc(ftpbuf_t *ftp) { if (ftp == NULL) return; if (ftp->pwd) { efree(ftp->pwd); ftp->pwd = NULL; } if (ftp->syst) { efree(ftp->syst); ftp->syst = NULL; } } /* }}} */ /* {{{ ftp_quit */ int ftp_quit(ftpbuf_t *ftp) { if (ftp == NULL) return 0; if (!ftp_putcmd(ftp, "QUIT", NULL)) return 0; if (!ftp_getresp(ftp) || ftp->resp != 221) return 0; if (ftp->pwd) { efree(ftp->pwd); ftp->pwd = NULL; } return 1; } /* }}} */ /* {{{ ftp_login */ int ftp_login(ftpbuf_t *ftp, const char *user, const char *pass TSRMLS_DC) { #ifdef HAVE_OPENSSL_EXT SSL_CTX *ctx = NULL; #endif if (ftp == NULL) return 0; #ifdef HAVE_OPENSSL_EXT if (ftp->use_ssl && !ftp->ssl_active) { if (!ftp_putcmd(ftp, "AUTH", "TLS")) return 0; if (!ftp_getresp(ftp)) return 0; if (ftp->resp != 234) { if (!ftp_putcmd(ftp, "AUTH", "SSL")) return 0; if (!ftp_getresp(ftp)) return 0; if (ftp->resp != 334) { ftp->use_ssl = 0; } else { ftp->old_ssl = 1; ftp->use_ssl_for_data = 1; } } /* now enable ssl if we still need to */ if (ftp->use_ssl) { ctx = SSL_CTX_new(SSLv23_client_method()); if (ctx == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "ftp_login: failed to create the SSL context"); return 0; } SSL_CTX_set_options(ctx, SSL_OP_ALL); ftp->ssl_handle = SSL_new(ctx); if (ftp->ssl_handle == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "ftp_login: failed to create the SSL handle"); SSL_CTX_free(ctx); return 0; } SSL_set_fd(ftp->ssl_handle, ftp->fd); if (SSL_connect(ftp->ssl_handle) <= 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "ftp_login: SSL/TLS handshake failed"); SSL_shutdown(ftp->ssl_handle); return 0; } ftp->ssl_active = 1; if (!ftp->old_ssl) { /* set protection buffersize to zero */ if (!ftp_putcmd(ftp, "PBSZ", "0")) return 0; if (!ftp_getresp(ftp)) return 0; /* enable data conn encryption */ if (!ftp_putcmd(ftp, "PROT", "P")) return 0; if (!ftp_getresp(ftp)) return 0; ftp->use_ssl_for_data = (ftp->resp >= 200 && ftp->resp <=299); } } } #endif if (!ftp_putcmd(ftp, "USER", user)) return 0; if (!ftp_getresp(ftp)) return 0; if (ftp->resp == 230) return 1; if (ftp->resp != 331) return 0; if (!ftp_putcmd(ftp, "PASS", pass)) return 0; if (!ftp_getresp(ftp)) return 0; return (ftp->resp == 230); } /* }}} */ /* {{{ ftp_reinit */ int ftp_reinit(ftpbuf_t *ftp) { if (ftp == NULL) return 0; ftp_gc(ftp); ftp->nb = 0; if (!ftp_putcmd(ftp, "REIN", NULL)) return 0; if (!ftp_getresp(ftp) || ftp->resp != 220) return 0; return 1; } /* }}} */ /* {{{ ftp_syst */ const char* ftp_syst(ftpbuf_t *ftp) { char *syst, *end; if (ftp == NULL) return NULL; /* default to cached value */ if (ftp->syst) return ftp->syst; if (!ftp_putcmd(ftp, "SYST", NULL)) return NULL; if (!ftp_getresp(ftp) || ftp->resp != 215) return NULL; syst = ftp->inbuf; while (*syst == ' ') { syst++; } if ((end = strchr(syst, ' '))) *end = 0; ftp->syst = estrdup(syst); if (end) *end = ' '; return ftp->syst; } /* }}} */ /* {{{ ftp_pwd */ const char* ftp_pwd(ftpbuf_t *ftp) { char *pwd, *end; if (ftp == NULL) return NULL; /* default to cached value */ if (ftp->pwd) return ftp->pwd; if (!ftp_putcmd(ftp, "PWD", NULL)) return NULL; if (!ftp_getresp(ftp) || ftp->resp != 257) return NULL; /* copy out the pwd from response */ if ((pwd = strchr(ftp->inbuf, '"')) == NULL) return NULL; if ((end = strrchr(++pwd, '"')) == NULL) return NULL; ftp->pwd = estrndup(pwd, end - pwd); return ftp->pwd; } /* }}} */ /* {{{ ftp_exec */ int ftp_exec(ftpbuf_t *ftp, const char *cmd) { if (ftp == NULL) return 0; if (!ftp_putcmd(ftp, "SITE EXEC", cmd)) return 0; if (!ftp_getresp(ftp) || ftp->resp != 200) return 0; return 1; } /* }}} */ /* {{{ ftp_chdir */ int ftp_chdir(ftpbuf_t *ftp, const char *dir) { if (ftp == NULL) return 0; if (ftp->pwd) { efree(ftp->pwd); ftp->pwd = NULL; } if (!ftp_putcmd(ftp, "CWD", dir)) return 0; if (!ftp_getresp(ftp) || ftp->resp != 250) return 0; return 1; } /* }}} */ /* {{{ ftp_cdup */ int ftp_cdup(ftpbuf_t *ftp) { if (ftp == NULL) return 0; if (ftp->pwd) { efree(ftp->pwd); ftp->pwd = NULL; } if (!ftp_putcmd(ftp, "CDUP", NULL)) return 0; if (!ftp_getresp(ftp) || ftp->resp != 250) return 0; return 1; } /* }}} */ /* {{{ ftp_mkdir */ char* ftp_mkdir(ftpbuf_t *ftp, const char *dir) { char *mkd, *end; if (ftp == NULL) return NULL; if (!ftp_putcmd(ftp, "MKD", dir)) return NULL; if (!ftp_getresp(ftp) || ftp->resp != 257) return NULL; /* copy out the dir from response */ if ((mkd = strchr(ftp->inbuf, '"')) == NULL) { mkd = estrdup(dir); return mkd; } if ((end = strrchr(++mkd, '"')) == NULL) { return NULL; } *end = 0; mkd = estrdup(mkd); *end = '"'; return mkd; } /* }}} */ /* {{{ ftp_rmdir */ int ftp_rmdir(ftpbuf_t *ftp, const char *dir) { if (ftp == NULL) return 0; if (!ftp_putcmd(ftp, "RMD", dir)) return 0; if (!ftp_getresp(ftp) || ftp->resp != 250) return 0; return 1; } /* }}} */ /* {{{ ftp_nlist */ char** ftp_nlist(ftpbuf_t *ftp, const char *path TSRMLS_DC) { return ftp_genlist(ftp, "NLST", path TSRMLS_CC); } /* }}} */ /* {{{ ftp_list */ char** ftp_list(ftpbuf_t *ftp, const char *path, int recursive TSRMLS_DC) { return ftp_genlist(ftp, ((recursive) ? "LIST -R" : "LIST"), path TSRMLS_CC); } /* }}} */ /* {{{ ftp_type */ int ftp_type(ftpbuf_t *ftp, ftptype_t type) { char typechar[2] = "?"; if (ftp == NULL) return 0; if (type == ftp->type) return 1; if (type == FTPTYPE_ASCII) typechar[0] = 'A'; else if (type == FTPTYPE_IMAGE) typechar[0] = 'I'; else return 0; if (!ftp_putcmd(ftp, "TYPE", typechar)) return 0; if (!ftp_getresp(ftp) || ftp->resp != 200) return 0; ftp->type = type; return 1; } /* }}} */ /* {{{ ftp_pasv */ int ftp_pasv(ftpbuf_t *ftp, int pasv) { char *ptr; union ipbox ipbox; unsigned long b[6]; socklen_t n; struct sockaddr *sa; struct sockaddr_in *sin; if (ftp == NULL) return 0; if (pasv && ftp->pasv == 2) return 1; ftp->pasv = 0; if (!pasv) return 1; n = sizeof(ftp->pasvaddr); memset(&ftp->pasvaddr, 0, n); sa = (struct sockaddr *) &ftp->pasvaddr; #ifdef HAVE_IPV6 if (getpeername(ftp->fd, sa, &n) < 0) return 0; if (sa->sa_family == AF_INET6) { struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) sa; char *endptr, delimiter; /* try EPSV first */ if (!ftp_putcmd(ftp, "EPSV", NULL)) return 0; if (!ftp_getresp(ftp)) return 0; if (ftp->resp == 229) { /* parse out the port */ for (ptr = ftp->inbuf; *ptr && *ptr != '('; ptr++); if (!*ptr) return 0; delimiter = *++ptr; for (n = 0; *ptr && n < 3; ptr++) { if (*ptr == delimiter) n++; } sin6->sin6_port = htons((unsigned short) strtoul(ptr, &endptr, 10)); if (ptr == endptr || *endptr != delimiter) return 0; ftp->pasv = 2; return 1; } } /* fall back to PASV */ #endif if (!ftp_putcmd(ftp, "PASV", NULL)) return 0; if (!ftp_getresp(ftp) || ftp->resp != 227) return 0; /* parse out the IP and port */ for (ptr = ftp->inbuf; *ptr && !isdigit(*ptr); ptr++); n = sscanf(ptr, "%lu,%lu,%lu,%lu,%lu,%lu", &b[0], &b[1], &b[2], &b[3], &b[4], &b[5]); if (n != 6) return 0; for (n=0; n<6; n++) ipbox.c[n] = (unsigned char) b[n]; sin = (struct sockaddr_in *) sa; sin->sin_family = AF_INET; sin->sin_addr = ipbox.ia[0]; sin->sin_port = ipbox.s[2]; ftp->pasv = 2; return 1; } /* }}} */ /* {{{ ftp_get */ int ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, int resumepos) { databuf_t *data = NULL; int lastch; size_t rcvd; char arg[11]; TSRMLS_FETCH(); if (ftp == NULL) return 0; if (!ftp_type(ftp, type)) { goto bail; } if ((data = ftp_getdata(ftp TSRMLS_CC)) == NULL) { goto bail; } ftp->data = data; if (resumepos>0) { if (resumepos > 2147483647) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "PHP cannot handle files greater then 2147483647 bytes.\n"); goto bail; } sprintf(arg, "%u", resumepos); if (!ftp_putcmd(ftp, "REST", arg)) { goto bail; } if (!ftp_getresp(ftp) || (ftp->resp != 350)) { goto bail; } } if (!ftp_putcmd(ftp, "RETR", path)) { goto bail; } if (!ftp_getresp(ftp) || (ftp->resp != 150 && ftp->resp != 125)) { goto bail; } if ((data = data_accept(data, ftp)) == NULL) { goto bail; } lastch = 0; while ((rcvd = my_recv(ftp, data->fd, data->buf, FTP_BUFSIZE))) { if (rcvd == -1) { goto bail; } if (type == FTPTYPE_ASCII) { #ifndef PHP_WIN32 char *s; #endif char *ptr = data->buf; char *e = ptr + rcvd; /* logic depends on the OS EOL * Win32 -> \r\n * Everything Else \n */ #ifdef PHP_WIN32 php_stream_write(outstream, ptr, (e - ptr)); ptr = e; #else while (e > ptr && (s = memchr(ptr, '\r', (e - ptr)))) { php_stream_write(outstream, ptr, (s - ptr)); if (*(s + 1) == '\n') { s++; php_stream_putc(outstream, '\n'); } ptr = s + 1; } #endif if (ptr < e) { php_stream_write(outstream, ptr, (e - ptr)); } } else { if (rcvd != php_stream_write(outstream, data->buf, rcvd)) goto bail; } } ftp->data = data = data_close(ftp, data); if (!ftp_getresp(ftp) || (ftp->resp != 226 && ftp->resp != 250)) { goto bail; } return 1; bail: ftp->data = data_close(ftp, data); return 0; } /* }}} */ /* {{{ ftp_put */ int ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, int startpos) { databuf_t *data = NULL; int size; char *ptr; int ch; char arg[11]; TSRMLS_FETCH(); if (ftp == NULL) return 0; if (!ftp_type(ftp, type)) goto bail; if ((data = ftp_getdata(ftp TSRMLS_CC)) == NULL) goto bail; ftp->data = data; if (startpos>0) { if (startpos > 2147483647) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "PHP cannot handle files with a size greater then 2147483647 bytes.\n"); goto bail; } sprintf(arg, "%u", startpos); if (!ftp_putcmd(ftp, "REST", arg)) { goto bail; } if (!ftp_getresp(ftp) || (ftp->resp != 350)) { goto bail; } } if (!ftp_putcmd(ftp, "STOR", path)) goto bail; if (!ftp_getresp(ftp) || (ftp->resp != 150 && ftp->resp != 125)) goto bail; if ((data = data_accept(data, ftp)) == NULL) goto bail; size = 0; ptr = data->buf; while (!php_stream_eof(instream) && (ch = php_stream_getc(instream))!=EOF) { /* flush if necessary */ if (FTP_BUFSIZE - size < 2) { if (my_send(ftp, data->fd, data->buf, size) != size) goto bail; ptr = data->buf; size = 0; } if (ch == '\n' && type == FTPTYPE_ASCII) { *ptr++ = '\r'; size++; } *ptr++ = ch; size++; } if (size && my_send(ftp, data->fd, data->buf, size) != size) goto bail; ftp->data = data = data_close(ftp, data); if (!ftp_getresp(ftp) || (ftp->resp != 226 && ftp->resp != 250)) goto bail; return 1; bail: ftp->data = data_close(ftp, data); return 0; } /* }}} */ /* {{{ ftp_size */ int ftp_size(ftpbuf_t *ftp, const char *path) { if (ftp == NULL) return -1; if (!ftp_type(ftp, FTPTYPE_IMAGE)) return -1; if (!ftp_putcmd(ftp, "SIZE", path)) return -1; if (!ftp_getresp(ftp) || ftp->resp != 213) return -1; return atoi(ftp->inbuf); } /* }}} */ /* {{{ ftp_mdtm */ time_t ftp_mdtm(ftpbuf_t *ftp, const char *path) { time_t stamp; struct tm *gmt, tmbuf; struct tm tm; char *ptr; int n; if (ftp == NULL) return -1; if (!ftp_putcmd(ftp, "MDTM", path)) return -1; if (!ftp_getresp(ftp) || ftp->resp != 213) return -1; /* parse out the timestamp */ for (ptr = ftp->inbuf; *ptr && !isdigit(*ptr); ptr++); n = sscanf(ptr, "%4u%2u%2u%2u%2u%2u", &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &tm.tm_hour, &tm.tm_min, &tm.tm_sec); if (n != 6) return -1; tm.tm_year -= 1900; tm.tm_mon--; tm.tm_isdst = -1; /* figure out the GMT offset */ stamp = time(NULL); gmt = php_gmtime_r(&stamp, &tmbuf); gmt->tm_isdst = -1; /* apply the GMT offset */ tm.tm_sec += stamp - mktime(gmt); tm.tm_isdst = gmt->tm_isdst; stamp = mktime(&tm); return stamp; } /* }}} */ /* {{{ ftp_delete */ int ftp_delete(ftpbuf_t *ftp, const char *path) { if (ftp == NULL) return 0; if (!ftp_putcmd(ftp, "DELE", path)) return 0; if (!ftp_getresp(ftp) || ftp->resp != 250) return 0; return 1; } /* }}} */ /* {{{ ftp_rename */ int ftp_rename(ftpbuf_t *ftp, const char *src, const char *dest) { if (ftp == NULL) return 0; if (!ftp_putcmd(ftp, "RNFR", src)) return 0; if (!ftp_getresp(ftp) || ftp->resp != 350) return 0; if (!ftp_putcmd(ftp, "RNTO", dest)) return 0; if (!ftp_getresp(ftp) || ftp->resp != 250) return 0; return 1; } /* }}} */ /* {{{ ftp_site */ int ftp_site(ftpbuf_t *ftp, const char *cmd) { if (ftp == NULL) return 0; if (!ftp_putcmd(ftp, "SITE", cmd)) return 0; if (!ftp_getresp(ftp) || ftp->resp < 200 || ftp->resp >= 300) return 0; return 1; } /* }}} */ /* static functions */ /* {{{ ftp_putcmd */ int ftp_putcmd(ftpbuf_t *ftp, const char *cmd, const char *args) { int size; char *data; if (strpbrk(cmd, "\r\n")) { return 0; } /* build the output buffer */ if (args && args[0]) { /* "cmd args\r\n\0" */ if (strlen(cmd) + strlen(args) + 4 > FTP_BUFSIZE) return 0; if (strpbrk(args, "\r\n")) { return 0; } size = sprintf(ftp->outbuf, "%s %s\r\n", cmd, args); } else { /* "cmd\r\n\0" */ if (strlen(cmd) + 3 > FTP_BUFSIZE) return 0; size = sprintf(ftp->outbuf, "%s\r\n", cmd); } data = ftp->outbuf; if (my_send(ftp, ftp->fd, data, size) != size) return 0; return 1; } /* }}} */ /* {{{ ftp_readline */ int ftp_readline(ftpbuf_t *ftp) { int size, rcvd; char *data, *eol; /* shift the extra to the front */ size = FTP_BUFSIZE; rcvd = 0; if (ftp->extra) { memmove(ftp->inbuf, ftp->extra, ftp->extralen); rcvd = ftp->extralen; } data = ftp->inbuf; do { size -= rcvd; for (eol = data; rcvd; rcvd--, eol++) { if (*eol == '\r') { *eol = 0; ftp->extra = eol + 1; if (rcvd > 1 && *(eol + 1) == '\n') { ftp->extra++; rcvd--; } if ((ftp->extralen = --rcvd) == 0) ftp->extra = NULL; return 1; } else if (*eol == '\n') { *eol = 0; ftp->extra = eol + 1; if ((ftp->extralen = --rcvd) == 0) ftp->extra = NULL; return 1; } } data = eol; if ((rcvd = my_recv(ftp, ftp->fd, data, size)) < 1) { return 0; } } while (size); return 0; } /* }}} */ /* {{{ ftp_getresp */ int ftp_getresp(ftpbuf_t *ftp) { char *buf; if (ftp == NULL) return 0; buf = ftp->inbuf; ftp->resp = 0; while (1) { if (!ftp_readline(ftp)) { return 0; } /* Break out when the end-tag is found */ if (isdigit(ftp->inbuf[0]) && isdigit(ftp->inbuf[1]) && isdigit(ftp->inbuf[2]) && ftp->inbuf[3] == ' ') { break; } } /* translate the tag */ if (!isdigit(ftp->inbuf[0]) || !isdigit(ftp->inbuf[1]) || !isdigit(ftp->inbuf[2])) { return 0; } ftp->resp = 100 * (ftp->inbuf[0] - '0') + 10 * (ftp->inbuf[1] - '0') + (ftp->inbuf[2] - '0'); memmove(ftp->inbuf, ftp->inbuf + 4, FTP_BUFSIZE - 4); if (ftp->extra) ftp->extra -= 4; return 1; } /* }}} */ /* {{{ my_send */ int my_send(ftpbuf_t *ftp, int s, void *buf, size_t len) { fd_set write_set; struct timeval tv; int n, size, sent; size = len; while (size) { tv.tv_sec = ftp->timeout_sec; tv.tv_usec = 0; FD_ZERO(&write_set); FD_SET(s, &write_set); n = select(s + 1, NULL, &write_set, NULL, &tv); if (n < 1) { #if !defined(PHP_WIN32) && !(defined(NETWARE) && defined(USE_WINSOCK)) if (n == 0) errno = ETIMEDOUT; #endif return -1; } #ifdef HAVE_OPENSSL_EXT if (ftp->use_ssl && ftp->fd == s && ftp->ssl_active) { sent = SSL_write(ftp->ssl_handle, buf, size); } else if (ftp->use_ssl && ftp->fd != s && ftp->use_ssl_for_data && ftp->data->ssl_active) { sent = SSL_write(ftp->data->ssl_handle, buf, size); } else #endif sent = send(s, buf, size, 0); if (sent == -1) return -1; buf = (char*) buf + sent; size -= sent; } return len; } /* }}} */ /* {{{ my_recv */ int my_recv(ftpbuf_t *ftp, int s, void *buf, size_t len) { fd_set read_set; struct timeval tv; int n, nr_bytes; tv.tv_sec = ftp->timeout_sec; tv.tv_usec = 0; FD_ZERO(&read_set); FD_SET(s, &read_set); n = select(s + 1, &read_set, NULL, NULL, &tv); if (n < 1) { #if !defined(PHP_WIN32) && !(defined(NETWARE) && defined(USE_WINSOCK)) if (n == 0) errno = ETIMEDOUT; #endif return -1; } #ifdef HAVE_OPENSSL_EXT if (ftp->use_ssl && ftp->fd == s && ftp->ssl_active) { nr_bytes = SSL_read(ftp->ssl_handle, buf, len); } else if (ftp->use_ssl && ftp->fd != s && ftp->use_ssl_for_data && ftp->data->ssl_active) { nr_bytes = SSL_read(ftp->data->ssl_handle, buf, len); } else #endif nr_bytes = recv(s, buf, len, 0); return (nr_bytes); } /* }}} */ /* {{{ data_available */ int data_available(ftpbuf_t *ftp, int s) { fd_set read_set; struct timeval tv; int n; tv.tv_sec = 0; tv.tv_usec = 1; FD_ZERO(&read_set); FD_SET(s, &read_set); n = select(s + 1, &read_set, NULL, NULL, &tv); if (n < 1) { #if !defined(PHP_WIN32) && !(defined(NETWARE) && defined(USE_WINSOCK)) if (n == 0) errno = ETIMEDOUT; #endif return 0; } return 1; } /* }}} */ /* {{{ data_writeable */ int data_writeable(ftpbuf_t *ftp, int s) { fd_set write_set; struct timeval tv; int n; tv.tv_sec = 0; tv.tv_usec = 1; FD_ZERO(&write_set); FD_SET(s, &write_set); n = select(s + 1, NULL, &write_set, NULL, &tv); if (n < 1) { #ifndef PHP_WIN32 if (n == 0) errno = ETIMEDOUT; #endif return 0; } return 1; } /* }}} */ /* {{{ my_accept */ int my_accept(ftpbuf_t *ftp, int s, struct sockaddr *addr, socklen_t *addrlen) { fd_set accept_set; struct timeval tv; int n; tv.tv_sec = ftp->timeout_sec; tv.tv_usec = 0; FD_ZERO(&accept_set); FD_SET(s, &accept_set); n = select(s + 1, &accept_set, NULL, NULL, &tv); if (n < 1) { #if !defined(PHP_WIN32) && !(defined(NETWARE) && defined(USE_WINSOCK)) if (n == 0) errno = ETIMEDOUT; #endif return -1; } return accept(s, addr, addrlen); } /* }}} */ /* {{{ ftp_getdata */ databuf_t* ftp_getdata(ftpbuf_t *ftp TSRMLS_DC) { int fd = -1; databuf_t *data; php_sockaddr_storage addr; struct sockaddr *sa; socklen_t size; union ipbox ipbox; char arg[sizeof("255, 255, 255, 255, 255, 255")]; struct timeval tv; /* ask for a passive connection if we need one */ if (ftp->pasv && !ftp_pasv(ftp, 1)) return NULL; /* alloc the data structure */ data = ecalloc(1, sizeof(*data)); data->listener = -1; data->fd = -1; data->type = ftp->type; sa = (struct sockaddr *) &ftp->localaddr; /* bind/listen */ if ((fd = socket(sa->sa_family, SOCK_STREAM, 0)) == -1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "socket() failed: %s (%d)\n", strerror(errno), errno); goto bail; } /* passive connection handler */ if (ftp->pasv) { /* clear the ready status */ ftp->pasv = 1; /* connect */ /* Win 95/98 seems not to like size > sizeof(sockaddr_in) */ size = php_sockaddr_size(&ftp->pasvaddr); tv.tv_sec = ftp->timeout_sec; tv.tv_usec = 0; if (php_connect_nonb(fd, (struct sockaddr*) &ftp->pasvaddr, size, &tv) == -1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "php_connect_nonb() failed: %s (%d)\n", strerror(errno), errno); goto bail; } data->fd = fd; ftp->data = data; return data; } /* active (normal) connection */ /* bind to a local address */ php_any_addr(sa->sa_family, &addr, 0); size = php_sockaddr_size(&addr); if (bind(fd, (struct sockaddr*) &addr, size) == -1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "bind() failed: %s (%d)\n", strerror(errno), errno); goto bail; } if (getsockname(fd, (struct sockaddr*) &addr, &size) == -1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "getsockname() failed: %s (%d)\n", strerror(errno), errno); goto bail; } if (listen(fd, 5) == -1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "listen() failed: %s (%d)\n", strerror(errno), errno); goto bail; } data->listener = fd; #ifdef HAVE_IPV6 if (sa->sa_family == AF_INET6) { /* need to use EPRT */ char eprtarg[INET6_ADDRSTRLEN + sizeof("|x||xxxxx|")]; char out[INET6_ADDRSTRLEN]; inet_ntop(AF_INET6, &((struct sockaddr_in6*) sa)->sin6_addr, out, sizeof(out)); sprintf(eprtarg, "|2|%s|%hu|", out, ntohs(((struct sockaddr_in6 *) &addr)->sin6_port)); if (!ftp_putcmd(ftp, "EPRT", eprtarg)) goto bail; if (!ftp_getresp(ftp) || ftp->resp != 200) goto bail; ftp->data = data; return data; } #endif /* send the PORT */ ipbox.ia[0] = ((struct sockaddr_in*) sa)->sin_addr; ipbox.s[2] = ((struct sockaddr_in*) &addr)->sin_port; sprintf(arg, "%u,%u,%u,%u,%u,%u", ipbox.c[0], ipbox.c[1], ipbox.c[2], ipbox.c[3], ipbox.c[4], ipbox.c[5]); if (!ftp_putcmd(ftp, "PORT", arg)) goto bail; if (!ftp_getresp(ftp) || ftp->resp != 200) goto bail; ftp->data = data; return data; bail: if (fd != -1) closesocket(fd); efree(data); return NULL; } /* }}} */ /* {{{ data_accept */ databuf_t* data_accept(databuf_t *data, ftpbuf_t *ftp) { php_sockaddr_storage addr; socklen_t size; #ifdef HAVE_OPENSSL_EXT SSL_CTX *ctx; TSRMLS_FETCH(); #endif if (data->fd != -1) goto data_accepted; size = sizeof(addr); data->fd = my_accept(ftp, data->listener, (struct sockaddr*) &addr, &size); closesocket(data->listener); data->listener = -1; if (data->fd == -1) { efree(data); return NULL; } data_accepted: #ifdef HAVE_OPENSSL_EXT /* now enable ssl if we need to */ if (ftp->use_ssl && ftp->use_ssl_for_data) { ctx = SSL_CTX_new(SSLv23_client_method()); if (ctx == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "data_accept: failed to create the SSL context"); return 0; } SSL_CTX_set_options(ctx, SSL_OP_ALL); data->ssl_handle = SSL_new(ctx); if (data->ssl_handle == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "data_accept: failed to create the SSL handle"); SSL_CTX_free(ctx); return 0; } SSL_set_fd(data->ssl_handle, data->fd); if (ftp->old_ssl) { SSL_copy_session_id(data->ssl_handle, ftp->ssl_handle); } if (SSL_connect(data->ssl_handle) <= 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "data_accept: SSL/TLS handshake failed"); SSL_shutdown(data->ssl_handle); return 0; } data->ssl_active = 1; } #endif return data; } /* }}} */ /* {{{ data_close */ databuf_t* data_close(ftpbuf_t *ftp, databuf_t *data) { if (data == NULL) return NULL; if (data->listener != -1) { #ifdef HAVE_OPENSSL_EXT if (data->ssl_active) { SSL_shutdown(data->ssl_handle); data->ssl_active = 0; } #endif closesocket(data->listener); } if (data->fd != -1) { #ifdef HAVE_OPENSSL_EXT if (data->ssl_active) { SSL_shutdown(data->ssl_handle); data->ssl_active = 0; } #endif closesocket(data->fd); } if (ftp) { ftp->data = NULL; } efree(data); return NULL; } /* }}} */ /* {{{ ftp_genlist */ char** ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC) { php_stream *tmpstream = NULL; databuf_t *data = NULL; char *ptr; int ch, lastch; int size, rcvd; int lines; char **ret = NULL; char **entry; char *text; if ((tmpstream = php_stream_fopen_tmpfile()) == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to create temporary file. Check permissions in temporary files directory."); return NULL; } if (!ftp_type(ftp, FTPTYPE_ASCII)) goto bail; if ((data = ftp_getdata(ftp TSRMLS_CC)) == NULL) goto bail; ftp->data = data; if (!ftp_putcmd(ftp, cmd, path)) goto bail; if (!ftp_getresp(ftp) || (ftp->resp != 150 && ftp->resp != 125 && ftp->resp != 226)) goto bail; /* some servers don't open a ftp-data connection if the directory is empty */ if (ftp->resp == 226) { ftp->data = data_close(ftp, data); php_stream_close(tmpstream); return ecalloc(1, sizeof(char**)); } /* pull data buffer into tmpfile */ if ((data = data_accept(data, ftp)) == NULL) goto bail; size = 0; lines = 0; lastch = 0; while ((rcvd = my_recv(ftp, data->fd, data->buf, FTP_BUFSIZE))) { if (rcvd == -1) goto bail; php_stream_write(tmpstream, data->buf, rcvd); size += rcvd; for (ptr = data->buf; rcvd; rcvd--, ptr++) { if (*ptr == '\n' && lastch == '\r') lines++; else size++; lastch = *ptr; } } ftp->data = data = data_close(ftp, data); php_stream_rewind(tmpstream); ret = emalloc((lines + 1) * sizeof(char**) + size * sizeof(char*)); entry = ret; text = (char*) (ret + lines + 1); *entry = text; lastch = 0; while ((ch = php_stream_getc(tmpstream)) != EOF) { if (ch == '\n' && lastch == '\r') { *(text - 1) = 0; *++entry = text; } else { *text++ = ch; } lastch = ch; } *entry = NULL; php_stream_close(tmpstream); if (!ftp_getresp(ftp) || (ftp->resp != 226 && ftp->resp != 250)) { efree(ret); return NULL; } return ret; bail: ftp->data = data_close(ftp, data); php_stream_close(tmpstream); if (ret) efree(ret); return NULL; } /* }}} */ /* {{{ ftp_nb_get */ int ftp_nb_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, int resumepos TSRMLS_DC) { databuf_t *data = NULL; char arg[11]; if (ftp == NULL) goto bail; if (!ftp_type(ftp, type)) { goto bail; } if ((data = ftp_getdata(ftp TSRMLS_CC)) == NULL) { goto bail; } if (resumepos>0) { sprintf(arg, "%u", resumepos); if (!ftp_putcmd(ftp, "REST", arg)) { goto bail; } if (!ftp_getresp(ftp) || (ftp->resp != 350)) { goto bail; } } if (!ftp_putcmd(ftp, "RETR", path)) { goto bail; } if (!ftp_getresp(ftp) || (ftp->resp != 150 && ftp->resp != 125)) { goto bail; } if ((data = data_accept(data, ftp)) == NULL) { goto bail; } ftp->data = data; ftp->stream = outstream; ftp->lastch = 0; ftp->nb = 1; return (ftp_nb_continue_read(ftp)); bail: ftp->data = data_close(ftp, data); return PHP_FTP_FAILED; } /* }}} */ /* {{{ ftp_nb_continue_read */ int ftp_nb_continue_read(ftpbuf_t *ftp) { databuf_t *data = NULL; char *ptr; int lastch; size_t rcvd; ftptype_t type; TSRMLS_FETCH(); data = ftp->data; /* check if there is already more data */ if (!data_available(ftp, data->fd)) { return PHP_FTP_MOREDATA; } type = ftp->type; lastch = ftp->lastch; if ((rcvd = my_recv(ftp, data->fd, data->buf, FTP_BUFSIZE))) { if (rcvd == -1) { goto bail; } if (type == FTPTYPE_ASCII) { for (ptr = data->buf; rcvd; rcvd--, ptr++) { if (lastch == '\r' && *ptr != '\n') php_stream_putc(ftp->stream, '\r'); if (*ptr != '\r') php_stream_putc(ftp->stream, *ptr); lastch = *ptr; } } else { if (rcvd != php_stream_write(ftp->stream, data->buf, rcvd)) goto bail; } ftp->lastch = lastch; return PHP_FTP_MOREDATA; } if (type == FTPTYPE_ASCII && lastch == '\r') php_stream_putc(ftp->stream, '\r'); ftp->data = data = data_close(ftp, data); if (!ftp_getresp(ftp) || (ftp->resp != 226 && ftp->resp != 250)) { goto bail; } ftp->nb = 0; return PHP_FTP_FINISHED; bail: ftp->nb = 0; ftp->data = data_close(ftp, data); return PHP_FTP_FAILED; } /* }}} */ /* {{{ ftp_nb_put */ int ftp_nb_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, int startpos TSRMLS_DC) { databuf_t *data = NULL; char arg[11]; if (ftp == NULL) return 0; if (!ftp_type(ftp, type)) goto bail; if ((data = ftp_getdata(ftp TSRMLS_CC)) == NULL) goto bail; if (startpos>0) { if (startpos > 2147483647) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "PHP cannot handle files with a size greater then 2147483647 bytes.\n"); goto bail; } sprintf(arg, "%u", startpos); if (!ftp_putcmd(ftp, "REST", arg)) { goto bail; } if (!ftp_getresp(ftp) || (ftp->resp != 350)) { goto bail; } } if (!ftp_putcmd(ftp, "STOR", path)) goto bail; if (!ftp_getresp(ftp) || (ftp->resp != 150 && ftp->resp != 125)) goto bail; if ((data = data_accept(data, ftp)) == NULL) goto bail; ftp->data = data; ftp->stream = instream; ftp->lastch = 0; ftp->nb = 1; return (ftp_nb_continue_write(ftp)); bail: ftp->data = data_close(ftp, data); return PHP_FTP_FAILED; } /* }}} */ /* {{{ ftp_nb_continue_write */ int ftp_nb_continue_write(ftpbuf_t *ftp) { int size; char *ptr; int ch; TSRMLS_FETCH(); /* check if we can write more data */ if (!data_writeable(ftp, ftp->data->fd)) { return PHP_FTP_MOREDATA; } size = 0; ptr = ftp->data->buf; while (!php_stream_eof(ftp->stream) && (ch = php_stream_getc(ftp->stream))!=EOF) { if (ch == '\n' && ftp->type == FTPTYPE_ASCII) { *ptr++ = '\r'; size++; } *ptr++ = ch; size++; /* flush if necessary */ if (FTP_BUFSIZE - size < 2) { if (my_send(ftp, ftp->data->fd, ftp->data->buf, size) != size) goto bail; return PHP_FTP_MOREDATA; } } if (size && my_send(ftp, ftp->data->fd, ftp->data->buf, size) != size) goto bail; ftp->data = data_close(ftp, ftp->data); if (!ftp_getresp(ftp) || (ftp->resp != 226 && ftp->resp != 250)) goto bail; ftp->nb = 0; return PHP_FTP_FINISHED; bail: ftp->data = data_close(ftp, ftp->data); ftp->nb = 0; return PHP_FTP_FAILED; } /* }}} */ #endif /* HAVE_FTP */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: sw=4 ts=4 fdm=marker * vim<600: sw=4 ts=4 */ php-4.4.8/ext/ftp/ftp.h0000644000175000017500000001605010736114307014141 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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: Andrew Skalski | | Stefan Esser (resume functions) | +----------------------------------------------------------------------+ */ /* $Id: ftp.h,v 1.30.2.3.4.4 2007/12/31 07:22:47 sebastian Exp $ */ #ifndef FTP_H #define FTP_H #include "php_network.h" #include #ifdef HAVE_NETINET_IN_H #include #endif #define FTP_DEFAULT_TIMEOUT 90 #define FTP_DEFAULT_AUTOSEEK 1 #define PHP_FTP_FAILED 0 #define PHP_FTP_FINISHED 1 #define PHP_FTP_MOREDATA 2 /* XXX this should be configurable at runtime XXX */ #define FTP_BUFSIZE 4096 typedef enum ftptype { FTPTYPE_ASCII=1, FTPTYPE_IMAGE } ftptype_t; typedef struct databuf { int listener; /* listener socket */ int fd; /* data connection */ ftptype_t type; /* transfer type */ char buf[FTP_BUFSIZE]; /* data buffer */ #ifdef HAVE_OPENSSL_EXT SSL *ssl_handle; /* ssl handle */ int ssl_active; /* flag if ssl is active or not */ #endif } databuf_t; typedef struct ftpbuf { int fd; /* control connection */ php_sockaddr_storage localaddr; /* local address */ int resp; /* last response code */ char inbuf[FTP_BUFSIZE]; /* last response text */ char *extra; /* extra characters */ int extralen; /* number of extra chars */ char outbuf[FTP_BUFSIZE]; /* command output buffer */ char *pwd; /* cached pwd */ char *syst; /* cached system type */ ftptype_t type; /* current transfer type */ int pasv; /* 0=off; 1=pasv; 2=ready */ php_sockaddr_storage pasvaddr; /* passive mode address */ long timeout_sec; /* User configureable timeout (seconds) */ int autoseek; /* User configureable autoseek flag */ int nb; /* "nonblocking" transfer in progress */ databuf_t *data; /* Data connection for "nonblocking" transfers */ php_stream *stream; /* output stream for "nonblocking" transfers */ int lastch; /* last char of previous call */ int direction; /* recv = 0 / send = 1 */ int closestream;/* close or not close stream */ #ifdef HAVE_OPENSSL_EXT int use_ssl; /* enable(1) or disable(0) ssl */ int use_ssl_for_data; /* en/disable ssl for the dataconnection */ int old_ssl; /* old mode = forced data encryption */ SSL *ssl_handle; /* handle for control connection */ int ssl_active; /* ssl active on control conn */ #endif } ftpbuf_t; /* open a FTP connection, returns ftpbuf (NULL on error) * port is the ftp port in network byte order, or 0 for the default */ ftpbuf_t* ftp_open(const char *host, short port, long timeout_sec TSRMLS_DC); /* quits from the ftp session (it still needs to be closed) * return true on success, false on error */ int ftp_quit(ftpbuf_t *ftp); /* frees up any cached data held in the ftp buffer */ void ftp_gc(ftpbuf_t *ftp); /* close the FTP connection and return NULL */ ftpbuf_t* ftp_close(ftpbuf_t *ftp); /* logs into the FTP server, returns true on success, false on error */ int ftp_login(ftpbuf_t *ftp, const char *user, const char *pass TSRMLS_DC); /* reinitializes the connection, returns true on success, false on error */ int ftp_reinit(ftpbuf_t *ftp); /* returns the remote system type (NULL on error) */ const char* ftp_syst(ftpbuf_t *ftp); /* returns the present working directory (NULL on error) */ const char* ftp_pwd(ftpbuf_t *ftp); /* exec a command [special features], return true on success, false on error */ int ftp_exec(ftpbuf_t *ftp, const char *cmd); /* changes directories, return true on success, false on error */ int ftp_chdir(ftpbuf_t *ftp, const char *dir); /* changes to parent directory, return true on success, false on error */ int ftp_cdup(ftpbuf_t *ftp); /* creates a directory, return the directory name on success, NULL on error. * the return value must be freed */ char* ftp_mkdir(ftpbuf_t *ftp, const char *dir); /* removes a directory, return true on success, false on error */ int ftp_rmdir(ftpbuf_t *ftp, const char *dir); /* returns a NULL-terminated array of filenames in the given path * or NULL on error. the return array must be freed (but don't * free the array elements) */ char** ftp_nlist(ftpbuf_t *ftp, const char *path TSRMLS_DC); /* returns a NULL-terminated array of lines returned by the ftp * LIST command for the given path or NULL on error. the return * array must be freed (but don't * free the array elements) */ char** ftp_list(ftpbuf_t *ftp, const char *path, int recursive TSRMLS_DC); /* switches passive mode on or off * returns true on success, false on error */ int ftp_pasv(ftpbuf_t *ftp, int pasv); /* retrieves a file and saves its contents to outfp * returns true on success, false on error */ int ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, int resumepos); /* stores the data from a file, socket, or process as a file on the remote server * returns true on success, false on error */ int ftp_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, int startpos); /* returns the size of the given file, or -1 on error */ int ftp_size(ftpbuf_t *ftp, const char *path); /* returns the last modified time of the given file, or -1 on error */ time_t ftp_mdtm(ftpbuf_t *ftp, const char *path); /* renames a file on the server */ int ftp_rename(ftpbuf_t *ftp, const char *src, const char *dest); /* deletes the file from the server */ int ftp_delete(ftpbuf_t *ftp, const char *path); /* sends a SITE command to the server */ int ftp_site(ftpbuf_t *ftp, const char *cmd); /* retrieves part of a file and saves its contents to outfp * returns true on success, false on error */ int ftp_nb_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, int resumepos TSRMLS_DC); /* stores the data from a file, socket, or process as a file on the remote server * returns true on success, false on error */ int ftp_nb_put(ftpbuf_t *ftp, const char *path, php_stream *instream, ftptype_t type, int startpos TSRMLS_DC); /* continues a previous nb_(f)get command */ int ftp_nb_continue_read(ftpbuf_t *ftp); /* continues a previous nb_(f)put command */ int ftp_nb_continue_write(ftpbuf_t *ftp); #endif php-4.4.8/ext/ftp/config.m40000644000175000017500000000046507443425131014712 0ustar derickderickdnl dnl $Id: config.m4,v 1.7 2002/03/12 16:18:33 sas Exp $ dnl PHP_ARG_ENABLE(ftp,whether to enable FTP support, [ --enable-ftp Enable FTP support]) if test "$PHP_FTP" = "yes"; then AC_DEFINE(HAVE_FTP,1,[Whether you want FTP support]) PHP_NEW_EXTENSION(ftp, php_ftp.c ftp.c, $ext_shared) fi php-4.4.8/ext/ftp/php_ftp.c0000644000175000017500000007465010736114307015015 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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: Andrew Skalski | | Stefan Esser (resume functions) | +----------------------------------------------------------------------+ */ /* $Id: php_ftp.c,v 1.74.2.15.2.3 2007/12/31 07:22:47 sebastian Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "php.h" #ifdef NETWARE #ifdef USE_WINSOCK #include #else #ifndef NEW_LIBC #include #endif #endif #endif #if HAVE_FTP #include "ext/standard/info.h" #include "ext/standard/file.h" #include "php_ftp.h" #include "ftp.h" static int le_ftpbuf; #define le_ftpbuf_name "FTP Buffer" function_entry php_ftp_functions[] = { PHP_FE(ftp_connect, NULL) #ifdef HAVE_OPENSSL_EXT PHP_FE(ftp_ssl_connect, NULL) #endif PHP_FE(ftp_login, NULL) PHP_FE(ftp_pwd, NULL) PHP_FE(ftp_cdup, NULL) PHP_FE(ftp_chdir, NULL) PHP_FE(ftp_exec, NULL) PHP_FE(ftp_mkdir, NULL) PHP_FE(ftp_rmdir, NULL) PHP_FE(ftp_nlist, NULL) PHP_FE(ftp_rawlist, NULL) PHP_FE(ftp_systype, NULL) PHP_FE(ftp_pasv, NULL) PHP_FE(ftp_get, NULL) PHP_FE(ftp_fget, NULL) PHP_FE(ftp_put, NULL) PHP_FE(ftp_fput, NULL) PHP_FE(ftp_size, NULL) PHP_FE(ftp_mdtm, NULL) PHP_FE(ftp_rename, NULL) PHP_FE(ftp_delete, NULL) PHP_FE(ftp_site, NULL) PHP_FE(ftp_close, NULL) PHP_FE(ftp_set_option, NULL) PHP_FE(ftp_get_option, NULL) PHP_FE(ftp_nb_fget, NULL) PHP_FE(ftp_nb_get, NULL) PHP_FE(ftp_nb_continue, NULL) PHP_FE(ftp_nb_put, NULL) PHP_FE(ftp_nb_fput, NULL) PHP_FALIAS(ftp_quit, ftp_close, NULL) {NULL, NULL, NULL} }; zend_module_entry php_ftp_module_entry = { STANDARD_MODULE_HEADER, "ftp", php_ftp_functions, PHP_MINIT(ftp), NULL, NULL, NULL, PHP_MINFO(ftp), NO_VERSION_YET, STANDARD_MODULE_PROPERTIES }; #ifdef COMPILE_DL_FTP ZEND_GET_MODULE(php_ftp) #endif static void ftp_destructor_ftpbuf(zend_rsrc_list_entry *rsrc TSRMLS_DC) { ftpbuf_t *ftp = (ftpbuf_t *)rsrc->ptr; ftp_close(ftp); } PHP_MINIT_FUNCTION(ftp) { le_ftpbuf = zend_register_list_destructors_ex(ftp_destructor_ftpbuf, NULL, le_ftpbuf_name, module_number); REGISTER_LONG_CONSTANT("FTP_ASCII", FTPTYPE_ASCII, CONST_PERSISTENT | CONST_CS); REGISTER_LONG_CONSTANT("FTP_TEXT", FTPTYPE_ASCII, CONST_PERSISTENT | CONST_CS); REGISTER_LONG_CONSTANT("FTP_BINARY", FTPTYPE_IMAGE, CONST_PERSISTENT | CONST_CS); REGISTER_LONG_CONSTANT("FTP_IMAGE", FTPTYPE_IMAGE, CONST_PERSISTENT | CONST_CS); REGISTER_LONG_CONSTANT("FTP_AUTORESUME", PHP_FTP_AUTORESUME, CONST_PERSISTENT | CONST_CS); REGISTER_LONG_CONSTANT("FTP_TIMEOUT_SEC", PHP_FTP_OPT_TIMEOUT_SEC, CONST_PERSISTENT | CONST_CS); REGISTER_LONG_CONSTANT("FTP_AUTOSEEK", PHP_FTP_OPT_AUTOSEEK, CONST_PERSISTENT | CONST_CS); REGISTER_LONG_CONSTANT("FTP_FAILED", PHP_FTP_FAILED, CONST_PERSISTENT | CONST_CS); REGISTER_LONG_CONSTANT("FTP_FINISHED", PHP_FTP_FINISHED, CONST_PERSISTENT | CONST_CS); REGISTER_LONG_CONSTANT("FTP_MOREDATA", PHP_FTP_MOREDATA, CONST_PERSISTENT | CONST_CS); return SUCCESS; } PHP_MINFO_FUNCTION(ftp) { php_info_print_table_start(); php_info_print_table_row(2, "FTP support", "enabled"); php_info_print_table_end(); } #define XTYPE(xtype, mode) { \ if (mode != FTPTYPE_ASCII && mode != FTPTYPE_IMAGE) { \ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Mode must be FTP_ASCII or FTP_BINARY"); \ RETURN_FALSE; \ } \ xtype = mode; \ } /* {{{ proto resource ftp_connect(string host [, int port [, int timeout]]) Opens a FTP stream */ PHP_FUNCTION(ftp_connect) { ftpbuf_t *ftp; char *host; int host_len; long port = 0; long timeout_sec = FTP_DEFAULT_TIMEOUT; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ll", &host, &host_len, &port, &timeout_sec) == FAILURE) { return; } if (timeout_sec <= 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Timeout has to be greater than 0"); RETURN_FALSE; } /* connect */ ftp = ftp_open(host, (short)port, timeout_sec TSRMLS_CC); if (ftp == NULL) { RETURN_FALSE; } /* autoseek for resuming */ ftp->autoseek = FTP_DEFAULT_AUTOSEEK; #ifdef HAVE_OPENSSL_EXT /* disable ssl */ ftp->use_ssl = 0; #endif ZEND_REGISTER_RESOURCE(return_value, ftp, le_ftpbuf); } /* }}} */ #ifdef HAVE_OPENSSL_EXT /* {{{ proto resource ftp_ssl_connect(string host [, int port [, int timeout]]) Opens a FTP-SSL stream */ PHP_FUNCTION(ftp_ssl_connect) { ftpbuf_t *ftp; char *host; int host_len; long port = 0; long timeout_sec = FTP_DEFAULT_TIMEOUT; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|ll", &host, &host_len, &port, &timeout_sec) == FAILURE) { return; } if (timeout_sec <= 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Timeout has to be greater than 0"); RETURN_FALSE; } /* connect */ ftp = ftp_open(host, (short)port, timeout_sec TSRMLS_CC); if (ftp == NULL) { RETURN_FALSE; } /* autoseek for resuming */ ftp->autoseek = FTP_DEFAULT_AUTOSEEK; /* enable ssl */ ftp->use_ssl = 1; ZEND_REGISTER_RESOURCE(return_value, ftp, le_ftpbuf); } /* }}} */ #endif /* {{{ proto bool ftp_login(resource stream, string username, string password) Logs into the FTP server */ PHP_FUNCTION(ftp_login) { zval *z_ftp; ftpbuf_t *ftp; char *user, *pass; int user_len, pass_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &z_ftp, &user, &user_len, &pass, &pass_len) == FAILURE) { return; } ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); /* log in */ if (!ftp_login(ftp, user, pass TSRMLS_CC)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf); RETURN_FALSE; } RETURN_TRUE; } /* }}} */ /* {{{ proto string ftp_pwd(resource stream) Returns the present working directory */ PHP_FUNCTION(ftp_pwd) { zval *z_ftp; ftpbuf_t *ftp; const char *pwd; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_ftp) == FAILURE) { return; } ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); pwd = ftp_pwd(ftp); if (pwd == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf); RETURN_FALSE; } RETURN_STRING((char*) pwd, 1); } /* }}} */ /* {{{ proto bool ftp_cdup(resource stream) Changes to the parent directory */ PHP_FUNCTION(ftp_cdup) { zval *z_ftp; ftpbuf_t *ftp; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_ftp) == FAILURE) { return; } ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); if (!ftp_cdup(ftp)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf); RETURN_FALSE; } RETURN_TRUE; } /* }}} */ /* {{{ proto bool ftp_chdir(resource stream, string directory) Changes directories */ PHP_FUNCTION(ftp_chdir) { zval *z_ftp; ftpbuf_t *ftp; char *dir; int dir_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &dir, &dir_len) == FAILURE) { return; } ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); /* change directories */ if (!ftp_chdir(ftp, dir)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf); RETURN_FALSE; } RETURN_TRUE; } /* }}} */ /* {{{ proto bool ftp_exec(resource stream, string command) Requests execution of a program on the FTP server */ PHP_FUNCTION(ftp_exec) { pval *z_ftp; ftpbuf_t *ftp; char *cmd; int cmd_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &cmd, &cmd_len) == FAILURE) { return; } ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); /* execute serverside command */ if (!ftp_exec(ftp, cmd)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf); RETURN_FALSE; } RETURN_TRUE; } /* }}} */ /* {{{ proto string ftp_mkdir(resource stream, string directory) Creates a directory and returns the absolute path for the new directory or false on error */ PHP_FUNCTION(ftp_mkdir) { zval *z_ftp; ftpbuf_t *ftp; char *dir, *tmp; int dir_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &dir, &dir_len) == FAILURE) { return; } ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); /* create directorie */ if (NULL == (tmp = ftp_mkdir(ftp, dir))) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf); RETURN_FALSE; } RETURN_STRING(tmp, 0); } /* }}} */ /* {{{ proto bool ftp_rmdir(resource stream, string directory) Removes a directory */ PHP_FUNCTION(ftp_rmdir) { zval *z_ftp; ftpbuf_t *ftp; char *dir; int dir_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &dir, &dir_len) == FAILURE) { return; } ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); /* remove directorie */ if (!ftp_rmdir(ftp, dir)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf); RETURN_FALSE; } RETURN_TRUE; } /* }}} */ /* {{{ proto array ftp_nlist(resource stream, string directory) Returns an array of filenames in the given directory */ PHP_FUNCTION(ftp_nlist) { zval *z_ftp; ftpbuf_t *ftp; char **nlist, **ptr, *dir; int dir_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &dir, &dir_len) == FAILURE) { return; } ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); /* get list of files */ if (NULL == (nlist = ftp_nlist(ftp, dir TSRMLS_CC))) { RETURN_FALSE; } array_init(return_value); for (ptr = nlist; *ptr; ptr++) add_next_index_string(return_value, *ptr, 1); efree(nlist); } /* }}} */ /* {{{ proto array ftp_rawlist(resource stream, string directory [, bool recursive]) Returns a detailed listing of a directory as an array of output lines */ PHP_FUNCTION(ftp_rawlist) { zval *z_ftp; ftpbuf_t *ftp; char **llist, **ptr, *dir; int dir_len; zend_bool recursive = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|b", &z_ftp, &dir, &dir_len, &recursive) == FAILURE) { return; } ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); /* get raw directory listing */ if (NULL == (llist = ftp_list(ftp, dir, recursive TSRMLS_CC))) { RETURN_FALSE; } array_init(return_value); for (ptr = llist; *ptr; ptr++) add_next_index_string(return_value, *ptr, 1); efree(llist); } /* }}} */ /* {{{ proto string ftp_systype(resource stream) Returns the system type identifier */ PHP_FUNCTION(ftp_systype) { zval *z_ftp; ftpbuf_t *ftp; const char *syst; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_ftp) == FAILURE) { return; } ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); if (NULL == (syst = ftp_syst(ftp))) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf); RETURN_FALSE; } RETURN_STRING((char*) syst, 1); } /* }}} */ /* {{{ proto bool ftp_fget(resource stream, resource fp, string remote_file, int mode[, int resumepos]) Retrieves a file from the FTP server and writes it to an open file */ PHP_FUNCTION(ftp_fget) { zval *z_ftp, *z_file; ftpbuf_t *ftp; ftptype_t xtype; php_stream *stream; char *file; int file_len; long mode, resumepos=0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrsl|l", &z_ftp, &z_file, &file, &file_len, &mode, &resumepos) == FAILURE) { return; } ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); php_stream_from_zval(stream, &z_file); XTYPE(xtype, mode); /* ignore autoresume if autoseek is switched off */ if (!ftp->autoseek && resumepos == PHP_FTP_AUTORESUME) { resumepos = 0; } if (ftp->autoseek && resumepos) { /* if autoresume is wanted seek to end */ if (resumepos == PHP_FTP_AUTORESUME) { php_stream_seek(stream, 0, SEEK_END); resumepos = php_stream_tell(stream); } else { php_stream_seek(stream, resumepos, SEEK_SET); } } if (!ftp_get(ftp, stream, file, xtype, resumepos)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf); RETURN_FALSE; } RETURN_TRUE; } /* }}} */ /* {{{ proto bool ftp_nb_fget(resource stream, resource fp, string remote_file, int mode[, int resumepos]) Retrieves a file from the FTP server asynchronly and writes it to an open file */ PHP_FUNCTION(ftp_nb_fget) { zval *z_ftp, *z_file; ftpbuf_t *ftp; ftptype_t xtype; php_stream *stream; char *file; int file_len, ret; long mode, resumepos=0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrsl|l", &z_ftp, &z_file, &file, &file_len, &mode, &resumepos) == FAILURE) { return; } ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); php_stream_from_zval(stream, &z_file); XTYPE(xtype, mode); /* ignore autoresume if autoseek is switched off */ if (!ftp->autoseek && resumepos == PHP_FTP_AUTORESUME) { resumepos = 0; } if (ftp->autoseek && resumepos) { /* if autoresume is wanted seek to end */ if (resumepos == PHP_FTP_AUTORESUME) { php_stream_seek(stream, 0, SEEK_END); resumepos = php_stream_tell(stream); } else { php_stream_seek(stream, resumepos, SEEK_SET); } } /* configuration */ ftp->direction = 0; /* recv */ ftp->closestream = 0; /* do not close */ if ((ret = ftp_nb_get(ftp, stream, file, xtype, resumepos TSRMLS_CC)) == PHP_FTP_FAILED) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf); RETURN_LONG(ret); } RETURN_LONG(ret); } /* }}} */ /* {{{ proto bool ftp_pasv(resource stream, bool pasv) Turns passive mode on or off */ PHP_FUNCTION(ftp_pasv) { zval *z_ftp; ftpbuf_t *ftp; zend_bool pasv; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rb", &z_ftp, &pasv) == FAILURE) { return; } ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); if (!ftp_pasv(ftp, pasv ? 1 : 0)) { RETURN_FALSE; } RETURN_TRUE; } /* }}} */ /* {{{ proto bool ftp_get(resource stream, string local_file, string remote_file, int mode[, int resume_pos]) Retrieves a file from the FTP server and writes it to a local file */ PHP_FUNCTION(ftp_get) { zval *z_ftp; ftpbuf_t *ftp; ftptype_t xtype; php_stream *outstream; char *local, *remote; int local_len, remote_len; long mode, resumepos=0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rssl|l", &z_ftp, &local, &local_len, &remote, &remote_len, &mode, &resumepos) == FAILURE) { return; } ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); XTYPE(xtype, mode); /* ignore autoresume if autoseek is switched off */ if (!ftp->autoseek && resumepos == PHP_FTP_AUTORESUME) { resumepos = 0; } if (php_check_open_basedir(local TSRMLS_CC)) { RETURN_FALSE; } #ifdef PHP_WIN32 mode = FTPTYPE_IMAGE; #endif if (ftp->autoseek && resumepos) { if (PG(safe_mode) && (!php_checkuid(local, mode == FTPTYPE_ASCII ? "rt+" : "rb+", CHECKUID_CHECK_MODE_PARAM))) { RETURN_FALSE; } outstream = php_stream_fopen(local, mode == FTPTYPE_ASCII ? "rt+" : "rb+", NULL); if (outstream == NULL) { if (PG(safe_mode) && (!php_checkuid(local, mode == FTPTYPE_ASCII ? "wt" : "wb", CHECKUID_CHECK_MODE_PARAM))) { RETURN_FALSE; } outstream = php_stream_fopen(local, mode == FTPTYPE_ASCII ? "wt" : "wb", NULL); } if (outstream != NULL) { /* if autoresume is wanted seek to end */ if (resumepos == PHP_FTP_AUTORESUME) { php_stream_seek(outstream, 0, SEEK_END); resumepos = php_stream_tell(outstream); } else { php_stream_seek(outstream, resumepos, SEEK_SET); } } } else { if (PG(safe_mode) && (!php_checkuid(local, mode == FTPTYPE_ASCII ? "wt" : "wb", CHECKUID_CHECK_MODE_PARAM))) { RETURN_FALSE; } outstream = php_stream_fopen(local, mode == FTPTYPE_ASCII ? "wt" : "wb", NULL); } if (outstream == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error opening %s", local); RETURN_FALSE; } if (!ftp_get(ftp, outstream, remote, xtype, resumepos)) { php_stream_close(outstream); VCWD_UNLINK(local); php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf); RETURN_FALSE; } php_stream_close(outstream); RETURN_TRUE; } /* }}} */ /* {{{ proto int ftp_nb_get(resource stream, string local_file, string remote_file, int mode[, int resume_pos]) Retrieves a file from the FTP server nbhronly and writes it to a local file */ PHP_FUNCTION(ftp_nb_get) { zval *z_ftp; ftpbuf_t *ftp; ftptype_t xtype; php_stream *outstream; char *local, *remote; int local_len, remote_len, ret; long mode, resumepos=0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rssl|l", &z_ftp, &local, &local_len, &remote, &remote_len, &mode, &resumepos) == FAILURE) { return; } ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); XTYPE(xtype, mode); /* ignore autoresume if autoseek is switched off */ if (!ftp->autoseek && resumepos == PHP_FTP_AUTORESUME) { resumepos = 0; } if (php_check_open_basedir(local TSRMLS_CC)) { RETURN_FALSE; } if (ftp->autoseek && resumepos) { if (PG(safe_mode) && (!php_checkuid(local, mode == FTPTYPE_ASCII ? "rt+" : "rb+", CHECKUID_CHECK_MODE_PARAM))) { RETURN_FALSE; } outstream = php_stream_fopen(local, mode == FTPTYPE_ASCII ? "rt+" : "rb+", NULL); if (outstream == NULL) { if (PG(safe_mode) && (!php_checkuid(local, mode == FTPTYPE_ASCII ? "wt" : "wb", CHECKUID_CHECK_MODE_PARAM))) { RETURN_FALSE; } outstream = php_stream_fopen(local, mode == FTPTYPE_ASCII ? "wt" : "wb", NULL); } if (outstream != NULL) { /* if autoresume is wanted seek to end */ if (resumepos == PHP_FTP_AUTORESUME) { php_stream_seek(outstream, 0, SEEK_END); resumepos = php_stream_tell(outstream); } else { php_stream_seek(outstream, resumepos, SEEK_SET); } } } else { if (PG(safe_mode) && (!php_checkuid(local, mode == FTPTYPE_ASCII ? "wt" : "wb", CHECKUID_CHECK_MODE_PARAM))) { RETURN_FALSE; } outstream = php_stream_fopen(local, mode == FTPTYPE_ASCII ? "wt" : "wb", NULL); } if (outstream == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error opening %s", local); RETURN_FALSE; } /* configuration */ ftp->direction = 0; /* recv */ ftp->closestream = 1; /* do close */ if ((ret = ftp_nb_get(ftp, outstream, remote, xtype, resumepos TSRMLS_CC)) == PHP_FTP_FAILED) { php_stream_close(outstream); VCWD_UNLINK(local); php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf); RETURN_LONG(PHP_FTP_FAILED); } if (ret == PHP_FTP_FINISHED) { php_stream_close(outstream); } RETURN_LONG(ret); } /* }}} */ /* {{{ proto int ftp_nb_continue(resource stream) Continues retrieving/sending a file nbronously */ PHP_FUNCTION(ftp_nb_continue) { zval *z_ftp; ftpbuf_t *ftp; int ret; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_ftp) == FAILURE) { return; } ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); if (!ftp->nb) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "no nbronous transfer to continue."); RETURN_LONG(PHP_FTP_FAILED); } if (ftp->direction) { ret=ftp_nb_continue_write(ftp); } else { ret=ftp_nb_continue_read(ftp); } if (ret != PHP_FTP_MOREDATA && ftp->closestream) { php_stream_close(ftp->stream); } if (ret == PHP_FTP_FAILED) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf); } RETURN_LONG(ret); } /* }}} */ /* {{{ proto bool ftp_fput(resource stream, string remote_file, resource fp, int mode[, int startpos]) Stores a file from an open file to the FTP server */ PHP_FUNCTION(ftp_fput) { zval *z_ftp, *z_file; ftpbuf_t *ftp; ftptype_t xtype; int remote_len; long mode, startpos=0; php_stream *stream; char *remote; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsrl|l", &z_ftp, &remote, &remote_len, &z_file, &mode, &startpos) == FAILURE) { return; } ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); php_stream_from_zval(stream, &z_file); XTYPE(xtype, mode); /* ignore autoresume if autoseek is switched off */ if (!ftp->autoseek && startpos == PHP_FTP_AUTORESUME) { startpos = 0; } if (ftp->autoseek && startpos) { /* if autoresume is wanted ask for remote size */ if (startpos == PHP_FTP_AUTORESUME) { startpos = ftp_size(ftp, remote); if (startpos < 0) { startpos = 0; } } if (startpos) { php_stream_seek(stream, startpos, SEEK_SET); } } if (!ftp_put(ftp, remote, stream, xtype, startpos)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf); RETURN_FALSE; } RETURN_TRUE; } /* }}} */ /* {{{ proto bool ftp_nb_fput(resource stream, string remote_file, resource fp, int mode[, int startpos]) Stores a file from an open file to the FTP server nbronly */ PHP_FUNCTION(ftp_nb_fput) { zval *z_ftp, *z_file; ftpbuf_t *ftp; ftptype_t xtype; int remote_len, ret; long mode, startpos=0; php_stream *stream; char *remote; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsrl|l", &z_ftp, &remote, &remote_len, &z_file, &mode, &startpos) == FAILURE) { return; } ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); php_stream_from_zval(stream, &z_file); XTYPE(xtype, mode); /* ignore autoresume if autoseek is switched off */ if (!ftp->autoseek && startpos == PHP_FTP_AUTORESUME) { startpos = 0; } if (ftp->autoseek && startpos) { /* if autoresume is wanted ask for remote size */ if (startpos == PHP_FTP_AUTORESUME) { startpos = ftp_size(ftp, remote); if (startpos < 0) { startpos = 0; } } if (startpos) { php_stream_seek(stream, startpos, SEEK_SET); } } /* configuration */ ftp->direction = 1; /* send */ ftp->closestream = 0; /* do not close */ if (((ret = ftp_nb_put(ftp, remote, stream, xtype, startpos TSRMLS_CC)) == PHP_FTP_FAILED)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf); RETURN_LONG(ret); } RETURN_LONG(ret); } /* }}} */ /* {{{ proto bool ftp_put(resource stream, string remote_file, string local_file, int mode[, int startpos]) Stores a file on the FTP server */ PHP_FUNCTION(ftp_put) { zval *z_ftp; ftpbuf_t *ftp; ftptype_t xtype; char *remote, *local; int remote_len, local_len; long mode, startpos=0; php_stream * instream; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rssl|l", &z_ftp, &remote, &remote_len, &local, &local_len, &mode, &startpos) == FAILURE) { return; } ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); XTYPE(xtype, mode); if (php_check_open_basedir(local TSRMLS_CC)) { RETURN_FALSE; } if (PG(safe_mode) && (!php_checkuid(local, mode == FTPTYPE_ASCII ? "rt" : "rb", CHECKUID_CHECK_MODE_PARAM))) { RETURN_FALSE; } instream = php_stream_fopen(local, mode == FTPTYPE_ASCII ? "rt" : "rb", NULL); if (instream == NULL) { RETURN_FALSE; } /* ignore autoresume if autoseek is switched off */ if (!ftp->autoseek && startpos == PHP_FTP_AUTORESUME) { startpos = 0; } if (ftp->autoseek && startpos) { /* if autoresume is wanted ask for remote size */ if (startpos == PHP_FTP_AUTORESUME) { startpos = ftp_size(ftp, remote); if (startpos < 0) { startpos = 0; } } if (startpos) { php_stream_seek(instream, startpos, SEEK_SET); } } if (!ftp_put(ftp, remote, instream, xtype, startpos)) { php_stream_close(instream); php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf); RETURN_FALSE; } php_stream_close(instream); RETURN_TRUE; } /* }}} */ /* {{{ proto bool ftp_nb_put(resource stream, string remote_file, string local_file, int mode[, int startpos]) Stores a file on the FTP server */ PHP_FUNCTION(ftp_nb_put) { zval *z_ftp; ftpbuf_t *ftp; ftptype_t xtype; char *remote, *local; int remote_len, local_len, ret; long mode, startpos=0; php_stream * instream; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rssl|l", &z_ftp, &remote, &remote_len, &local, &local_len, &mode, &startpos) == FAILURE) { return; } ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); XTYPE(xtype, mode); if (php_check_open_basedir(local TSRMLS_CC)) { RETURN_FALSE; } if (PG(safe_mode) && (!php_checkuid(local, mode == FTPTYPE_ASCII ? "rt" : "rb", CHECKUID_CHECK_MODE_PARAM))) { RETURN_FALSE; } instream = php_stream_fopen(local, mode == FTPTYPE_ASCII ? "rt" : "rb", NULL); if (instream == NULL) { RETURN_FALSE; } /* ignore autoresume if autoseek is switched off */ if (!ftp->autoseek && startpos == PHP_FTP_AUTORESUME) { startpos = 0; } if (ftp->autoseek && startpos) { /* if autoresume is wanted ask for remote size */ if (startpos == PHP_FTP_AUTORESUME) { startpos = ftp_size(ftp, remote); if (startpos < 0) { startpos = 0; } } if (startpos) { php_stream_seek(instream, startpos, SEEK_SET); } } /* configuration */ ftp->direction = 1; /* send */ ftp->closestream = 1; /* do close */ ret = ftp_nb_put(ftp, remote, instream, xtype, startpos TSRMLS_CC); if (ret != PHP_FTP_MOREDATA) { php_stream_close(instream); } if (ret == PHP_FTP_FAILED) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf); } RETURN_LONG(ret); } /* }}} */ /* {{{ proto int ftp_size(resource stream, string filename) Returns the size of the file, or -1 on error */ PHP_FUNCTION(ftp_size) { zval *z_ftp; ftpbuf_t *ftp; char *file; int file_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &file, &file_len) == FAILURE) { return; } ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); /* get file size */ RETURN_LONG(ftp_size(ftp, file)); } /* }}} */ /* {{{ proto int ftp_mdtm(resource stream, string filename) Returns the last modification time of the file, or -1 on error */ PHP_FUNCTION(ftp_mdtm) { zval *z_ftp; ftpbuf_t *ftp; char *file; int file_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &file, &file_len) == FAILURE) { return; } ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); /* get file mod time */ RETURN_LONG(ftp_mdtm(ftp, file)); } /* }}} */ /* {{{ proto bool ftp_rename(resource stream, string src, string dest) Renames the given file to a new path */ PHP_FUNCTION(ftp_rename) { zval *z_ftp; ftpbuf_t *ftp; char *src, *dest; int src_len, dest_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rss", &z_ftp, &src, &src_len, &dest, &dest_len) == FAILURE) { return; } ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); /* rename the file */ if (!ftp_rename(ftp, src, dest)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf); RETURN_FALSE; } RETURN_TRUE; } /* }}} */ /* {{{ proto bool ftp_delete(resource stream, string file) Deletes a file */ PHP_FUNCTION(ftp_delete) { zval *z_ftp; ftpbuf_t *ftp; char *file; int file_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &file, &file_len) == FAILURE) { return; } ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); /* delete the file */ if (!ftp_delete(ftp, file)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf); RETURN_FALSE; } RETURN_TRUE; } /* }}} */ /* {{{ proto bool ftp_site(resource stream, string cmd) Sends a SITE command to the server */ PHP_FUNCTION(ftp_site) { zval *z_ftp; ftpbuf_t *ftp; char *cmd; int cmd_len; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &z_ftp, &cmd, &cmd_len) == FAILURE) { return; } ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); /* send the site command */ if (!ftp_site(ftp, cmd)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ftp->inbuf); RETURN_FALSE; } RETURN_TRUE; } /* }}} */ /* {{{ proto void ftp_close(resource stream) Closes the FTP stream */ PHP_FUNCTION(ftp_close) { zval *z_ftp; ftpbuf_t *ftp; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &z_ftp) == FAILURE) { return; } ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); ftp_quit(ftp); RETURN_BOOL(zend_list_delete(Z_LVAL_P(z_ftp)) == SUCCESS); } /* }}} */ /* {{{ proto bool ftp_set_option(resource stream, int option, mixed value) Sets an FTP option */ PHP_FUNCTION(ftp_set_option) { zval *z_ftp, *z_value; long option; ftpbuf_t *ftp; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlz", &z_ftp, &option, &z_value) == FAILURE) { return; } ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); switch (option) { case PHP_FTP_OPT_TIMEOUT_SEC: if (Z_TYPE_P(z_value) != IS_LONG) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Option TIMEOUT_SEC expects value of type long, %s given", zend_zval_type_name(z_value)); RETURN_FALSE; } if (Z_LVAL_P(z_value) <= 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Timeout has to be greater than 0"); RETURN_FALSE; } ftp->timeout_sec = Z_LVAL_P(z_value); RETURN_TRUE; break; case PHP_FTP_OPT_AUTOSEEK: if (Z_TYPE_P(z_value) != IS_BOOL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Option AUTOSEEK expects value of type boolean, %s given", zend_zval_type_name(z_value)); RETURN_FALSE; } ftp->autoseek = Z_LVAL_P(z_value); RETURN_TRUE; break; default: php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown option '%ld'", option); RETURN_FALSE; break; } } /* }}} */ /* {{{ proto mixed ftp_get_option(resource stream, int option) Gets an FTP option */ PHP_FUNCTION(ftp_get_option) { zval *z_ftp; long option; ftpbuf_t *ftp; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &z_ftp, &option) == FAILURE) { return; } ZEND_FETCH_RESOURCE(ftp, ftpbuf_t*, &z_ftp, -1, le_ftpbuf_name, le_ftpbuf); switch (option) { case PHP_FTP_OPT_TIMEOUT_SEC: RETURN_LONG(ftp->timeout_sec); break; case PHP_FTP_OPT_AUTOSEEK: RETURN_BOOL(ftp->autoseek); break; default: php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown option '%ld'", option); RETURN_FALSE; break; } } /* }}} */ #endif /* HAVE_FTP */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * indent-tabs-mode: t * End: */ php-4.4.8/ext/ftp/php_ftp.h0000644000175000017500000000473010736114307015012 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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: Andrew Skalski | | Stefan Esser (resume functions) | +----------------------------------------------------------------------+ */ /* $Id: php_ftp.h,v 1.21.2.2.4.3 2007/12/31 07:22:47 sebastian Exp $ */ #ifndef _INCLUDED_FTP_H #define _INCLUDED_FTP_H #if HAVE_FTP extern zend_module_entry php_ftp_module_entry; #define php_ftp_module_ptr &php_ftp_module_entry #define PHP_FTP_OPT_TIMEOUT_SEC 0 #define PHP_FTP_OPT_AUTOSEEK 1 #define PHP_FTP_AUTORESUME -1 PHP_MINIT_FUNCTION(ftp); PHP_MINFO_FUNCTION(ftp); PHP_FUNCTION(ftp_connect); #ifdef HAVE_OPENSSL_EXT PHP_FUNCTION(ftp_ssl_connect); #endif PHP_FUNCTION(ftp_login); PHP_FUNCTION(ftp_pwd); PHP_FUNCTION(ftp_cdup); PHP_FUNCTION(ftp_chdir); PHP_FUNCTION(ftp_exec); PHP_FUNCTION(ftp_mkdir); PHP_FUNCTION(ftp_rmdir); PHP_FUNCTION(ftp_nlist); PHP_FUNCTION(ftp_rawlist); PHP_FUNCTION(ftp_systype); PHP_FUNCTION(ftp_pasv); PHP_FUNCTION(ftp_get); PHP_FUNCTION(ftp_fget); PHP_FUNCTION(ftp_put); PHP_FUNCTION(ftp_fput); PHP_FUNCTION(ftp_size); PHP_FUNCTION(ftp_mdtm); PHP_FUNCTION(ftp_rename); PHP_FUNCTION(ftp_delete); PHP_FUNCTION(ftp_site); PHP_FUNCTION(ftp_close); PHP_FUNCTION(ftp_set_option); PHP_FUNCTION(ftp_get_option); PHP_FUNCTION(ftp_nb_get); PHP_FUNCTION(ftp_nb_fget); PHP_FUNCTION(ftp_nb_put); PHP_FUNCTION(ftp_nb_fput); PHP_FUNCTION(ftp_nb_continue); #define phpext_ftp_ptr php_ftp_module_ptr #else #define php_ftp_module_ptr NULL #endif /* HAVE_FTP */ #endif php-4.4.8/ext/ftp/CREDITS0000644000175000017500000000004107602711507014213 0ustar derickderickFTP Stefan Esser, Andrew Skalski php-4.4.8/ext/gmp/0000755000175000017500000000000010737115146013172 5ustar derickderickphp-4.4.8/ext/gmp/TODO0000644000175000017500000000041207211222576013656 0ustar derickderickmpz_mul_2exp mpz_[ft]div_[qr]_2exp V 3: mpz_nextprime mpz_addmul mpz_root mpz_perfect_power_p mpz_lcm mpz_si_kronecker mpz_kronecker_si mpz_remove mpz_bin_ui mpz_fib_ui mpz_cmpabs mpz_xor mpz_tstbit mpz_urandom[bm] mpz_fits_slong_p mpz_mul_si mpz_odd_p mpz_even_p php-4.4.8/ext/gmp/gmp.c0000644000175000017500000010206510736114307014122 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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: Stanislav Malyshev | +----------------------------------------------------------------------+ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "php.h" #include "php_ini.h" #include "php_gmp.h" #include "ext/standard/info.h" #if HAVE_GMP #include /* Needed for gmp_random() */ #include "ext/standard/php_rand.h" #include "ext/standard/php_lcg.h" #define GMP_ABS(x) ((x) >= 0 ? (x) : -(x)) /* True global resources - no need for thread safety here */ static int le_gmp; static unsigned char first_of_two_force_ref[] = { 2, BYREF_FORCE, BYREF_NONE }; /* {{{ gmp_functions[] */ function_entry gmp_functions[] = { ZEND_FE(gmp_init, NULL) ZEND_FE(gmp_intval, NULL) ZEND_FE(gmp_strval, NULL) ZEND_FE(gmp_add, NULL) ZEND_FE(gmp_sub, NULL) ZEND_FE(gmp_mul, NULL) ZEND_FE(gmp_div_qr, NULL) ZEND_FE(gmp_div_q, NULL) ZEND_FE(gmp_div_r, NULL) ZEND_FALIAS(gmp_div, gmp_div_q, NULL) ZEND_FE(gmp_mod, NULL) ZEND_FE(gmp_divexact, NULL) ZEND_FE(gmp_neg, NULL) ZEND_FE(gmp_abs, NULL) ZEND_FE(gmp_fact, NULL) ZEND_FE(gmp_sqrt, NULL) ZEND_FE(gmp_sqrtrem, NULL) ZEND_FE(gmp_pow, NULL) ZEND_FE(gmp_powm, NULL) ZEND_FE(gmp_perfect_square, NULL) ZEND_FE(gmp_prob_prime, NULL) ZEND_FE(gmp_gcd, NULL) ZEND_FE(gmp_gcdext, NULL) ZEND_FE(gmp_invert, NULL) ZEND_FE(gmp_jacobi, NULL) ZEND_FE(gmp_legendre, NULL) ZEND_FE(gmp_cmp, NULL) ZEND_FE(gmp_sign, NULL) ZEND_FE(gmp_random, NULL) ZEND_FE(gmp_and, NULL) ZEND_FE(gmp_or, NULL) ZEND_FE(gmp_com, NULL) ZEND_FE(gmp_xor, NULL) ZEND_FE(gmp_setbit, first_of_two_force_ref) ZEND_FE(gmp_clrbit, first_of_two_force_ref) ZEND_FE(gmp_scan0, NULL) ZEND_FE(gmp_scan1, NULL) ZEND_FE(gmp_popcount, NULL) ZEND_FE(gmp_hamdist, NULL) {NULL, NULL, NULL} /* Must be the last line in gmp_functions[] */ }; /* }}} */ /* {{{ gmp_module_entry */ zend_module_entry gmp_module_entry = { STANDARD_MODULE_HEADER, "gmp", gmp_functions, ZEND_MODULE_STARTUP_N(gmp), ZEND_MODULE_SHUTDOWN_N(gmp), NULL, ZEND_MODULE_DEACTIVATE_N(gmp), ZEND_MODULE_INFO_N(gmp), NO_VERSION_YET, STANDARD_MODULE_PROPERTIES }; /* }}} */ ZEND_DECLARE_MODULE_GLOBALS(gmp) #ifdef COMPILE_DL_GMP ZEND_GET_MODULE(gmp) #endif static void _php_gmpnum_free(zend_rsrc_list_entry *rsrc TSRMLS_DC); #define GMP_RESOURCE_NAME "GMP integer" #define GMP_ROUND_ZERO 0 #define GMP_ROUND_PLUSINF 1 #define GMP_ROUND_MINUSINF 2 /* {{{ gmp_emalloc */ static void *gmp_emalloc(size_t size) { return emalloc(size); } /* }}} */ /* {{{ gmp_erealloc */ static void *gmp_erealloc(void *ptr, size_t old_size, size_t new_size) { return erealloc(ptr, new_size); } /* }}} */ /* {{{ gmp_efree */ static void gmp_efree(void *ptr, size_t size) { efree(ptr); } /* }}} */ /* {{{ php_gmp_init_globals */ static void php_gmp_init_globals(zend_gmp_globals *gmp_globals) { gmp_globals->rand_initialized = 0; } /* }}} */ /* {{{ ZEND_MINIT_FUNCTION */ ZEND_MODULE_STARTUP_D(gmp) { ZEND_INIT_MODULE_GLOBALS(gmp, php_gmp_init_globals, NULL); le_gmp = zend_register_list_destructors_ex(_php_gmpnum_free, NULL, GMP_RESOURCE_NAME, module_number); REGISTER_LONG_CONSTANT("GMP_ROUND_ZERO", GMP_ROUND_ZERO, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("GMP_ROUND_PLUSINF", GMP_ROUND_PLUSINF, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("GMP_ROUND_MINUSINF", GMP_ROUND_MINUSINF, CONST_CS | CONST_PERSISTENT); mp_set_memory_functions(gmp_emalloc, gmp_erealloc, gmp_efree); return SUCCESS; } /* }}} */ /* {{{ ZEND_RSHUTDOWN_FUNCTION */ ZEND_MODULE_DEACTIVATE_D(gmp) { if (GMPG(rand_initialized)) { gmp_randclear(GMPG(rand_state)); GMPG(rand_initialized) = 0; } return SUCCESS; } /* }}} */ /* {{{ ZEND_MSHUTDOWN_FUNCTION */ ZEND_MODULE_SHUTDOWN_D(gmp) { return SUCCESS; } /* }}} */ /* {{{ ZEND_MINFO_FUNCTION */ ZEND_MODULE_INFO_D(gmp) { php_info_print_table_start(); php_info_print_table_row(2, "gmp support", "enabled"); php_info_print_table_end(); /* Remove comments if you have entries in php.ini DISPLAY_INI_ENTRIES(); */ } /* }}} */ /* Fetch zval to be GMP number. Initially, zval can be also number or string */ #define FETCH_GMP_ZVAL(gmpnumber, zval) \ if(Z_TYPE_PP(zval) == IS_RESOURCE) { \ ZEND_FETCH_RESOURCE(gmpnumber, mpz_t *, zval, -1, GMP_RESOURCE_NAME, le_gmp);\ } else {\ if(convert_to_gmp(&gmpnumber, zval, 0 TSRMLS_CC) == FAILURE) {\ RETURN_FALSE;\ }\ ZEND_REGISTER_RESOURCE(NULL, gmpnumber, le_gmp);\ } /* create a new initialized GMP number */ #define INIT_GMP_NUM(gmpnumber) { gmpnumber=emalloc(sizeof(mpz_t)); mpz_init(*gmpnumber); } #define FREE_GMP_NUM(gmpnumber) { mpz_clear(*gmpnumber); efree(gmpnumber); } /* {{{ convert_to_gmp * Convert zval to be gmp number */ static int convert_to_gmp(mpz_t * *gmpnumber, zval **val, int base TSRMLS_DC) { int ret = 0; int skip_lead = 0; *gmpnumber = emalloc(sizeof(mpz_t)); switch(Z_TYPE_PP(val)) { case IS_LONG: case IS_BOOL: case IS_CONSTANT: { convert_to_long_ex(val); mpz_init_set_si(**gmpnumber, Z_LVAL_PP(val)); } break; case IS_STRING: { char *numstr = Z_STRVAL_PP(val); if (Z_STRLEN_PP(val) > 2) { if (numstr[0] == '0') { if (numstr[1] == 'x' || numstr[1] == 'X') { base = 16; skip_lead = 1; } else if (base != 16 && (numstr[1] == 'b' || numstr[1] == 'B')) { base = 2; skip_lead = 1; } } } ret = mpz_init_set_str(**gmpnumber, (skip_lead ? &numstr[2] : numstr), base); } break; default: php_error_docref(NULL TSRMLS_CC, E_WARNING,"Unable to convert variable to GMP - wrong type"); efree(*gmpnumber); return FAILURE; } if (ret) { FREE_GMP_NUM(*gmpnumber); return FAILURE; } return SUCCESS; } /* }}} */ /* {{{ typedefs */ typedef void (*gmp_unary_op_t)(mpz_ptr, mpz_srcptr); typedef int (*gmp_unary_opl_t)(mpz_srcptr); typedef void (*gmp_unary_ui_op_t)(mpz_ptr, unsigned long); typedef void (*gmp_binary_op_t)(mpz_ptr, mpz_srcptr, mpz_srcptr); typedef int (*gmp_binary_opl_t)(mpz_srcptr, mpz_srcptr); typedef unsigned long (*gmp_binary_ui_op_t)(mpz_ptr, mpz_srcptr, unsigned long); typedef void (*gmp_binary_op2_t)(mpz_ptr, mpz_ptr, mpz_srcptr, mpz_srcptr); typedef unsigned long (*gmp_binary_ui_op2_t)(mpz_ptr, mpz_ptr, mpz_srcptr, unsigned long); /* }}} */ #define gmp_zval_binary_ui_op(r, a, b, o, u) gmp_zval_binary_ui_op_ex(r, a, b, o, u, 0, 0 TSRMLS_CC) #define gmp_zval_binary_ui_op2(r, a, b, o, u) gmp_zval_binary_ui_op2_ex(r, a, b, o, u, 0, 0 TSRMLS_CC) #define gmp_binary_ui_op(op, uop) _gmp_binary_ui_op(INTERNAL_FUNCTION_PARAM_PASSTHRU, op, uop) #define gmp_binary_op(op) _gmp_binary_ui_op(INTERNAL_FUNCTION_PARAM_PASSTHRU, op, NULL) #define gmp_binary_opl(op) _gmp_binary_opl(INTERNAL_FUNCTION_PARAM_PASSTHRU, op) /* Unary operations */ #define gmp_unary_op(op) _gmp_unary_op(INTERNAL_FUNCTION_PARAM_PASSTHRU, op) #define gmp_unary_opl(op) _gmp_unary_opl(INTERNAL_FUNCTION_PARAM_PASSTHRU, op) #define gmp_unary_ui_op(op) _gmp_unary_ui_op(INTERNAL_FUNCTION_PARAM_PASSTHRU, op) /* {{{ gmp_zval_binary_ui_op_ex Execute GMP binary operation. May return GMP resource or long if operation allows this */ static inline void gmp_zval_binary_ui_op_ex(zval *return_value, zval **a_arg, zval **b_arg, gmp_binary_op_t gmp_op, gmp_binary_ui_op_t gmp_ui_op, int allow_ui_return, int check_b_zero TSRMLS_DC) { mpz_t *gmpnum_a, *gmpnum_b, *gmpnum_result; unsigned long long_result=0; int use_ui=0; FETCH_GMP_ZVAL(gmpnum_a, a_arg); if(gmp_ui_op && Z_TYPE_PP(b_arg) == IS_LONG && Z_LVAL_PP(b_arg) >= 0) { use_ui=1; } else { FETCH_GMP_ZVAL(gmpnum_b, b_arg); } if(check_b_zero) { int b_is_zero = 0; if(use_ui) { b_is_zero = (Z_LVAL_PP(b_arg) == 0); } else { b_is_zero = !mpz_cmp_ui(*gmpnum_b, 0); } if(b_is_zero) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Zero operand not allowed"); RETURN_FALSE; } } INIT_GMP_NUM(gmpnum_result); if(use_ui && gmp_ui_op) { if(allow_ui_return) { long_result = gmp_ui_op(*gmpnum_result, *gmpnum_a, (unsigned long)Z_LVAL_PP(b_arg)); } else { gmp_ui_op(*gmpnum_result, *gmpnum_a, (unsigned long)Z_LVAL_PP(b_arg)); } } else { gmp_op(*gmpnum_result, *gmpnum_a, *gmpnum_b); } if(use_ui && allow_ui_return) { FREE_GMP_NUM(gmpnum_result); RETURN_LONG((long)long_result); } else { ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp); } } /* }}} */ /* {{{ gmp_zval_binary_ui_op2_ex Execute GMP binary operation which returns 2 values. May return GMP resources or longs if operation allows this. */ static inline void gmp_zval_binary_ui_op2_ex(zval *return_value, zval **a_arg, zval **b_arg, gmp_binary_op2_t gmp_op, gmp_binary_ui_op2_t gmp_ui_op, int allow_ui_return, int check_b_zero TSRMLS_DC) { mpz_t *gmpnum_a, *gmpnum_b, *gmpnum_result1, *gmpnum_result2; zval r; int use_ui=0; unsigned long long_result = 0; FETCH_GMP_ZVAL(gmpnum_a, a_arg); if(gmp_ui_op && Z_TYPE_PP(b_arg) == IS_LONG && Z_LVAL_PP(b_arg) >= 0) { /* use _ui function */ use_ui=1; } else { FETCH_GMP_ZVAL(gmpnum_b, b_arg); } if(check_b_zero) { int b_is_zero = 0; if(use_ui) { b_is_zero = (Z_LVAL_PP(b_arg) == 0); } else { b_is_zero = !mpz_cmp_ui(*gmpnum_b, 0); } if(b_is_zero) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Zero operand not allowed"); RETURN_FALSE; } } INIT_GMP_NUM(gmpnum_result1); INIT_GMP_NUM(gmpnum_result2); if(use_ui && gmp_ui_op) { if(allow_ui_return) { long_result = gmp_ui_op(*gmpnum_result1, *gmpnum_result2, *gmpnum_a, (unsigned long)Z_LVAL_PP(b_arg)); } else { gmp_ui_op(*gmpnum_result1, *gmpnum_result2, *gmpnum_a, (unsigned long)Z_LVAL_PP(b_arg)); } } else { gmp_op(*gmpnum_result1, *gmpnum_result2, *gmpnum_a, *gmpnum_b); } array_init(return_value); ZEND_REGISTER_RESOURCE(&r, gmpnum_result1, le_gmp); add_index_resource(return_value, 0, Z_LVAL(r)); if(use_ui && allow_ui_return) { mpz_clear(*gmpnum_result2); add_index_long(return_value, 1, long_result); } else { ZEND_REGISTER_RESOURCE(&r, gmpnum_result2, le_gmp); add_index_resource(return_value, 1, Z_LVAL(r)); } } /* }}} */ /* {{{ _gmp_binary_ui_op */ static inline void _gmp_binary_ui_op(INTERNAL_FUNCTION_PARAMETERS, gmp_binary_op_t gmp_op, gmp_binary_ui_op_t gmp_ui_op) { zval **a_arg, **b_arg; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &a_arg, &b_arg) == FAILURE){ WRONG_PARAM_COUNT; } gmp_zval_binary_ui_op(return_value, a_arg, b_arg, gmp_op, gmp_ui_op); } /* }}} */ /* Unary operations */ /* {{{ gmp_zval_unary_op */ static inline void gmp_zval_unary_op(zval *return_value, zval **a_arg, gmp_unary_op_t gmp_op TSRMLS_DC) { mpz_t *gmpnum_a, *gmpnum_result; FETCH_GMP_ZVAL(gmpnum_a, a_arg); INIT_GMP_NUM(gmpnum_result); gmp_op(*gmpnum_result, *gmpnum_a); ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp); } /* }}} */ /* {{{ gmp_zval_unary_ui_op */ static inline void gmp_zval_unary_ui_op(zval *return_value, zval **a_arg, gmp_unary_ui_op_t gmp_op) { mpz_t *gmpnum_result; convert_to_long_ex(a_arg); INIT_GMP_NUM(gmpnum_result); gmp_op(*gmpnum_result, Z_LVAL_PP(a_arg)); ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp); } /* }}} */ /* {{{ _gmp_unary_ui_op Execute GMP unary operation. */ static inline void _gmp_unary_ui_op(INTERNAL_FUNCTION_PARAMETERS, gmp_unary_ui_op_t gmp_op) { zval **a_arg; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &a_arg) == FAILURE){ WRONG_PARAM_COUNT; } gmp_zval_unary_ui_op(return_value, a_arg, gmp_op); } /* }}} */ /* {{{ _gmp_unary_op */ static inline void _gmp_unary_op(INTERNAL_FUNCTION_PARAMETERS, gmp_unary_op_t gmp_op) { zval **a_arg; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &a_arg) == FAILURE){ WRONG_PARAM_COUNT; } gmp_zval_unary_op(return_value, a_arg, gmp_op TSRMLS_CC); } /* }}} */ /* {{{ _gmp_unary_opl */ static inline void _gmp_unary_opl(INTERNAL_FUNCTION_PARAMETERS, gmp_unary_opl_t gmp_op) { zval **a_arg; mpz_t *gmpnum_a; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &a_arg) == FAILURE){ WRONG_PARAM_COUNT; } FETCH_GMP_ZVAL(gmpnum_a, a_arg); RETURN_LONG(gmp_op(*gmpnum_a)); } /* }}} */ /* {{{ _gmp_binary_opl */ static inline void _gmp_binary_opl(INTERNAL_FUNCTION_PARAMETERS, gmp_binary_opl_t gmp_op) { zval **a_arg, **b_arg; mpz_t *gmpnum_a, *gmpnum_b; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &a_arg, &b_arg) == FAILURE){ WRONG_PARAM_COUNT; } FETCH_GMP_ZVAL(gmpnum_a, a_arg); FETCH_GMP_ZVAL(gmpnum_b, a_arg); RETURN_LONG(gmp_op(*gmpnum_a, *gmpnum_b)); } /* }}} */ /* {{{ proto resource gmp_init(mixed number [, int base]) Initializes GMP number */ ZEND_FUNCTION(gmp_init) { zval **number_arg, **base_arg; mpz_t * gmpnumber; int argc; int base=0; argc = ZEND_NUM_ARGS(); if (argc < 1 || argc > 2 || zend_get_parameters_ex(argc, &number_arg, &base_arg) == FAILURE){ WRONG_PARAM_COUNT; } if (argc==2) { convert_to_long_ex(base_arg); base = Z_LVAL_PP(base_arg); if(base < 2 || base > 36) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad base for conversion: %d (should be between 2 and 36)", base); RETURN_FALSE; } } if(convert_to_gmp(&gmpnumber, number_arg, base TSRMLS_CC) == FAILURE) { RETURN_FALSE; } /* Write your own code here to handle argument number. */ ZEND_REGISTER_RESOURCE(return_value, gmpnumber, le_gmp); } /* }}} */ /* {{{ proto int gmp_intval(resource gmpnumber) Gets signed long value of GMP number */ ZEND_FUNCTION(gmp_intval) { zval **gmpnumber_arg; mpz_t * gmpnum; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &gmpnumber_arg) == FAILURE){ WRONG_PARAM_COUNT; } if(Z_TYPE_PP(gmpnumber_arg) == IS_RESOURCE) { ZEND_FETCH_RESOURCE(gmpnum, mpz_t *, gmpnumber_arg, -1, GMP_RESOURCE_NAME, le_gmp); RETVAL_LONG(mpz_get_si(*gmpnum)); } else { convert_to_long_ex(gmpnumber_arg); RETVAL_LONG(Z_LVAL_PP(gmpnumber_arg)); } } /* }}} */ /* {{{ proto string gmp_strval(resource gmpnumber [, int base]) Gets string representation of GMP number */ ZEND_FUNCTION(gmp_strval) { zval **gmpnumber_arg, **base_arg; int base=10, num_len, argc; mpz_t * gmpnum; char *out_string; argc = ZEND_NUM_ARGS(); if (argc < 1 || argc > 2 || zend_get_parameters_ex(argc, &gmpnumber_arg, &base_arg) == FAILURE){ WRONG_PARAM_COUNT; } FETCH_GMP_ZVAL(gmpnum, gmpnumber_arg); switch (argc) { case 2: convert_to_long_ex(base_arg); base = Z_LVAL_PP(base_arg); break; case 1: base = 10; break; } if(base < 2 || base > 36) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad base for conversion: %d", base); RETURN_FALSE; } num_len = mpz_sizeinbase(*gmpnum, base); out_string = emalloc(num_len+2); if(mpz_sgn(*gmpnum) < 0) { num_len++; } mpz_get_str(out_string, base, *gmpnum); /* From GMP documentation for mpz_sizeinbase(): The returned value will be exact or 1 too big. If base is a power of 2, the returned value will always be exact. So let's check to see if we already have a \0 byte... */ if (out_string[num_len-1] == '\0') num_len--; else out_string[num_len] = '\0'; RETVAL_STRINGL(out_string, num_len, 0); } /* }}} */ /* {{{ proto resource gmp_add(resource a, resource b) Add a and b */ ZEND_FUNCTION(gmp_add) { gmp_binary_ui_op(mpz_add, (gmp_binary_ui_op_t)mpz_add_ui); } /* }}} */ /* {{{ proto resource gmp_sub(resource a, resource b) Subtract b from a */ ZEND_FUNCTION(gmp_sub) { gmp_binary_ui_op(mpz_sub, (gmp_binary_ui_op_t)mpz_sub_ui); } /* }}} */ /* {{{ proto resource gmp_mul(resource a, resource b) Multiply a and b */ ZEND_FUNCTION(gmp_mul) { gmp_binary_ui_op(mpz_mul, (gmp_binary_ui_op_t)mpz_mul_ui); } /* }}} */ /* {{{ proto array gmp_div_qr(resource a, resource b [, int round]) Divide a by b, returns quotient and reminder */ ZEND_FUNCTION(gmp_div_qr) { zval **a_arg, **b_arg, **round_arg; int round=GMP_ROUND_ZERO, argc; argc = ZEND_NUM_ARGS(); if (argc < 2 || argc > 3 || zend_get_parameters_ex(argc, &a_arg, &b_arg, &round_arg) == FAILURE){ WRONG_PARAM_COUNT; } switch (argc) { case 3: convert_to_long_ex(round_arg); round = Z_LVAL_PP(round_arg); break; case 2: round = GMP_ROUND_ZERO; break; } switch(round) { case GMP_ROUND_ZERO: gmp_zval_binary_ui_op2_ex(return_value, a_arg, b_arg, mpz_tdiv_qr, (gmp_binary_ui_op2_t)mpz_tdiv_qr_ui, 0, 1 TSRMLS_CC); break; case GMP_ROUND_PLUSINF: gmp_zval_binary_ui_op2_ex(return_value, a_arg, b_arg, mpz_cdiv_qr, (gmp_binary_ui_op2_t)mpz_cdiv_qr_ui, 0, 1 TSRMLS_CC); break; case GMP_ROUND_MINUSINF: gmp_zval_binary_ui_op2_ex(return_value, a_arg, b_arg, mpz_fdiv_qr, (gmp_binary_ui_op2_t)mpz_fdiv_qr_ui, 0, 1 TSRMLS_CC); break; } } /* }}} */ /* {{{ proto resource gmp_div_r(resource a, resource b [, int round]) Divide a by b, returns reminder only */ ZEND_FUNCTION(gmp_div_r) { zval **a_arg, **b_arg, **round_arg; int round=GMP_ROUND_ZERO, argc; argc = ZEND_NUM_ARGS(); if (argc < 2 || argc > 3 || zend_get_parameters_ex(argc, &a_arg, &b_arg, &round_arg) == FAILURE){ WRONG_PARAM_COUNT; } switch (argc) { case 3: convert_to_long_ex(round_arg); round = Z_LVAL_PP(round_arg); break; case 2: round = GMP_ROUND_ZERO; break; } switch(round) { case GMP_ROUND_ZERO: gmp_zval_binary_ui_op_ex(return_value, a_arg, b_arg, mpz_tdiv_r, (gmp_binary_ui_op_t)mpz_tdiv_r_ui, 1, 1 TSRMLS_CC); break; case GMP_ROUND_PLUSINF: gmp_zval_binary_ui_op_ex(return_value, a_arg, b_arg, mpz_cdiv_r, (gmp_binary_ui_op_t)mpz_cdiv_r_ui, 1, 1 TSRMLS_CC); break; case GMP_ROUND_MINUSINF: gmp_zval_binary_ui_op_ex(return_value, a_arg, b_arg, mpz_fdiv_r, (gmp_binary_ui_op_t)mpz_fdiv_r_ui, 1, 1 TSRMLS_CC); break; } } /* }}} */ /* {{{ proto resource gmp_div_q(resource a, resource b [, int round]) Divide a by b, returns quotient only */ ZEND_FUNCTION(gmp_div_q) { zval **a_arg, **b_arg, **round_arg; int round=GMP_ROUND_ZERO, argc; argc = ZEND_NUM_ARGS(); if (argc < 2 || argc > 3 || zend_get_parameters_ex(argc, &a_arg, &b_arg, &round_arg) == FAILURE){ WRONG_PARAM_COUNT; } switch (argc) { case 3: convert_to_long_ex(round_arg); round = Z_LVAL_PP(round_arg); break; case 2: round = GMP_ROUND_ZERO; break; } switch(round) { case GMP_ROUND_ZERO: gmp_zval_binary_ui_op_ex(return_value, a_arg, b_arg, mpz_tdiv_q, (gmp_binary_ui_op_t)mpz_tdiv_q_ui, 0, 1 TSRMLS_CC); break; case GMP_ROUND_PLUSINF: gmp_zval_binary_ui_op_ex(return_value, a_arg, b_arg, mpz_cdiv_q, (gmp_binary_ui_op_t)mpz_cdiv_q_ui, 0, 1 TSRMLS_CC); break; case GMP_ROUND_MINUSINF: gmp_zval_binary_ui_op_ex(return_value, a_arg, b_arg, mpz_fdiv_q, (gmp_binary_ui_op_t)mpz_fdiv_q_ui, 0, 1 TSRMLS_CC); break; } } /* }}} */ /* {{{ proto resource gmp_mod(resource a, resource b) Computes a modulo b */ ZEND_FUNCTION(gmp_mod) { zval **a_arg, **b_arg; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &a_arg, &b_arg) == FAILURE){ WRONG_PARAM_COUNT; } gmp_zval_binary_ui_op_ex(return_value, a_arg, b_arg, mpz_mod, (gmp_binary_ui_op_t)mpz_mod_ui, 1, 1 TSRMLS_CC); } /* }}} */ /* {{{ proto resource gmp_divexact(resource a, resource b) Divide a by b using exact division algorithm */ ZEND_FUNCTION(gmp_divexact) { gmp_binary_op(mpz_divexact); } /* }}} */ /* {{{ proto resource gmp_neg(resource a) Negates a number */ ZEND_FUNCTION(gmp_neg) { gmp_unary_op(mpz_neg); } /* }}} */ /* {{{ proto resource gmp_abs(resource a) Calculates absolute value */ ZEND_FUNCTION(gmp_abs) { gmp_unary_op(mpz_abs); } /* }}} */ /* {{{ proto resource gmp_fact(int a) Calculates factorial function */ ZEND_FUNCTION(gmp_fact) { zval **a_arg; mpz_t *gmpnum_tmp; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &a_arg) == FAILURE){ WRONG_PARAM_COUNT; } if (Z_TYPE_PP(a_arg) == IS_RESOURCE) { FETCH_GMP_ZVAL(gmpnum_tmp, a_arg); if (mpz_sgn(*gmpnum_tmp) < 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING,"Number has to be greater than or equal to 0"); RETURN_FALSE; } } else { convert_to_long_ex(a_arg); if (Z_LVAL_PP(a_arg) < 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING,"Number has to be greater than or equal to 0"); RETURN_FALSE; } } gmp_zval_unary_ui_op(return_value, a_arg, mpz_fac_ui); } /* }}} */ /* {{{ proto resource gmp_pow(resource base, int exp) Raise base to power exp */ ZEND_FUNCTION(gmp_pow) { zval **base_arg, **exp_arg; mpz_t *gmpnum_result, *gmpnum_base; int use_ui=0; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &base_arg, &exp_arg) == FAILURE){ WRONG_PARAM_COUNT; } if(Z_TYPE_PP(base_arg) == IS_LONG && Z_LVAL_PP(base_arg) >= 0) { use_ui=1; } else { FETCH_GMP_ZVAL(gmpnum_base, base_arg); } convert_to_long_ex(exp_arg); if(Z_LVAL_PP(exp_arg) < 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING,"Negative exponent not supported"); RETURN_FALSE; } INIT_GMP_NUM(gmpnum_result); if(use_ui) { mpz_ui_pow_ui(*gmpnum_result, Z_LVAL_PP(base_arg), Z_LVAL_PP(exp_arg)); } else { mpz_pow_ui(*gmpnum_result, *gmpnum_base, Z_LVAL_PP(exp_arg)); } ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp); } /* }}} */ /* {{{ proto resource gmp_powm(resource base, resource exp, resource mod) Raise base to power exp and take result modulo mod */ ZEND_FUNCTION(gmp_powm) { zval **base_arg, **exp_arg, **mod_arg; mpz_t *gmpnum_base, *gmpnum_exp, *gmpnum_mod, *gmpnum_result; int use_ui=0; if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &base_arg, &exp_arg, &mod_arg) == FAILURE){ WRONG_PARAM_COUNT; } FETCH_GMP_ZVAL(gmpnum_base, base_arg); if(Z_TYPE_PP(exp_arg) == IS_LONG && Z_LVAL_PP(exp_arg) >= 0) { use_ui=1; } else { FETCH_GMP_ZVAL(gmpnum_exp, exp_arg); if (mpz_sgn(*gmpnum_exp) < 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING,"Second parameter cannot be less than 0"); RETURN_FALSE; } } FETCH_GMP_ZVAL(gmpnum_mod, mod_arg); if (!mpz_cmp_ui(*gmpnum_mod, 0)) { RETURN_FALSE; } INIT_GMP_NUM(gmpnum_result); if(use_ui) { mpz_powm_ui(*gmpnum_result, *gmpnum_base, (unsigned long)Z_LVAL_PP(exp_arg), *gmpnum_mod); } else { mpz_powm(*gmpnum_result, *gmpnum_base, *gmpnum_exp, *gmpnum_mod); } ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp); } /* }}} */ /* {{{ proto resource gmp_sqrt(resource a) Takes integer part of square root of a */ ZEND_FUNCTION(gmp_sqrt) { zval **a_arg; mpz_t *gmpnum_a, *gmpnum_result; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &a_arg) == FAILURE){ WRONG_PARAM_COUNT; } FETCH_GMP_ZVAL(gmpnum_a, a_arg); if (mpz_sgn(*gmpnum_a) < 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING,"Number has to be greater than or equal to 0"); RETURN_FALSE; } INIT_GMP_NUM(gmpnum_result); mpz_sqrt(*gmpnum_result, *gmpnum_a); ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp); } /* }}} */ /* {{{ proto array gmp_sqrtrem(resource a) Square root with remainder */ ZEND_FUNCTION(gmp_sqrtrem) { zval **a_arg; mpz_t *gmpnum_a, *gmpnum_result1, *gmpnum_result2; zval r; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &a_arg) == FAILURE){ WRONG_PARAM_COUNT; } FETCH_GMP_ZVAL(gmpnum_a, a_arg); if (mpz_sgn(*gmpnum_a) < 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING,"Number has to be greater than or equal to 0"); RETURN_FALSE; } INIT_GMP_NUM(gmpnum_result1); INIT_GMP_NUM(gmpnum_result2); mpz_sqrtrem(*gmpnum_result1, *gmpnum_result2, *gmpnum_a); array_init(return_value); ZEND_REGISTER_RESOURCE(&r, gmpnum_result1, le_gmp); add_index_resource(return_value, 0, Z_LVAL(r)); ZEND_REGISTER_RESOURCE(&r, gmpnum_result2, le_gmp); add_index_resource(return_value, 1, Z_LVAL(r)); } /* }}} */ /* {{{ proto bool gmp_perfect_square(resource a) Checks if a is an exact square */ ZEND_FUNCTION(gmp_perfect_square) { zval **a_arg; mpz_t *gmpnum_a; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &a_arg) == FAILURE){ WRONG_PARAM_COUNT; } FETCH_GMP_ZVAL(gmpnum_a, a_arg); RETURN_BOOL((mpz_perfect_square_p(*gmpnum_a)!=0)); } /* }}} */ /* {{{ proto int gmp_prob_prime(resource a[, int reps]) Checks if a is "probably prime" */ ZEND_FUNCTION(gmp_prob_prime) { zval **gmpnumber_arg, **reps_arg; mpz_t *gmpnum_a; int argc, reps=10; argc = ZEND_NUM_ARGS(); if (argc < 1 || argc > 2 || zend_get_parameters_ex(argc, &gmpnumber_arg, &reps_arg) == FAILURE){ WRONG_PARAM_COUNT; } FETCH_GMP_ZVAL(gmpnum_a, gmpnumber_arg); switch (argc) { case 2: convert_to_long_ex(reps_arg); reps = Z_LVAL_PP(reps_arg); break; case 1: reps = 10; break; } RETURN_LONG(mpz_probab_prime_p(*gmpnum_a, reps)); } /* }}} */ /* {{{ proto resource gmp_gcd(resource a, resource b) Computes greatest common denominator (gcd) of a and b */ ZEND_FUNCTION(gmp_gcd) { zval **a_arg, **b_arg; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &a_arg, &b_arg) == FAILURE){ WRONG_PARAM_COUNT; } gmp_zval_binary_ui_op_ex(return_value, a_arg, b_arg, mpz_gcd, (gmp_binary_ui_op_t)mpz_gcd_ui, 1, 0 TSRMLS_CC); } /* }}} */ /* {{{ proto array gmp_gcdext(resource a, resource b) Computes G, S, and T, such that AS + BT = G = `gcd' (A, B) */ ZEND_FUNCTION(gmp_gcdext) { zval **a_arg, **b_arg; mpz_t *gmpnum_a, *gmpnum_b, *gmpnum_t, *gmpnum_s, *gmpnum_g; zval r; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &a_arg, &b_arg) == FAILURE){ WRONG_PARAM_COUNT; } FETCH_GMP_ZVAL(gmpnum_a, a_arg); FETCH_GMP_ZVAL(gmpnum_b, b_arg); INIT_GMP_NUM(gmpnum_g); INIT_GMP_NUM(gmpnum_s); INIT_GMP_NUM(gmpnum_t); mpz_gcdext(*gmpnum_g, *gmpnum_s, *gmpnum_t, *gmpnum_a, *gmpnum_b); array_init(return_value); ZEND_REGISTER_RESOURCE(&r, gmpnum_g, le_gmp); add_assoc_resource(return_value, "g", Z_LVAL(r)); ZEND_REGISTER_RESOURCE(&r, gmpnum_s, le_gmp); add_assoc_resource(return_value, "s", Z_LVAL(r)); ZEND_REGISTER_RESOURCE(&r, gmpnum_t, le_gmp); add_assoc_resource(return_value, "t", Z_LVAL(r)); } /* }}} */ /* {{{ proto resource gmp_invert(resource a, resource b) Computes the inverse of a modulo b */ ZEND_FUNCTION(gmp_invert) { zval **a_arg, **b_arg; mpz_t *gmpnum_a, *gmpnum_b, *gmpnum_result; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &a_arg, &b_arg) == FAILURE){ WRONG_PARAM_COUNT; } FETCH_GMP_ZVAL(gmpnum_a, a_arg); FETCH_GMP_ZVAL(gmpnum_b, b_arg); INIT_GMP_NUM(gmpnum_result); if(mpz_invert(*gmpnum_result, *gmpnum_a, *gmpnum_b)) { ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp); } else { FREE_GMP_NUM(gmpnum_result); RETURN_FALSE; } } /* }}} */ /* {{{ proto int gmp_jacobi(resource a, resource b) Computes Jacobi symbol */ ZEND_FUNCTION(gmp_jacobi) { gmp_binary_opl(mpz_jacobi); } /* }}} */ /* {{{ proto int gmp_legendre(resource a, resource b) Computes Legendre symbol */ ZEND_FUNCTION(gmp_legendre) { gmp_binary_opl(mpz_legendre); } /* }}} */ /* {{{ proto int gmp_cmp(resource a, resource b) Compares two numbers */ ZEND_FUNCTION(gmp_cmp) { zval **a_arg, **b_arg; mpz_t *gmpnum_a, *gmpnum_b; int use_si=0, res; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &a_arg, &b_arg) == FAILURE){ WRONG_PARAM_COUNT; } FETCH_GMP_ZVAL(gmpnum_a, a_arg); if(Z_TYPE_PP(b_arg) == IS_LONG) { use_si=1; } else { FETCH_GMP_ZVAL(gmpnum_b, b_arg); } if(use_si) { res = mpz_cmp_si(*gmpnum_a, Z_LVAL_PP(b_arg)); } else { res = mpz_cmp(*gmpnum_a, *gmpnum_b); } RETURN_LONG(res); } /* }}} */ /* {{{ proto int gmp_sign(resource a) Gets the sign of the number */ ZEND_FUNCTION(gmp_sign) { zval **a_arg; mpz_t *gmpnum_a; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &a_arg) == FAILURE){ WRONG_PARAM_COUNT; } FETCH_GMP_ZVAL(gmpnum_a, a_arg); RETURN_LONG(mpz_sgn(*gmpnum_a)); } /* }}} */ /* {{{ proto resource gmp_random([int limiter]) Gets random number */ ZEND_FUNCTION(gmp_random) { zval **limiter_arg; int limiter, argc; mpz_t *gmpnum_result; argc = ZEND_NUM_ARGS(); if (argc == 0) { limiter = 20; } else if (argc == 1 && zend_get_parameters_ex(1, &limiter_arg) == SUCCESS) { convert_to_long_ex(limiter_arg); limiter = Z_LVAL_PP(limiter_arg); } else { WRONG_PARAM_COUNT; } INIT_GMP_NUM(gmpnum_result); if (!GMPG(rand_initialized)) { /* Initialize */ gmp_randinit_lc_2exp_size(GMPG(rand_state), 32L); /* Seed */ gmp_randseed_ui(GMPG(rand_state), GENERATE_SEED()); GMPG(rand_initialized) = 1; } mpz_urandomb(*gmpnum_result, GMPG(rand_state), GMP_ABS (limiter) * __GMP_BITS_PER_MP_LIMB); ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp); } /* }}} */ /* {{{ proto resource gmp_and(resource a, resource b) Calculates logical AND of a and b */ ZEND_FUNCTION(gmp_and) { gmp_binary_op(mpz_and); } /* }}} */ /* {{{ proto resource gmp_or(resource a, resource b) Calculates logical OR of a and b */ ZEND_FUNCTION(gmp_or) { gmp_binary_op(mpz_ior); } /* }}} */ /* {{{ proto resource gmp_com(resource a) Calculates one's complement of a */ ZEND_FUNCTION(gmp_com) { gmp_unary_op(mpz_com); } /* }}} */ /* {{{ proto resource gmp_xor(resource a, resource b) Calculates logical exclusive OR of a and b */ ZEND_FUNCTION(gmp_xor) { /* use formula: a^b = (a|b)&^(a&b) */ zval **a_arg, **b_arg; mpz_t *gmpnum_a, *gmpnum_b, *gmpnum_result, *gmpnum_t; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &a_arg, &b_arg) == FAILURE){ WRONG_PARAM_COUNT; } FETCH_GMP_ZVAL(gmpnum_a, a_arg); FETCH_GMP_ZVAL(gmpnum_b, b_arg); INIT_GMP_NUM(gmpnum_result); INIT_GMP_NUM(gmpnum_t); mpz_and(*gmpnum_t, *gmpnum_a, *gmpnum_b); mpz_com(*gmpnum_t, *gmpnum_t); mpz_ior(*gmpnum_result, *gmpnum_a, *gmpnum_b); mpz_and(*gmpnum_result, *gmpnum_result, *gmpnum_t); FREE_GMP_NUM(gmpnum_t); ZEND_REGISTER_RESOURCE(return_value, gmpnum_result, le_gmp); } /* }}} */ /* {{{ proto void gmp_setbit(resource &a, int index[, bool set_clear]) Sets or clear bit in a */ ZEND_FUNCTION(gmp_setbit) { zval **a_arg, **ind_arg, **set_c_arg; int argc, index, set=1; mpz_t *gmpnum_a; argc = ZEND_NUM_ARGS(); if (argc < 2 || argc > 3 || zend_get_parameters_ex(argc, &a_arg, &ind_arg, &set_c_arg) == FAILURE){ WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(gmpnum_a, mpz_t *, a_arg, -1, GMP_RESOURCE_NAME, le_gmp); convert_to_long_ex(ind_arg); index = Z_LVAL_PP(ind_arg); switch (argc) { case 3: convert_to_long_ex(set_c_arg); set = Z_LVAL_PP(set_c_arg); break; case 2: set = 1; break; } if(set) { mpz_setbit(*gmpnum_a, index); } else { mpz_clrbit(*gmpnum_a, index); } } /* }}} */ /* {{{ proto void gmp_clrbit(resource &a, int index) Clears bit in a */ ZEND_FUNCTION(gmp_clrbit) { zval **a_arg, **ind_arg; int index; mpz_t *gmpnum_a; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &a_arg, &ind_arg) == FAILURE){ WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(gmpnum_a, mpz_t *, a_arg, -1, GMP_RESOURCE_NAME, le_gmp); convert_to_long_ex(ind_arg); index = Z_LVAL_PP(ind_arg); mpz_clrbit(*gmpnum_a, index); } /* }}} */ /* {{{ proto int gmp_popcount(resource a) Calculates the population count of a */ ZEND_FUNCTION(gmp_popcount) { zval **a_arg; mpz_t *gmpnum_a; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &a_arg) == FAILURE){ WRONG_PARAM_COUNT; } FETCH_GMP_ZVAL(gmpnum_a, a_arg); RETURN_LONG(mpz_popcount(*gmpnum_a)); } /* }}} */ /* {{{ proto int gmp_hamdist(resource a, resource b) Calculates hamming distance between a and b */ ZEND_FUNCTION(gmp_hamdist) { zval **a_arg, **b_arg; mpz_t *gmpnum_a, *gmpnum_b; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &a_arg, &b_arg) == FAILURE){ WRONG_PARAM_COUNT; } FETCH_GMP_ZVAL(gmpnum_a, a_arg); FETCH_GMP_ZVAL(gmpnum_b, b_arg); RETURN_LONG(mpz_hamdist(*gmpnum_a, *gmpnum_b)); } /* }}} */ /* {{{ proto int gmp_scan0(resource a, int start) Finds first zero bit */ ZEND_FUNCTION(gmp_scan0) { zval **a_arg, **start_arg; mpz_t *gmpnum_a; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &a_arg, &start_arg) == FAILURE){ WRONG_PARAM_COUNT; } FETCH_GMP_ZVAL(gmpnum_a, a_arg); convert_to_long_ex(start_arg); RETURN_LONG(mpz_scan0(*gmpnum_a, Z_LVAL_PP(start_arg))); } /* }}} */ /* {{{ proto int gmp_scan1(resource a, int start) Finds first non-zero bit */ ZEND_FUNCTION(gmp_scan1) { zval **a_arg, **start_arg; mpz_t *gmpnum_a; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &a_arg, &start_arg) == FAILURE){ WRONG_PARAM_COUNT; } FETCH_GMP_ZVAL(gmpnum_a, a_arg); convert_to_long_ex(start_arg); RETURN_LONG(mpz_scan1(*gmpnum_a, Z_LVAL_PP(start_arg))); } /* }}} */ /* {{{ _php_gmpnum_free */ static void _php_gmpnum_free(zend_rsrc_list_entry *rsrc TSRMLS_DC) { mpz_t *gmpnum = (mpz_t *)rsrc->ptr; FREE_GMP_NUM(gmpnum); } /* }}} */ #endif /* HAVE_GMP */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: sw=4 ts=4 fdm=marker * vim<600: sw=4 ts=4 */ php-4.4.8/ext/gmp/tests/0000755000175000017500000000000010737115146014334 5ustar derickderickphp-4.4.8/ext/gmp/tests/001.phpt0000644000175000017500000000103707215715774015544 0ustar derickderick--TEST-- Check for gmp presence --SKIPIF-- --POST-- --GET-- --FILE-- --EXPECT-- gmp extension is availablephp-4.4.8/ext/gmp/tests/002.phpt0000644000175000017500000000545507442207001015532 0ustar derickderick--TEST-- GMP functionality test - factorial --SKIPIF-- --POST-- --GET-- --FILE-- --EXPECT-- 402387260077093773543702433923003985719374864210714632543799910429938512398629020592044208486969404800479988610197196058631666872994808558901323829669944590997424504087073759918823627727188732519779505950995276120874975462497043601418278094646496291056393887437886487337119181045825783647849977012476632889835955735432513185323958463075557409114262417474349347553428646576611667797396668820291207379143853719588249808126867838374559731746136085379534524221586593201928090878297308431392844403281231558611036976801357304216168747609675871348312025478589320767169132448426236131412508780208000261683151027341827977704784635868170164365024153691398281264810213092761244896359928705114964975419909342221566832572080821333186116811553615836546984046708975602900950537616475847728421889679646244945160765353408198901385442487984959953319101723355556602139450399736280750137837615307127761926849034352625200015888535147331611702103968175921510907788019393178114194545257223865541461062892187960223838971476088506276862967146674697562911234082439208160153780889893964518263243671616762179168909779911903754031274622289988005195444414282012187361745992642956581746628302955570299024324153181617210465832036786906117260158783520751516284225540265170483304226143974286933061690897968482590125458327168226458066526769958652682272807075781391858178889652208164348344825993266043367660176999612831860788386150279465955131156552036093988180612138558600301435694527224206344631797460594682573103790084024432438465657245014402821885252470935190620929023136493273497565513958720559654228749774011413346962715422845862377387538230483865688976461927383814900140767310446640259899490222221765904339901886018566526485061799702356193897017860040811889729918311021171229845901641921068884387121855646124960798722908519296819372388642614839657382291123125024186649353143970137428531926649875337218940694281434118520158014123344828015051399694290153483077644569099073152433278288269864602789864321139083506217095002597389863554277196742822248757586765752344220207573630569498825087968928162753848863396909959826280956121450994871701244516461260379029309120889086942028510640182154399457156805941872748998094254742173582401063677404595741785160829230135358081840096996372524230560855903700624271243416909004153690105933983835777939410970027753472000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 php-4.4.8/ext/gmp/tests/003.phpt0000644000175000017500000000174307431577241015545 0ustar derickderick--TEST-- Check for number base recognition --SKIPIF-- --POST-- --GET-- --FILE-- --EXPECT-- 1234 1234 10011010010 1234 1234 1234 2322 1234 1234 1234 1234 1234 0 1234 php-4.4.8/ext/gmp/tests/bug32773.phpt0000644000175000017500000000150210573572722016417 0ustar derickderick--TEST-- Bug #32773 binary GMP functions returns unexpected value, when second parameter is int(0) --SKIPIF-- --FILE-- --EXPECTF-- 10 + 0 = 10 10 + "0" = 10 Warning: gmp_div() [/phpmanual/function.gmp-div.html]: Zero operand not allowed in %s on line %d 0 Warning: gmp_div_qr() [/phpmanual/function.gmp-div-qr.html]: Zero operand not allowed in %s on line %d 0 php-4.4.8/ext/gmp/README0000644000175000017500000000041407222627141014047 0ustar derickderickArbitrary length number support with GNU MP library. Please see the PGP manual for more documentation. See also GNU MP home page at http://www.swox.com/gmp/. GNU MP library is available under the tems of GNU LGPL license. Please see http://www.swox.com/gmp/lgpl.html php-4.4.8/ext/gmp/config.m40000644000175000017500000000152107756572450014714 0ustar derickderickdnl dnl $Id: config.m4,v 1.7.4.3 2003/11/19 04:44:24 sniper Exp $ dnl PHP_ARG_WITH(gmp, for GNU MP support, [ --with-gmp[=DIR] Include GNU MP support]) if test "$PHP_GMP" != "no"; then for i in $PHP_GMP /usr/local /usr; do test -f $i/include/gmp.h && GMP_DIR=$i && break done if test -z "$GMP_DIR"; then AC_MSG_ERROR(Unable to locate gmp.h) fi PHP_CHECK_LIBRARY(gmp, __gmp_randinit_lc_2exp_size, [],[ PHP_CHECK_LIBRARY(gmp, gmp_randinit_lc_2exp_size, [],[ AC_MSG_ERROR([GNU MP Library version 4.1.2 or greater required.]) ],[ -L$GMP_DIR/lib ]) ],[ -L$GMP_DIR/lib ]) PHP_ADD_LIBRARY_WITH_PATH(gmp, $GMP_DIR/lib, GMP_SHARED_LIBADD) PHP_ADD_INCLUDE($GMP_DIR/include) PHP_NEW_EXTENSION(gmp, gmp.c, $ext_shared) PHP_SUBST(GMP_SHARED_LIBADD) AC_DEFINE(HAVE_GMP, 1, [ ]) fi php-4.4.8/ext/gmp/php_gmp.h0000644000175000017500000000547110736114307015001 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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: Stanislav Malyshev | +----------------------------------------------------------------------+ */ #ifndef PHP_GMP_H #define PHP_GMP_H #if HAVE_GMP #include extern zend_module_entry gmp_module_entry; #define phpext_gmp_ptr &gmp_module_entry #ifdef ZEND_WIN32 #define GMP_API __declspec(dllexport) #else #define GMP_API #endif ZEND_MODULE_STARTUP_D(gmp); ZEND_MODULE_SHUTDOWN_D(gmp); ZEND_MODULE_DEACTIVATE_D(gmp); ZEND_MODULE_INFO_D(gmp); ZEND_FUNCTION(gmp_init); ZEND_FUNCTION(gmp_intval); ZEND_FUNCTION(gmp_strval); ZEND_FUNCTION(gmp_add); ZEND_FUNCTION(gmp_sub); ZEND_FUNCTION(gmp_mul); ZEND_FUNCTION(gmp_div_qr); ZEND_FUNCTION(gmp_div_q); ZEND_FUNCTION(gmp_div_r); ZEND_FUNCTION(gmp_mod); ZEND_FUNCTION(gmp_divexact); ZEND_FUNCTION(gmp_neg); ZEND_FUNCTION(gmp_abs); ZEND_FUNCTION(gmp_fact); ZEND_FUNCTION(gmp_sqrt); ZEND_FUNCTION(gmp_pow); ZEND_FUNCTION(gmp_powm); ZEND_FUNCTION(gmp_sqrtrem); ZEND_FUNCTION(gmp_perfect_square); ZEND_FUNCTION(gmp_prob_prime); ZEND_FUNCTION(gmp_gcd); ZEND_FUNCTION(gmp_gcdext); ZEND_FUNCTION(gmp_invert); ZEND_FUNCTION(gmp_jacobi); ZEND_FUNCTION(gmp_legendre); ZEND_FUNCTION(gmp_cmp); ZEND_FUNCTION(gmp_sign); ZEND_FUNCTION(gmp_and); ZEND_FUNCTION(gmp_or); ZEND_FUNCTION(gmp_com); ZEND_FUNCTION(gmp_xor); ZEND_FUNCTION(gmp_random); ZEND_FUNCTION(gmp_setbit); ZEND_FUNCTION(gmp_clrbit); ZEND_FUNCTION(gmp_scan0); ZEND_FUNCTION(gmp_scan1); ZEND_FUNCTION(gmp_popcount); ZEND_FUNCTION(gmp_hamdist); ZEND_BEGIN_MODULE_GLOBALS(gmp) zend_bool rand_initialized; gmp_randstate_t rand_state; ZEND_END_MODULE_GLOBALS(gmp) #ifdef ZTS #define GMPG(v) TSRMG(gmp_globals_id, zend_gmp_globals *, v) #else #define GMPG(v) (gmp_globals.v) #endif #else #define phpext_gmp_ptr NULL #endif #endif /* PHP_GMP_H */ /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: */ php-4.4.8/ext/gmp/CREDITS0000644000175000017500000000004307324560760014213 0ustar derickderickGNU GMP support Stanislav Malyshev php-4.4.8/ext/pdf/0000755000175000017500000000000010737115146013160 5ustar derickderickphp-4.4.8/ext/pdf/pdf.c0000644000175000017500000024134010736114312014072 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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 | | Rainer Schaaf | +----------------------------------------------------------------------+ */ /* $Id: pdf.c,v 1.112.2.11.2.3 2007/12/31 07:22:50 sebastian Exp $ */ /* pdflib 2.02 ... 3.0x is subject to the ALADDIN FREE PUBLIC LICENSE. Copyright (C) 1997-1999 Thomas Merz. 2000-2001 PDFlib GmbH */ /* Note that there is no code from the pdflib package in this file */ /* {{{ includes */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "php.h" #include "php_ini.h" #include "php_globals.h" #include "zend_list.h" #include "ext/standard/head.h" #include "ext/standard/info.h" #include "ext/standard/file.h" #include "php_streams.h" #if HAVE_LIBGD13 #include "ext/gd/php_gd.h" #if HAVE_GD_BUNDLED #include "ext/gd/libgd/gd.h" #else #include "gd.h" #endif static int le_gd; #endif #ifdef HAVE_UNISTD_H # include #endif #ifdef PHP_WIN32 # include # include #endif /* }}} */ #if HAVE_PDFLIB #include "php_pdf.h" static int le_pdf; /* {{{ constants * to adopt the php way of error handling to PDFlib * The image related functions in PDFlib return -1 on error * but they may return 0 (FALSE) in normal cases * so this offset will repair this */ #define PDFLIB_IMAGE_OFFSET 1 #define PDFLIB_FONT_OFFSET 1 #define PDFLIB_PDI_OFFSET 1 #define PDFLIB_PATTERN_OFFSET 1 #define PDFLIB_SPOT_OFFSET 1 /* }}} */ /* {{{ pdf_functions[] */ function_entry pdf_functions[] = { PHP_FE(pdf_new, NULL) /* new function */ PHP_FE(pdf_delete, NULL) /* new function */ PHP_FE(pdf_open_file, NULL) /* new function */ PHP_FE(pdf_get_buffer, NULL) /* new function */ PHP_FE(pdf_close, NULL) PHP_FE(pdf_begin_page, NULL) PHP_FE(pdf_end_page, NULL) PHP_FE(pdf_get_majorversion, NULL) PHP_FE(pdf_get_minorversion, NULL) PHP_FE(pdf_get_value, NULL) PHP_FE(pdf_set_value, NULL) PHP_FE(pdf_get_parameter, NULL) PHP_FE(pdf_set_parameter, NULL) PHP_FE(pdf_findfont, NULL) /* new function */ PHP_FE(pdf_setfont, NULL) /* new function */ PHP_FE(pdf_show, NULL) PHP_FE(pdf_show_xy, NULL) PHP_FE(pdf_continue_text, NULL) PHP_FE(pdf_show_boxed, NULL) PHP_FE(pdf_stringwidth, NULL) /* new parameters: [int font, float size] */ PHP_FE(pdf_set_text_pos, NULL) PHP_FE(pdf_setdash, NULL) PHP_FE(pdf_setpolydash, NULL) /* new function: not yet finished */ PHP_FE(pdf_setflat, NULL) PHP_FE(pdf_setlinejoin, NULL) PHP_FE(pdf_setlinecap, NULL) PHP_FE(pdf_setmiterlimit, NULL) PHP_FE(pdf_setlinewidth, NULL) PHP_FE(pdf_save, NULL) PHP_FE(pdf_restore, NULL) PHP_FE(pdf_translate, NULL) PHP_FE(pdf_scale, NULL) PHP_FE(pdf_rotate, NULL) PHP_FE(pdf_skew, NULL) PHP_FE(pdf_concat, NULL) /* new function */ PHP_FE(pdf_moveto, NULL) PHP_FE(pdf_lineto, NULL) PHP_FE(pdf_curveto, NULL) PHP_FE(pdf_circle, NULL) PHP_FE(pdf_arc, NULL) PHP_FE(pdf_rect, NULL) PHP_FE(pdf_closepath, NULL) PHP_FE(pdf_stroke, NULL) PHP_FE(pdf_closepath_stroke, NULL) PHP_FE(pdf_fill, NULL) PHP_FE(pdf_fill_stroke, NULL) PHP_FE(pdf_closepath_fill_stroke, NULL) PHP_FE(pdf_clip, NULL) PHP_FE(pdf_endpath, NULL) PHP_FE(pdf_open_image_file, NULL) /* new parameters: [char *stringpram, int intparam] */ PHP_FE(pdf_open_ccitt, NULL) /* new function */ PHP_FE(pdf_open_image, NULL) /* new function */ PHP_FE(pdf_close_image, NULL) PHP_FE(pdf_place_image, NULL) PHP_FE(pdf_add_bookmark, NULL) PHP_FE(pdf_set_info, NULL) PHP_FE(pdf_attach_file, NULL) /* new function */ PHP_FE(pdf_add_note, NULL) /* new function */ PHP_FE(pdf_add_pdflink, NULL) PHP_FE(pdf_add_locallink, NULL) /* new function */ PHP_FE(pdf_add_launchlink, NULL)/* new function */ PHP_FE(pdf_add_weblink, NULL) PHP_FE(pdf_set_border_style, NULL) PHP_FE(pdf_set_border_color, NULL) PHP_FE(pdf_set_border_dash, NULL) /* End of the official PDFLIB V3.x API */ /* aliases for compatibility reasons */ PHP_FALIAS(pdf_add_outline, pdf_add_bookmark, NULL) /* old font handling */ PHP_FE(pdf_set_font, NULL) /* deprecated */ PHP_FE(pdf_get_font, NULL) /* deprecated */ PHP_FE(pdf_get_fontname, NULL) /* deprecated */ PHP_FE(pdf_get_fontsize, NULL) /* deprecated */ /* old way of starting a PDF document */ PHP_FE(pdf_open, NULL) /* deprecated */ /* old stuff for setting infos */ PHP_FE(pdf_set_info_creator, NULL) /* deprecated */ PHP_FE(pdf_set_info_title, NULL) /* deprecated */ PHP_FE(pdf_set_info_subject, NULL) /* deprecated */ PHP_FE(pdf_set_info_author, NULL) /* deprecated */ PHP_FE(pdf_set_info_keywords, NULL) /* deprecated */ PHP_FE(pdf_set_leading, NULL) /* deprecated */ PHP_FE(pdf_set_text_rendering, NULL) /* deprecated */ PHP_FE(pdf_set_horiz_scaling, NULL) /* deprecated */ PHP_FE(pdf_set_text_rise, NULL) /* deprecated */ PHP_FE(pdf_set_char_spacing, NULL) /* deprecated */ PHP_FE(pdf_set_word_spacing, NULL) /* deprecated */ PHP_FE(pdf_set_transition, NULL) /* deprecated */ PHP_FE(pdf_set_duration, NULL) /* deprecated */ PHP_FE(pdf_get_image_height, NULL) /* deprecated */ PHP_FE(pdf_get_image_width, NULL) /* deprecated */ /* old stuff for opening images */ PHP_FE(pdf_open_jpeg, NULL) /* deprecated */ PHP_FE(pdf_open_tiff, NULL) /* deprecated */ PHP_FE(pdf_open_png, NULL) /* deprecated */ PHP_FE(pdf_open_gif, NULL) /* deprecated */ /* some more stuff for compatibility */ PHP_FE(pdf_add_annotation, NULL) #if HAVE_LIBGD13 PHP_FE(pdf_open_memory_image, NULL) #endif /* depreciatet after V4.0 of PDFlib */ PHP_FE(pdf_setgray_fill, NULL) PHP_FE(pdf_setgray_stroke, NULL) PHP_FE(pdf_setgray, NULL) PHP_FE(pdf_setrgbcolor_fill, NULL) PHP_FE(pdf_setrgbcolor_stroke, NULL) PHP_FE(pdf_setrgbcolor, NULL) #if (PDFLIB_MAJORVERSION >= 4) /* support for new functions in PDFlib V4.0 */ PHP_FE(pdf_open_pdi, NULL) PHP_FE(pdf_close_pdi, NULL) PHP_FE(pdf_open_pdi_page, NULL) PHP_FE(pdf_place_pdi_page, NULL) PHP_FE(pdf_close_pdi_page, NULL) PHP_FE(pdf_get_pdi_parameter, NULL) PHP_FE(pdf_get_pdi_value, NULL) PHP_FE(pdf_begin_pattern, NULL) PHP_FE(pdf_end_pattern, NULL) PHP_FE(pdf_begin_template, NULL) PHP_FE(pdf_end_template, NULL) PHP_FE(pdf_setcolor, NULL) PHP_FE(pdf_makespotcolor, NULL) PHP_FE(pdf_arcn, NULL) PHP_FE(pdf_add_thumbnail, NULL) PHP_FE(pdf_initgraphics, NULL) PHP_FE(pdf_setmatrix, NULL) #endif /* PDFlib >= V4 */ {NULL, NULL, NULL} }; /* }}} */ /* {{{ pdf_module_entry */ zend_module_entry pdf_module_entry = { STANDARD_MODULE_HEADER, "pdf", pdf_functions, PHP_MINIT(pdf), PHP_MSHUTDOWN(pdf), NULL, NULL, PHP_MINFO(pdf), NO_VERSION_YET, STANDARD_MODULE_PROPERTIES }; /* }}} */ #ifdef COMPILE_DL_PDF ZEND_GET_MODULE(pdf) #endif /* {{{ _free_pdf_doc */ static void _free_pdf_doc(zend_rsrc_list_entry *rsrc TSRMLS_DC) { PDF *pdf = (PDF *)rsrc->ptr; PDF_delete(pdf); } /* }}} */ /* {{{ custom_errorhandler */ static void custom_errorhandler(PDF *p, int type, const char *shortmsg) { switch (type){ case PDF_NonfatalError: /* * PDFlib warnings should be visible to the user. * If he decides to live with PDFlib warnings * he may use the PDFlib function * pdf_set_parameter($p, "warning" 0) to switch off * the warnings inside PDFlib. */ php_error(E_WARNING,"Internal PDFlib warning: %s", shortmsg); return; case PDF_MemoryError: /* give up in all other cases */ case PDF_IOError: case PDF_RuntimeError: case PDF_IndexError: case PDF_TypeError: case PDF_DivisionByZero: case PDF_OverflowError: case PDF_SyntaxError: case PDF_ValueError: case PDF_SystemError: case PDF_UnknownError: default: php_error(E_ERROR,"PDFlib error: %s", shortmsg); } } /* }}} */ /* {{{ pdf_emalloc */ static void *pdf_emalloc(PDF *p, size_t size, const char *caller) { return(emalloc(size)); } /* }}} */ /* {{{ pdf_realloc */ static void *pdf_realloc(PDF *p, void *mem, size_t size, const char *caller) { return(erealloc(mem, size)); } /* }}} */ /* {{{ pdf_efree */ static void pdf_efree(PDF *p, void *mem) { efree(mem); } /* }}} */ /* {{{ pdf_flushwrite */ static size_t pdf_flushwrite(PDF *p, void *data, size_t size) { TSRMLS_FETCH(); return(php_write(data, size TSRMLS_CC)); } /* }}} */ /* {{{ PHP_MINFO_FUNCTION */ PHP_MINFO_FUNCTION(pdf) { char tmp[32]; snprintf(tmp, 31, "%d.%02d", PDF_get_majorversion(), PDF_get_minorversion() ); tmp[31]=0; php_info_print_table_start(); php_info_print_table_row(2, "PDF Support", "enabled" ); #if (PDFLIB_MAJORVERSION >= 4) php_info_print_table_row(2, "PDFlib GmbH Version", PDFLIB_VERSIONSTRING ); #else php_info_print_table_row(2, "PDFlib GmbH Version", tmp ); #endif php_info_print_table_row(2, "Revision", "$Revision: 1.112.2.11.2.3 $" ); php_info_print_table_end(); } /* }}} */ /* {{{ PHP_MINIT_FUNCTION */ PHP_MINIT_FUNCTION(pdf) { if ((PDF_get_majorversion() != PDFLIB_MAJORVERSION) || (PDF_get_minorversion() != PDFLIB_MINORVERSION)) { php_error(E_ERROR,"PDFlib error: Version mismatch in wrapper code"); } le_pdf = zend_register_list_destructors_ex(_free_pdf_doc, NULL, "pdf object", module_number); /* this does something like setlocale("C", ...) in PDFlib 3.x */ PDF_boot(); return SUCCESS; } /* }}} */ /* {{{ PHP_MSHUTDOWN_FUNCTION */ PHP_MSHUTDOWN_FUNCTION(pdf) { PDF_shutdown(); return SUCCESS; } /* }}} */ /* {{{ _php_pdf_set_info */ static void _php_pdf_set_info(INTERNAL_FUNCTION_PARAMETERS, char *field) { zval **arg1, **arg2; PDF *pdf; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_string_ex(arg2); PDF_set_info(pdf, field, Z_STRVAL_PP(arg2)); RETURN_TRUE; } /* }}} */ /* {{{ proto bool pdf_set_info(int pdfdoc, string fieldname, string value) Fills an info field of the document */ PHP_FUNCTION(pdf_set_info) { zval **arg1, **arg2, **arg3; PDF *pdf; if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_string_ex(arg2); convert_to_string_ex(arg3); PDF_set_info(pdf, Z_STRVAL_PP(arg2), Z_STRVAL_PP(arg3)); RETURN_TRUE; } /* }}} */ /* {{{ proto bool pdf_set_info_creator(int pdfdoc, string creator) Fills the creator field of the document */ PHP_FUNCTION(pdf_set_info_creator) { _php_pdf_set_info(INTERNAL_FUNCTION_PARAM_PASSTHRU, "Creator"); } /* }}} */ /* {{{ proto bool pdf_set_info_title(int pdfdoc, string title) Fills the title field of the document */ PHP_FUNCTION(pdf_set_info_title) { _php_pdf_set_info(INTERNAL_FUNCTION_PARAM_PASSTHRU, "Title"); } /* }}} */ /* {{{ proto bool pdf_set_info_subject(int pdfdoc, string subject) Fills the subject field of the document */ PHP_FUNCTION(pdf_set_info_subject) { _php_pdf_set_info(INTERNAL_FUNCTION_PARAM_PASSTHRU, "Subject"); } /* }}} */ /* {{{ proto bool pdf_set_info_author(int pdfdoc, string author) Fills the author field of the document */ PHP_FUNCTION(pdf_set_info_author) { _php_pdf_set_info(INTERNAL_FUNCTION_PARAM_PASSTHRU, "Author"); } /* }}} */ /* {{{ proto bool pdf_set_info_keywords(int pdfdoc, string keywords) Fills the keywords field of the document */ PHP_FUNCTION(pdf_set_info_keywords) { _php_pdf_set_info(INTERNAL_FUNCTION_PARAM_PASSTHRU, "Keywords"); } /* }}} */ /* {{{ proto int pdf_open([int filedesc]) Opens a new pdf document. If filedesc is NULL, document is created in memory. This is the old interface, only for compatibility use pdf_new + pdf_open_file instead */ PHP_FUNCTION(pdf_open) { zval **file; FILE *fp = NULL; PDF *pdf; int argc = ZEND_NUM_ARGS(); if(argc > 1) { WRONG_PARAM_COUNT; } else if (argc != 1 || zend_get_parameters_ex(1, &file) == FAILURE) { fp = NULL; } else { php_stream *stream; php_stream_from_zval(stream, file); if (php_stream_cast(stream, PHP_STREAM_AS_STDIO, (void*)&fp, 1) == FAILURE) { RETURN_FALSE; } } pdf = PDF_new2(custom_errorhandler, pdf_emalloc, pdf_realloc, pdf_efree, NULL); if(fp) { if (PDF_open_fp(pdf, fp) < 0) { RETURN_FALSE; } } else { PDF_open_mem(pdf, pdf_flushwrite); } #if (PDFLIB_MAJORVERSION >= 4) PDF_set_parameter(pdf, "imagewarning", "true"); #endif PDF_set_parameter(pdf, "binding", "PHP"); ZEND_REGISTER_RESOURCE(return_value, pdf, le_pdf); } /* }}} */ /* {{{ proto void pdf_close(int pdfdoc) Closes the pdf document */ PHP_FUNCTION(pdf_close) { zval **arg1; PDF *pdf; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); PDF_close(pdf); RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_begin_page(int pdfdoc, float width, float height) Starts page */ PHP_FUNCTION(pdf_begin_page) { zval **arg1, **arg2, **arg3; PDF *pdf; if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_double_ex(arg2); convert_to_double_ex(arg3); PDF_begin_page(pdf, (float) Z_DVAL_PP(arg2), (float) Z_DVAL_PP(arg3)); RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_end_page(int pdfdoc) Ends page */ PHP_FUNCTION(pdf_end_page) { zval **arg1; PDF *pdf; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); PDF_end_page(pdf); RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_show(int pdfdoc, string text) Output text at current position */ PHP_FUNCTION(pdf_show) { zval **arg1, **arg2; PDF *pdf; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_string_ex(arg2); PDF_show2(pdf, Z_STRVAL_PP(arg2), Z_STRLEN_PP(arg2)); RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_show_xy(int pdfdoc, string text, float x_koor, float y_koor) Output text at position */ PHP_FUNCTION(pdf_show_xy) { zval **arg1, **arg2, **arg3, **arg4; PDF *pdf; if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &arg1, &arg2, &arg3, &arg4) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_string_ex(arg2); convert_to_double_ex(arg3); convert_to_double_ex(arg4); PDF_show_xy2(pdf, Z_STRVAL_PP(arg2), Z_STRLEN_PP(arg2), (float) Z_DVAL_PP(arg3), (float) Z_DVAL_PP(arg4)); RETURN_TRUE; } /* }}} */ /* {{{ proto int pdf_show_boxed(int pdfdoc, string text, float x_koor, float y_koor, float width, float height, string mode [, string feature]) Output text formated in a boxed */ PHP_FUNCTION(pdf_show_boxed) { zval **argv[8]; int argc = ZEND_NUM_ARGS(); int nr; char *feature; PDF *pdf; if (((argc < 7) || (argc > 8)) || zend_get_parameters_array_ex(argc, argv) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, argv[0], -1, "pdf object", le_pdf); convert_to_string_ex(argv[1]); convert_to_double_ex(argv[2]); convert_to_double_ex(argv[3]); convert_to_double_ex(argv[4]); convert_to_double_ex(argv[5]); convert_to_string_ex(argv[6]); if(argc == 8) { convert_to_string_ex(argv[7]); feature = Z_STRVAL_PP(argv[7]); } else { feature = NULL; } nr = PDF_show_boxed(pdf, Z_STRVAL_PP(argv[1]), (float) Z_DVAL_PP(argv[2]), (float) Z_DVAL_PP(argv[3]), (float) Z_DVAL_PP(argv[4]), (float) Z_DVAL_PP(argv[5]), Z_STRVAL_PP(argv[6]), feature); RETURN_LONG(nr); } /* }}} */ /* {{{ proto void pdf_set_font(int pdfdoc, string font, float size, string encoding [, int embed]) Select the current font face, size and encoding */ PHP_FUNCTION(pdf_set_font) { zval **arg1, **arg2, **arg3, **arg4, **arg5; int font, embed; PDF *pdf; switch (ZEND_NUM_ARGS()) { case 4: if (zend_get_parameters_ex(4, &arg1, &arg2, &arg3, &arg4) == FAILURE) { WRONG_PARAM_COUNT; } embed = 0; break; case 5: if (zend_get_parameters_ex(5, &arg1, &arg2, &arg3, &arg4, &arg5) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_long_ex(arg5); embed = Z_LVAL_PP(arg5); break; default: WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_string_ex(arg2); convert_to_double_ex(arg3); convert_to_string_ex(arg4); font = PDF_findfont(pdf, Z_STRVAL_PP(arg2), Z_STRVAL_PP(arg4), embed); if (font == -1) { php_error(E_WARNING,"Font %s not found", Z_STRVAL_PP(arg2)); RETURN_FALSE; } PDF_setfont(pdf, font, (float) Z_DVAL_PP(arg3)); RETURN_TRUE; } /* }}} */ /* {{{ _php_pdf_set_value */ static void _php_pdf_set_value(INTERNAL_FUNCTION_PARAMETERS, char *field) { zval **arg1, **arg2; PDF *pdf; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_double_ex(arg2); PDF_set_value(pdf, field, (float)Z_DVAL_PP(arg2)); RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_set_value(int pdfdoc, string key, float value) Sets arbitrary value */ PHP_FUNCTION(pdf_set_value) { zval **arg1, **arg2, **arg3; PDF *pdf; if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_string_ex(arg2); convert_to_double_ex(arg3); PDF_set_value(pdf, Z_STRVAL_PP(arg2), (float)Z_DVAL_PP(arg3)); RETURN_TRUE; } /* }}} */ /* {{{ proto float pdf_get_value(int pdfdoc, string key, float modifier) Gets arbitrary value */ PHP_FUNCTION(pdf_get_value) { zval **argv[3]; int argc = ZEND_NUM_ARGS(); PDF *pdf; double value; if(((argc < 2) || (argc > 3)) || zend_get_parameters_array_ex(argc, argv) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, argv[0], -1, "pdf object", le_pdf); convert_to_string_ex(argv[1]); if(argc == 3) convert_to_double_ex(argv[2]); if(0 == (strcmp(Z_STRVAL_PP(argv[1]), "imagewidth"))) { if(argc < 3) WRONG_PARAM_COUNT; value = PDF_get_value(pdf, Z_STRVAL_PP(argv[1]), (float)Z_DVAL_PP(argv[2])-PDFLIB_IMAGE_OFFSET); } else if(0 == (strcmp(Z_STRVAL_PP(argv[1]), "imageheight"))) { if(argc < 3) WRONG_PARAM_COUNT; value = PDF_get_value(pdf, Z_STRVAL_PP(argv[1]), (float)Z_DVAL_PP(argv[2])-PDFLIB_IMAGE_OFFSET); } else if(0 == (strcmp(Z_STRVAL_PP(argv[1]), "resx"))) { if(argc < 3) WRONG_PARAM_COUNT; value = PDF_get_value(pdf, Z_STRVAL_PP(argv[1]), (float)Z_DVAL_PP(argv[2])-PDFLIB_IMAGE_OFFSET); } else if(0 == (strcmp(Z_STRVAL_PP(argv[1]), "resy"))) { if(argc < 3) WRONG_PARAM_COUNT; value = PDF_get_value(pdf, Z_STRVAL_PP(argv[1]), (float)Z_DVAL_PP(argv[2])-PDFLIB_IMAGE_OFFSET); } else if(0 == (strcmp(Z_STRVAL_PP(argv[1]), "capheight"))) { if(argc < 3) WRONG_PARAM_COUNT; value = PDF_get_value(pdf, Z_STRVAL_PP(argv[1]), (float)Z_DVAL_PP(argv[2])-PDFLIB_FONT_OFFSET); } else if(0 == (strcmp(Z_STRVAL_PP(argv[1]), "ascender"))) { if(argc < 3) WRONG_PARAM_COUNT; value = PDF_get_value(pdf, Z_STRVAL_PP(argv[1]), (float)Z_DVAL_PP(argv[2])-PDFLIB_FONT_OFFSET); } else if(0 == (strcmp(Z_STRVAL_PP(argv[1]), "descender"))) { if(argc < 3) WRONG_PARAM_COUNT; value = PDF_get_value(pdf, Z_STRVAL_PP(argv[1]), (float)Z_DVAL_PP(argv[2])-PDFLIB_FONT_OFFSET); } else if(0 == (strcmp(Z_STRVAL_PP(argv[1]), "font"))) { value = PDF_get_value(pdf, Z_STRVAL_PP(argv[1]), 0.0)+PDFLIB_FONT_OFFSET; } else { if(argc < 3) { value = PDF_get_value(pdf, Z_STRVAL_PP(argv[1]), 0.0); } else { value = PDF_get_value(pdf, Z_STRVAL_PP(argv[1]), (float)Z_DVAL_PP(argv[2])); } } RETURN_DOUBLE(value); } /* }}} */ /* {{{ proto int pdf_get_font(int pdfdoc) Gets the current font */ PHP_FUNCTION(pdf_get_font) { zval **arg1; int font; PDF *pdf; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); font = (int) PDF_get_value(pdf, "font", 0); RETURN_LONG(font+PDFLIB_FONT_OFFSET); } /* }}} */ /* {{{ proto string pdf_get_fontname(int pdfdoc) Gets the current font name */ PHP_FUNCTION(pdf_get_fontname) { zval **arg1; char *fontname; PDF *pdf; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); fontname = (char *) PDF_get_parameter(pdf, "fontname", 0); RETURN_STRING(fontname, 1); } /* }}} */ /* {{{ proto float pdf_get_fontsize(int pdfdoc) Gets the current font size */ PHP_FUNCTION(pdf_get_fontsize) { zval **arg1; float fontsize; PDF *pdf; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); fontsize = PDF_get_value(pdf, "fontsize", 0); RETURN_DOUBLE(fontsize); } /* }}} */ /* {{{ proto void pdf_set_leading(int pdfdoc, float distance) Sets distance between text lines */ PHP_FUNCTION(pdf_set_leading) { _php_pdf_set_value(INTERNAL_FUNCTION_PARAM_PASSTHRU, "leading"); } /* }}} */ /* {{{ proto void pdf_set_text_rendering(int pdfdoc, int mode) Determines how text is rendered */ PHP_FUNCTION(pdf_set_text_rendering) { _php_pdf_set_value(INTERNAL_FUNCTION_PARAM_PASSTHRU, "textrendering"); } /* }}} */ /* {{{ proto void pdf_set_horiz_scaling(int pdfdoc, float scale) Sets horizontal scaling of text */ PHP_FUNCTION(pdf_set_horiz_scaling) { _php_pdf_set_value(INTERNAL_FUNCTION_PARAM_PASSTHRU, "horizscaling"); } /* }}} */ /* {{{ proto void pdf_set_text_rise(int pdfdoc, float value) Sets the text rise */ PHP_FUNCTION(pdf_set_text_rise) { _php_pdf_set_value(INTERNAL_FUNCTION_PARAM_PASSTHRU, "textrise"); } /* }}} */ /* {{{ proto void pdf_set_char_spacing(int pdfdoc, float space) Sets character spacing */ PHP_FUNCTION(pdf_set_char_spacing) { _php_pdf_set_value(INTERNAL_FUNCTION_PARAM_PASSTHRU, "charspacing"); } /* }}} */ /* {{{ proto void pdf_set_word_spacing(int pdfdoc, float space) Sets spacing between words */ PHP_FUNCTION(pdf_set_word_spacing) { _php_pdf_set_value(INTERNAL_FUNCTION_PARAM_PASSTHRU, "wordspacing"); } /* }}} */ /* {{{ proto void pdf_set_text_pos(int pdfdoc, float x, float y) Sets the position of text for the next pdf_show call */ PHP_FUNCTION(pdf_set_text_pos) { zval **arg1, **arg2, **arg3; PDF *pdf; if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_double_ex(arg2); convert_to_double_ex(arg3); PDF_set_text_pos(pdf, (float) Z_DVAL_PP(arg2), (float) Z_DVAL_PP(arg3)); RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_continue_text(int pdfdoc, string text) Output text in next line */ PHP_FUNCTION(pdf_continue_text) { zval **arg1, **arg2; PDF *pdf; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_string_ex(arg2); PDF_continue_text2(pdf, Z_STRVAL_PP(arg2), Z_STRLEN_PP(arg2)); RETURN_TRUE; } /* }}} */ /* {{{ proto float pdf_stringwidth(int pdfdoc, string text [, int font, float size]) Returns width of text in current font */ PHP_FUNCTION(pdf_stringwidth) { zval **arg1, **arg2, **arg3, **arg4; int font; double width, size; PDF *pdf; switch (ZEND_NUM_ARGS()) { case 2: if (zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) WRONG_PARAM_COUNT; break; case 4: if (zend_get_parameters_ex(4, &arg1, &arg2, &arg3, &arg4) == FAILURE) WRONG_PARAM_COUNT; convert_to_long_ex(arg3); break; default: WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_string_ex(arg2); if (ZEND_NUM_ARGS() == 2) { font = (int)PDF_get_value(pdf, "font", 0)+PDFLIB_FONT_OFFSET; size = PDF_get_value(pdf, "fontsize", 0); } else { convert_to_long_ex(arg3); font = Z_LVAL_PP(arg3); convert_to_double_ex(arg4); size = Z_DVAL_PP(arg4); } width = (double) PDF_stringwidth2(pdf, Z_STRVAL_PP(arg2), Z_STRLEN_PP(arg2), font-PDFLIB_FONT_OFFSET, (float)size); RETURN_DOUBLE((double) width); } /* }}} */ /* {{{ proto void pdf_save(int pdfdoc) Saves current enviroment */ PHP_FUNCTION(pdf_save) { zval **arg1; PDF *pdf; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); PDF_save(pdf); RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_restore(int pdfdoc) Restores formerly saved enviroment */ PHP_FUNCTION(pdf_restore) { zval **arg1; PDF *pdf; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); PDF_restore(pdf); RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_translate(int pdfdoc, float x, float y) Sets origin of coordinate system */ PHP_FUNCTION(pdf_translate) { zval **arg1, **arg2, **arg3; PDF *pdf; if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_double_ex(arg2); convert_to_double_ex(arg3); PDF_translate(pdf, (float) Z_DVAL_PP(arg2), (float) Z_DVAL_PP(arg3)); RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_scale(int pdfdoc, float x_scale, float y_scale) Sets scaling */ PHP_FUNCTION(pdf_scale) { zval **arg1, **arg2, **arg3; PDF *pdf; if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_double_ex(arg2); convert_to_double_ex(arg3); PDF_scale(pdf, (float) Z_DVAL_PP(arg2), (float) Z_DVAL_PP(arg3)); RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_rotate(int pdfdoc, float angle) Sets rotation */ PHP_FUNCTION(pdf_rotate) { zval **arg1, **arg2; PDF *pdf; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_double_ex(arg2); PDF_rotate(pdf, (float) Z_DVAL_PP(arg2)); RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_skew(int pdfdoc, float xangle, float yangle) Skew the coordinate system */ PHP_FUNCTION(pdf_skew) { zval **arg1, **arg2, **arg3; PDF *pdf; if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_double_ex(arg2); convert_to_double_ex(arg3); PDF_skew(pdf, (float) Z_DVAL_PP(arg2), (float) Z_DVAL_PP(arg3)); RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_setflat(int pdfdoc, float value) Sets flatness */ PHP_FUNCTION(pdf_setflat) { zval **arg1, **arg2; PDF *pdf; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_double_ex(arg2); /* pdflib will do this for you, will throw some exception if((Z_LVAL_PP(arg2) > 100) && (Z_LVAL_PP(arg2) < 0)) { php_error(E_WARNING,"Parameter of pdf_setflat() has to between 0 and 100"); RETURN_FALSE; } */ PDF_setflat(pdf, (float) Z_DVAL_PP(arg2)); RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_setlinejoin(int pdfdoc, int value) Sets linejoin parameter */ PHP_FUNCTION(pdf_setlinejoin) { zval **arg1, **arg2; PDF *pdf; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_long_ex(arg2); /* pdflib will do this for you, will throw some exception if((Z_LVAL_PP(arg2) > 2) && (Z_LVAL_PP(arg2) < 0)) { php_error(E_WARNING,"Parameter of pdf_setlinejoin() must be between 0 and 2"); RETURN_FALSE; } */ PDF_setlinejoin(pdf, Z_LVAL_PP(arg2)); RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_setlinecap(int pdfdoc, int value) Sets linecap parameter */ PHP_FUNCTION(pdf_setlinecap) { zval **arg1, **arg2; PDF *pdf; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_long_ex(arg2); /* pdflib will do this for you, will throw some exception if((Z_LVAL_PP(arg2) > 2) && (Z_LVAL_PP(arg2) < 0)) { php_error(E_WARNING,"Parameter of pdf_setlinecap() must be > 0 and <= 2"); RETURN_FALSE; } */ PDF_setlinecap(pdf, Z_LVAL_PP(arg2)); RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_setmiterlimit(int pdfdoc, float value) Sets miter limit */ PHP_FUNCTION(pdf_setmiterlimit) { zval **arg1, **arg2; PDF *pdf; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_double_ex(arg2); /* pdflib will do this for you, will throw some exception if(Z_DVAL_PP(arg2) < 1) { php_error(E_WARNING,"Parameter of pdf_setmiterlimit() must be >= 1"); RETURN_FALSE; } */ PDF_setmiterlimit(pdf, (float) Z_DVAL_PP(arg2)); RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_setlinewidth(int pdfdoc, float width) Sets line width */ PHP_FUNCTION(pdf_setlinewidth) { zval **arg1, **arg2; PDF *pdf; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_double_ex(arg2); PDF_setlinewidth(pdf, (float) Z_DVAL_PP(arg2)); RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_setdash(int pdfdoc, float black, float white) Sets dash pattern */ PHP_FUNCTION(pdf_setdash) { zval **arg1, **arg2, **arg3; PDF *pdf; if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_double_ex(arg2); convert_to_double_ex(arg3); PDF_setdash(pdf, (float) Z_DVAL_PP(arg2), (float) Z_DVAL_PP(arg3)); RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_moveto(int pdfdoc, float x, float y) Sets current point */ PHP_FUNCTION(pdf_moveto) { zval **arg1, **arg2, **arg3; PDF *pdf; if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_double_ex(arg2); convert_to_double_ex(arg3); PDF_moveto(pdf, (float) Z_DVAL_PP(arg2), (float) Z_DVAL_PP(arg3)); RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_curveto(int pdfdoc, float x1, float y1, float x2, float y2, float x3, float y3) Draws a curve */ PHP_FUNCTION(pdf_curveto) { zval **arg1, **arg2, **arg3, **arg4, **arg5, **arg6, **arg7; PDF *pdf; if (ZEND_NUM_ARGS() != 7 || zend_get_parameters_ex(7, &arg1, &arg2, &arg3, &arg4, &arg5, &arg6, &arg7) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_double_ex(arg2); convert_to_double_ex(arg3); convert_to_double_ex(arg4); convert_to_double_ex(arg5); convert_to_double_ex(arg6); convert_to_double_ex(arg7); PDF_curveto(pdf, (float) Z_DVAL_PP(arg2), (float) Z_DVAL_PP(arg3), (float) Z_DVAL_PP(arg4), (float) Z_DVAL_PP(arg5), (float) Z_DVAL_PP(arg6), (float) Z_DVAL_PP(arg7)); RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_lineto(int pdfdoc, float x, float y) Draws a line */ PHP_FUNCTION(pdf_lineto) { zval **arg1, **arg2, **arg3; PDF *pdf; if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_double_ex(arg2); convert_to_double_ex(arg3); PDF_lineto(pdf, (float) Z_DVAL_PP(arg2), (float) Z_DVAL_PP(arg3)); RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_circle(int pdfdoc, float x, float y, float radius) Draws a circle */ PHP_FUNCTION(pdf_circle) { zval **arg1, **arg2, **arg3, **arg4; PDF *pdf; if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &arg1, &arg2, &arg3, &arg4) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_double_ex(arg2); convert_to_double_ex(arg3); convert_to_double_ex(arg4); PDF_circle(pdf, (float) Z_DVAL_PP(arg2), (float) Z_DVAL_PP(arg3), (float) Z_DVAL_PP(arg4)); RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_arc(int pdfdoc, float x, float y, float radius, float start, float end) Draws an arc */ PHP_FUNCTION(pdf_arc) { zval **arg1, **arg2, **arg3, **arg4, **arg5, **arg6; PDF *pdf; if (ZEND_NUM_ARGS() != 6 || zend_get_parameters_ex(6, &arg1, &arg2, &arg3, &arg4, &arg5, &arg6) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_double_ex(arg2); convert_to_double_ex(arg3); convert_to_double_ex(arg4); convert_to_double_ex(arg5); convert_to_double_ex(arg6); PDF_arc(pdf, (float) Z_DVAL_PP(arg2), (float) Z_DVAL_PP(arg3), (float) Z_DVAL_PP(arg4), (float) Z_DVAL_PP(arg5), (float) Z_DVAL_PP(arg6)); RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_rect(int pdfdoc, float x, float y, float width, float height) Draws a rectangle */ PHP_FUNCTION(pdf_rect) { zval **arg1, **arg2, **arg3, **arg4, **arg5; PDF *pdf; if (ZEND_NUM_ARGS() != 5 || zend_get_parameters_ex(5, &arg1, &arg2, &arg3, &arg4, &arg5) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_double_ex(arg2); convert_to_double_ex(arg3); convert_to_double_ex(arg4); convert_to_double_ex(arg5); PDF_rect(pdf, (float) Z_DVAL_PP(arg2), (float) Z_DVAL_PP(arg3), (float) Z_DVAL_PP(arg4), (float) Z_DVAL_PP(arg5)); RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_closepath(int pdfdoc) Close path */ PHP_FUNCTION(pdf_closepath) { zval **arg1; PDF *pdf; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); PDF_closepath(pdf); RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_closepath_stroke(int pdfdoc) Close path and draw line along path */ PHP_FUNCTION(pdf_closepath_stroke) { zval **arg1; PDF *pdf; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); PDF_closepath_stroke(pdf); RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_stroke(int pdfdoc) Draw line along path path */ PHP_FUNCTION(pdf_stroke) { zval **arg1; PDF *pdf; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); PDF_stroke(pdf); RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_fill(int pdfdoc) Fill current path */ PHP_FUNCTION(pdf_fill) { zval **arg1; PDF *pdf; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); PDF_fill(pdf); RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_fill_stroke(int pdfdoc) Fill and stroke current path */ PHP_FUNCTION(pdf_fill_stroke) { zval **arg1; PDF *pdf; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); PDF_fill_stroke(pdf); RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_closepath_fill_stroke(int pdfdoc) Close, fill and stroke current path */ PHP_FUNCTION(pdf_closepath_fill_stroke) { zval **arg1; PDF *pdf; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); PDF_closepath_fill_stroke(pdf); RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_endpath(int pdfdoc) Ends current path */ PHP_FUNCTION(pdf_endpath) { zval **arg1; PDF *pdf; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); PDF_endpath(pdf); RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_clip(int pdfdoc) Clips to current path */ PHP_FUNCTION(pdf_clip) { zval **arg1; PDF *pdf; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); PDF_clip(pdf); RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_set_parameter(int pdfdoc, string key, string value) Sets arbitrary parameters */ PHP_FUNCTION(pdf_set_parameter) { zval **arg1, **arg2, **arg3; PDF *pdf; if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_string_ex(arg2); convert_to_string_ex(arg3); PDF_set_parameter(pdf, Z_STRVAL_PP(arg2), Z_STRVAL_PP(arg3)); RETURN_TRUE; } /* }}} */ /* {{{ proto string pdf_get_parameter(int pdfdoc, string key, mixed modifier) Gets arbitrary parameters */ PHP_FUNCTION(pdf_get_parameter) { zval **argv[3]; int argc = ZEND_NUM_ARGS(); PDF *pdf; char *value; if(((argc < 2) || (argc > 3)) || zend_get_parameters_array_ex(argc, argv) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, argv[0], -1, "pdf object", le_pdf); convert_to_string_ex(argv[1]); if(argc == 3) { convert_to_double_ex(argv[2]); value = (char *) PDF_get_parameter(pdf, Z_STRVAL_PP(argv[1]), (float) Z_DVAL_PP(argv[2])); } else { value = (char *) PDF_get_parameter(pdf, Z_STRVAL_PP(argv[1]), 0.0); } RETURN_STRING(value, 1); } /* }}} */ /* {{{ proto void pdf_setgray_fill(int pdfdoc, float value) Sets filling color to gray value */ PHP_FUNCTION(pdf_setgray_fill) { zval **arg1, **arg2; PDF *pdf; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_double_ex(arg2); #if (PDFLIB_MAJORVERSION >= 4) PDF_setcolor(pdf, "fill", "gray", (float) Z_DVAL_PP(arg2), 0, 0, 0); #else PDF_setgray_fill(pdf, (float) Z_DVAL_PP(arg2)); #endif RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_setgray_stroke(int pdfdoc, float value) Sets drawing color to gray value */ PHP_FUNCTION(pdf_setgray_stroke) { zval **arg1, **arg2; PDF *pdf; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_double_ex(arg2); #if (PDFLIB_MAJORVERSION >= 4) PDF_setcolor(pdf, "stroke", "gray", (float) Z_DVAL_PP(arg2), 0, 0, 0); #else PDF_setgray_stroke(pdf, (float) Z_DVAL_PP(arg2)); #endif RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_setgray(int pdfdoc, float value) Sets drawing and filling color to gray value */ PHP_FUNCTION(pdf_setgray) { zval **arg1, **arg2; PDF *pdf; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_double_ex(arg2); #if (PDFLIB_MAJORVERSION >= 4) PDF_setcolor(pdf, "both", "gray", (float) Z_DVAL_PP(arg2), 0, 0, 0); #else PDF_setgray(pdf, (float) Z_DVAL_PP(arg2)); #endif RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_setrgbcolor_fill(int pdfdoc, float red, float green, float blue) Sets filling color to RGB color value */ PHP_FUNCTION(pdf_setrgbcolor_fill) { zval **arg1, **arg2, **arg3, **arg4; PDF *pdf; if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &arg1, &arg2, &arg3, &arg4) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_double_ex(arg2); convert_to_double_ex(arg3); convert_to_double_ex(arg4); #if (PDFLIB_MAJORVERSION >= 4) PDF_setcolor(pdf, "fill", "rgb", (float) Z_DVAL_PP(arg2), (float) Z_DVAL_PP(arg3), (float) Z_DVAL_PP(arg4), 0); #else PDF_setrgbcolor_fill(pdf, (float) Z_DVAL_PP(arg2), (float) Z_DVAL_PP(arg3), (float) Z_DVAL_PP(arg4)); #endif RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_setrgbcolor_stroke(int pdfdoc, float red, float green, float blue) Sets drawing color to RGB color value */ PHP_FUNCTION(pdf_setrgbcolor_stroke) { zval **arg1, **arg2, **arg3, **arg4; PDF *pdf; if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &arg1, &arg2, &arg3, &arg4) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_double_ex(arg2); convert_to_double_ex(arg3); convert_to_double_ex(arg4); #if (PDFLIB_MAJORVERSION >= 4) PDF_setcolor(pdf, "stroke", "rgb", (float) Z_DVAL_PP(arg2), (float) Z_DVAL_PP(arg3), (float) Z_DVAL_PP(arg4), 0); #else PDF_setrgbcolor_stroke(pdf, (float) Z_DVAL_PP(arg2), (float) Z_DVAL_PP(arg3), (float) Z_DVAL_PP(arg4)); #endif RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_setrgbcolor(int pdfdoc, float red, float green, float blue) Sets drawing and filling color to RGB color value */ PHP_FUNCTION(pdf_setrgbcolor) { zval **arg1, **arg2, **arg3, **arg4; PDF *pdf; if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &arg1, &arg2, &arg3, &arg4) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_double_ex(arg2); convert_to_double_ex(arg3); convert_to_double_ex(arg4); #if (PDFLIB_MAJORVERSION >= 4) PDF_setcolor(pdf, "both", "rgb", (float) Z_DVAL_PP(arg2), (float) Z_DVAL_PP(arg3), (float) Z_DVAL_PP(arg4), 0); #else PDF_setrgbcolor(pdf, (float) Z_DVAL_PP(arg2), (float) Z_DVAL_PP(arg3), (float) Z_DVAL_PP(arg4)); #endif RETURN_TRUE; } /* }}} */ /* {{{ proto int pdf_add_bookmark(int pdfdoc, string text [, int parent, int open]) Adds bookmark for current page */ PHP_FUNCTION(pdf_add_bookmark) { zval **arg1, **arg2, **arg3, **arg4; int parentid, open, id; PDF *pdf; switch (ZEND_NUM_ARGS()) { case 2: if (zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) { WRONG_PARAM_COUNT; } break; case 3: if (zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == FAILURE) { WRONG_PARAM_COUNT; } break; case 4: if (zend_get_parameters_ex(4, &arg1, &arg2, &arg3, &arg4) == FAILURE) { WRONG_PARAM_COUNT; } break; default: WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_string_ex(arg2); if (ZEND_NUM_ARGS() > 2) { convert_to_long_ex(arg3); parentid = Z_LVAL_PP(arg3); if (ZEND_NUM_ARGS() > 3) { convert_to_long_ex(arg4); open = Z_LVAL_PP(arg4); } else { open = 0; } } else { parentid = 0; open = 0; } /* will never return 0 */ id = PDF_add_bookmark(pdf, Z_STRVAL_PP(arg2), parentid, open); RETURN_LONG(id); } /* }}} */ /* {{{ proto void pdf_set_transition(int pdfdoc, int transition) Sets transition between pages */ PHP_FUNCTION(pdf_set_transition) { zval **arg1, **arg2; PDF *pdf; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_long_ex(arg2); switch(Z_LVAL_PP(arg2)) { case 0: PDF_set_parameter(pdf, "transition", "none"); break; case 1: PDF_set_parameter(pdf, "transition", "split"); break; case 2: PDF_set_parameter(pdf, "transition", "blinds"); break; case 3: PDF_set_parameter(pdf, "transition", "box"); break; case 4: PDF_set_parameter(pdf, "transition", "wipe"); break; case 5: PDF_set_parameter(pdf, "transition", "dissolve"); break; case 6: PDF_set_parameter(pdf, "transition", "glitter"); break; case 7: PDF_set_parameter(pdf, "transition", "replace"); break; default: PDF_set_parameter(pdf, "transition", "none"); } RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_set_duration(int pdfdoc, float duration) Sets duration between pages */ PHP_FUNCTION(pdf_set_duration) { zval **arg1, **arg2; PDF *pdf; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_double_ex(arg2); PDF_set_value(pdf, "duration", (float) Z_DVAL_PP(arg2)); RETURN_TRUE; } /* }}} */ /* {{{ _php_pdf_open_image */ static void _php_pdf_open_image(INTERNAL_FUNCTION_PARAMETERS, char *type) { zval **arg1, **arg2; PDF *pdf; int pdf_image; char *image; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_string_ex(arg2); #ifdef VIRTUAL_DIR virtual_filepath(Z_STRVAL_PP(arg2), &image TSRMLS_CC); #else image = Z_STRVAL_PP(arg2); #endif if (php_check_open_basedir(image TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(image, "rb+", CHECKUID_CHECK_MODE_PARAM))) { RETURN_FALSE; } pdf_image = PDF_open_image_file(pdf, type, image, "", 0); RETURN_LONG(pdf_image+PDFLIB_IMAGE_OFFSET); } /* }}} */ /* {{{ proto int pdf_open_gif(int pdf, string giffile) Opens a GIF file and returns an image for placement in a pdf object */ PHP_FUNCTION(pdf_open_gif) { _php_pdf_open_image(INTERNAL_FUNCTION_PARAM_PASSTHRU,"gif"); } /* }}} */ /* {{{ proto int pdf_open_jpeg(int pdf, string jpegfile) Opens a JPEG file and returns an image for placement in a PDF document */ PHP_FUNCTION(pdf_open_jpeg) { _php_pdf_open_image(INTERNAL_FUNCTION_PARAM_PASSTHRU,"jpeg"); } /* }}} */ /* {{{ proto int pdf_open_png(int pdf, string pngfile) Opens a PNG file and returns an image for placement in a PDF document */ PHP_FUNCTION(pdf_open_png) { _php_pdf_open_image(INTERNAL_FUNCTION_PARAM_PASSTHRU,"png"); } /* }}} */ /* {{{ proto int pdf_open_tiff(int pdf, string tifffile) Opens a TIFF file and returns an image for placement in a PDF document */ PHP_FUNCTION(pdf_open_tiff) { _php_pdf_open_image(INTERNAL_FUNCTION_PARAM_PASSTHRU,"tiff"); } /* }}} */ /* {{{ proto int pdf_open_image_file(int pdf, string type, string file, string stringparam, int intparam) Opens an image file of the given type and returns an image for placement in a PDF document */ PHP_FUNCTION(pdf_open_image_file) { zval **arg1, **arg2, **arg3, **arg4, **arg5; PDF *pdf; int pdf_image, argc; char *image; char *stringparam; int intparam; switch ((argc = ZEND_NUM_ARGS())) { case 3: if (zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == FAILURE) WRONG_PARAM_COUNT; break; case 5: if (zend_get_parameters_ex(5, &arg1, &arg2, &arg3, &arg4, &arg5) == FAILURE) WRONG_PARAM_COUNT; break; default: WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_string_ex(arg2); convert_to_string_ex(arg3); #ifdef VIRTUAL_DIR virtual_filepath(Z_STRVAL_PP(arg3), &image TSRMLS_CC); #else image = Z_STRVAL_PP(arg3); #endif if (php_check_open_basedir(image TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(image, "rb+", CHECKUID_CHECK_MODE_PARAM))) { RETURN_FALSE; } if (argc == 3) { pdf_image = PDF_open_image_file(pdf, Z_STRVAL_PP(arg2), image, "", 0); } else { convert_to_string_ex(arg4); convert_to_long_ex(arg5); stringparam = Z_STRVAL_PP(arg4); intparam = Z_LVAL_PP(arg5); /* adjust the image handle */ if (!strcmp(stringparam, "masked")) intparam -= PDFLIB_IMAGE_OFFSET; pdf_image = PDF_open_image_file(pdf, Z_STRVAL_PP(arg2), image, stringparam, intparam); } if (pdf_image == -1) { /* pdflib will do this for you, will throw some exception php_error(E_WARNING, "Could not open image: %s", image); */ RETURN_FALSE; } RETURN_LONG(pdf_image+PDFLIB_IMAGE_OFFSET); } /* }}} */ #if HAVE_LIBGD13 /* {{{ proto int pdf_open_memory_image(int pdf, int image) Takes an GD image and returns an image for placement in a PDF document */ PHP_FUNCTION(pdf_open_memory_image) { zval **arg1, **arg2; int i, j, color; int pdf_image; gdImagePtr im; unsigned char *buffer, *ptr; PDF *pdf; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); ZEND_GET_RESOURCE_TYPE_ID(le_gd,"gd"); if(!le_gd) { php_error(E_ERROR, "Unable to find handle for GD image stream. Please check the GD extension is loaded."); } ZEND_FETCH_RESOURCE(im, gdImagePtr, arg2, -1, "Image", le_gd); buffer = (unsigned char *) safe_emalloc(3 * im->sx, im->sy, 0); ptr = buffer; for(i=0; isy; i++) { for(j=0; jsx; j++) { #if HAVE_LIBGD20 if(gdImageTrueColor(im)) { if (im->tpixels && gdImageBoundsSafe(im, j, i)) { color = gdImageTrueColorPixel(im, j, i); *ptr++ = (color >> 16) & 0xFF; *ptr++ = (color >> 8) & 0xFF; *ptr++ = color & 0xFF; } } else { #endif if (im->pixels && gdImageBoundsSafe(im, j, i)) { color = im->pixels[i][j]; *ptr++ = im->red[color]; *ptr++ = im->green[color]; *ptr++ = im->blue[color]; } #if HAVE_LIBGD20 } #endif } } pdf_image = PDF_open_image(pdf, "raw", "memory", buffer, im->sx*im->sy*3, im->sx, im->sy, 3, 8, NULL); efree(buffer); if(pdf_image == -1) { /* pdflib will do this for you, will throw some exception php_error(E_WARNING, "Could not open image"); */ efree(buffer); RETURN_FALSE; } RETURN_LONG(pdf_image+PDFLIB_IMAGE_OFFSET); } /* }}} */ #endif /* HAVE_LIBGD13 */ /* {{{ proto void pdf_close_image(int pdf, int pdfimage) Closes the PDF image */ PHP_FUNCTION(pdf_close_image) { zval **arg1, **arg2; PDF *pdf; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_long_ex(arg2); PDF_close_image(pdf, Z_LVAL_PP(arg2)-PDFLIB_IMAGE_OFFSET); } /* }}} */ /* {{{ proto void pdf_place_image(int pdf, int pdfimage, float x, float y, float scale) Places image in the PDF document */ PHP_FUNCTION(pdf_place_image) { zval **arg1, **arg2, **arg3, **arg4, **arg5; PDF *pdf; if (ZEND_NUM_ARGS() != 5 || zend_get_parameters_ex(5, &arg1, &arg2, &arg3, &arg4, &arg5) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_long_ex(arg2); convert_to_double_ex(arg3); convert_to_double_ex(arg4); convert_to_double_ex(arg5); PDF_place_image(pdf, Z_LVAL_PP(arg2)-PDFLIB_IMAGE_OFFSET, (float) Z_DVAL_PP(arg3), (float) Z_DVAL_PP(arg4), (float) Z_DVAL_PP(arg5)); RETURN_TRUE; } /* }}} */ /* {{{ proto int pdf_get_image_width(int pdf, int pdfimage) Returns the width of an image */ PHP_FUNCTION(pdf_get_image_width) { zval **arg1, **arg2; PDF *pdf; int width; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_long_ex(arg2); width = (int) PDF_get_value(pdf, "imagewidth", (float)Z_LVAL_PP(arg2)-PDFLIB_IMAGE_OFFSET); RETURN_LONG(width); } /* }}} */ /* {{{ proto int pdf_get_image_height(int pdf, int pdfimage) Returns the height of an image */ PHP_FUNCTION(pdf_get_image_height) { zval **arg1, **arg2; PDF *pdf; int height; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_long_ex(arg2); height = (int) PDF_get_value(pdf, "imageheight", (float)Z_LVAL_PP(arg2)-PDFLIB_IMAGE_OFFSET); RETURN_LONG(height); } /* }}} */ /* {{{ proto void pdf_add_weblink(int pdfdoc, float llx, float lly, float urx, float ury, string url) Adds link to web resource */ PHP_FUNCTION(pdf_add_weblink) { zval **arg1, **arg2, **arg3, **arg4, **arg5, **arg6; PDF *pdf; if (ZEND_NUM_ARGS() != 6 || zend_get_parameters_ex(6, &arg1, &arg2, &arg3, &arg4, &arg5, &arg6) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_double_ex(arg2); convert_to_double_ex(arg3); convert_to_double_ex(arg4); convert_to_double_ex(arg5); convert_to_string_ex(arg6); PDF_add_weblink(pdf, (float) Z_DVAL_PP(arg2), (float) Z_DVAL_PP(arg3), (float) Z_DVAL_PP(arg4), (float) Z_DVAL_PP(arg5), Z_STRVAL_PP(arg6)); RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_add_pdflink(int pdfdoc, float llx, float lly, float urx, float ury, string filename, int page, string dest) Adds link to PDF document */ PHP_FUNCTION(pdf_add_pdflink) { zval **arg1, **arg2, **arg3, **arg4, **arg5, **arg6, **arg7, **arg8; PDF *pdf; if (ZEND_NUM_ARGS() != 8 || zend_get_parameters_ex(8, &arg1, &arg2, &arg3, &arg4, &arg5, &arg6, &arg7, &arg8) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_double_ex(arg2); convert_to_double_ex(arg3); convert_to_double_ex(arg4); convert_to_double_ex(arg5); convert_to_string_ex(arg6); convert_to_long_ex(arg7); convert_to_string_ex(arg8); PDF_add_pdflink(pdf, (float) Z_DVAL_PP(arg2), (float) Z_DVAL_PP(arg3), (float) Z_DVAL_PP(arg4), (float) Z_DVAL_PP(arg5), Z_STRVAL_PP(arg6), Z_LVAL_PP(arg7), Z_STRVAL_PP(arg8)); RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_set_border_style(int pdfdoc, string style, float width) Sets style of box surounding all kinds of annotations and link */ PHP_FUNCTION(pdf_set_border_style) { zval **arg1, **arg2, **arg3; PDF *pdf; if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_string_ex(arg2); convert_to_double_ex(arg3); PDF_set_border_style(pdf, Z_STRVAL_PP(arg2), (float) Z_DVAL_PP(arg3)); RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_set_border_color(int pdfdoc, float red, float green, float blue) Sets color of box surounded all kinds of annotations and links */ PHP_FUNCTION(pdf_set_border_color) { zval **arg1, **arg2, **arg3, **arg4; PDF *pdf; if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &arg1, &arg2, &arg3, &arg4) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_double_ex(arg2); convert_to_double_ex(arg3); convert_to_double_ex(arg4); PDF_set_border_color(pdf, (float) Z_DVAL_PP(arg2), (float) Z_DVAL_PP(arg3), (float) Z_DVAL_PP(arg4)); RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_set_border_dash(int pdfdoc, float black, float white) Sets the border dash style of all kinds of annotations and links */ PHP_FUNCTION(pdf_set_border_dash) { zval **arg1, **arg2, **arg3; PDF *pdf; if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_double_ex(arg2); convert_to_double_ex(arg3); PDF_set_border_dash(pdf, (float) Z_DVAL_PP(arg2), (float) Z_DVAL_PP(arg3)); RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_add_annotation(int pdfdoc, float xll, float yll, float xur, float xur, string title, string text) Sets annotation (depreciated use pdf_add_note instead) */ PHP_FUNCTION(pdf_add_annotation) { zval **argv[7]; PDF *pdf; if(ZEND_NUM_ARGS() != 7 || zend_get_parameters_array_ex(7, argv) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, argv[0], -1, "pdf object", le_pdf); convert_to_double_ex(argv[1]); convert_to_double_ex(argv[2]); convert_to_double_ex(argv[3]); convert_to_double_ex(argv[4]); convert_to_string_ex(argv[5]); convert_to_string_ex(argv[6]); PDF_add_note(pdf, (float) Z_DVAL_PP(argv[1]), (float) Z_DVAL_PP(argv[2]), (float) Z_DVAL_PP(argv[3]), (float) Z_DVAL_PP(argv[4]), Z_STRVAL_PP(argv[6]), Z_STRVAL_PP(argv[5]), "note", 1); RETURN_TRUE; } /* }}} */ /* RJS: START OF NEW CODE */ /* {{{ proto int pdf_new() Creates a new PDF object */ PHP_FUNCTION(pdf_new) { PDF *pdf; pdf = PDF_new2(custom_errorhandler, pdf_emalloc, pdf_realloc, pdf_efree, NULL); #if (PDFLIB_MAJORVERSION >= 4) PDF_set_parameter(pdf, "imagewarning", "true"); #endif PDF_set_parameter(pdf, "binding", "PHP"); ZEND_REGISTER_RESOURCE(return_value, pdf, le_pdf); } /* }}} */ /* {{{ proto int pdf_get_majorversion() Returns the major version number of the PDFlib */ PHP_FUNCTION(pdf_get_majorversion) { if (ZEND_NUM_ARGS() != 0) { WRONG_PARAM_COUNT; } RETURN_LONG(PDF_get_majorversion()); } /* {{{ proto int pdf_get_minorversion() Returns the minor version number of the PDFlib */ PHP_FUNCTION(pdf_get_minorversion) { if (ZEND_NUM_ARGS() != 0) { WRONG_PARAM_COUNT; } RETURN_LONG(PDF_get_minorversion()); } /* }}} */ /* {{{ proto bool pdf_delete(int pdfdoc) Deletes the PDF object */ PHP_FUNCTION(pdf_delete) { zval **arg1; PDF *pdf; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); zend_list_delete(Z_RESVAL_PP(arg1)); RETURN_TRUE; } /* }}} */ /* {{{ proto int pdf_open_file(int pdfdoc [, char filename]) Opens a new PDF document. If filename is NULL, document is created in memory. This is not yet fully supported */ PHP_FUNCTION(pdf_open_file) { zval **arg1, **arg2; int pdf_file; char *filename; int argc; PDF *pdf; if((argc = ZEND_NUM_ARGS()) > 2) WRONG_PARAM_COUNT; if (argc == 1) { if (zend_get_parameters_ex(1, &arg1) == FAILURE) WRONG_PARAM_COUNT; } else { if (zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); if (argc == 2) { convert_to_string_ex(arg2); filename = Z_STRVAL_PP(arg2); if (php_check_open_basedir(filename TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(filename, "wb+", CHECKUID_CHECK_MODE_PARAM))) { RETURN_FALSE; } pdf_file = PDF_open_file(pdf, filename); } else { /* open in memory */ pdf_file = PDF_open_file(pdf, ""); } if (pdf_file == -1) RETURN_FALSE; RETURN_TRUE; } /* }}} */ /* {{{ proto int pdf_get_buffer(int pdfdoc) Fetches the full buffer containig the generated PDF data */ PHP_FUNCTION(pdf_get_buffer) { zval **arg1; long size; PDF *pdf; const char *buffer; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); buffer = PDF_get_buffer(pdf, &size); RETURN_STRINGL((char *)buffer, size, 1); } /* }}} */ /* {{{ proto int pdf_findfont(int pdfdoc, string fontname, string encoding [, int embed]) Prepares the font fontname for later use with pdf_setfont() */ PHP_FUNCTION(pdf_findfont) { zval **arg1, **arg2, **arg3, **arg4; int embed, font; const char *fontname, *encoding; PDF *pdf; switch (ZEND_NUM_ARGS()) { case 3: if (zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == FAILURE) { WRONG_PARAM_COUNT; } embed = 0; break; case 4: if (zend_get_parameters_ex(4, &arg1, &arg2, &arg3, &arg4) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_long_ex(arg4); embed = Z_LVAL_PP(arg4); break; default: WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_string_ex(arg2); fontname = Z_STRVAL_PP(arg2); convert_to_string_ex(arg3); encoding = Z_STRVAL_PP(arg3); font = PDF_findfont(pdf, fontname, encoding, embed); if (font == -1) { /* pdflib will do this for you, will throw some exception php_error(E_WARNING,"Font %s not found", fontname); */ RETURN_FALSE; } RETURN_LONG(font+PDFLIB_FONT_OFFSET); } /* }}} */ /* {{{ proto void pdf_setfont(int pdfdoc, int font, float fontsize) Sets the current font in the fiven fontsize */ PHP_FUNCTION(pdf_setfont) { zval **arg1, **arg2, **arg3; int font; float fontsize; PDF *pdf; if(ZEND_NUM_ARGS() != 3) WRONG_PARAM_COUNT; if (zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == FAILURE) WRONG_PARAM_COUNT; ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_long_ex(arg2); font = Z_LVAL_PP(arg2); convert_to_double_ex(arg3); fontsize = (float)Z_DVAL_PP(arg3); PDF_setfont(pdf, font-PDFLIB_FONT_OFFSET, fontsize); RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_setpolydash(int pdfdoc, float darray) Sets more complicated dash pattern */ PHP_FUNCTION(pdf_setpolydash) { zval **arg1, **arg2; HashTable *array; int len, i; float *darray; PDF *pdf; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_array_ex(arg2); array = Z_ARRVAL_PP(arg2); len = zend_hash_num_elements(array); if (NULL == (darray = safe_emalloc(len, sizeof(double), 0))) { RETURN_FALSE; } zend_hash_internal_pointer_reset(array); for (i=0; i= 4) /* {{{ proto int pdf_open_pdi(int pdf, string filename, string stringparam, int intparam); * Open an existing PDF document and prepare it for later use. */ PHP_FUNCTION(pdf_open_pdi) { zval **arg1, **arg2, **arg3, **arg4; PDF *pdf; int pdi_handle; char *file; if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &arg1, &arg2, &arg3, &arg4) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_string_ex(arg2); convert_to_string_ex(arg3); convert_to_long_ex(arg4); #ifdef VIRTUAL_DIR virtual_filepath(Z_STRVAL_PP(arg2), &file TSRMLS_CC); #else file = Z_STRVAL_PP(arg2); #endif if (php_check_open_basedir(file TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(file, "rb+", CHECKUID_CHECK_MODE_PARAM))) { RETURN_FALSE; } pdi_handle = PDF_open_pdi(pdf, file, Z_STRVAL_PP(arg3), Z_LVAL_PP(arg4)); RETURN_LONG(pdi_handle+PDFLIB_PDI_OFFSET); } /* }}} */ /* {{{ proto void pdf_close_pdi(int pdf, int doc); * Close all open page handles, and close the input PDF document. */ PHP_FUNCTION(pdf_close_pdi) { zval **arg1, **arg2; PDF *pdf; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_long_ex(arg2); PDF_close_pdi(pdf, Z_LVAL_PP(arg2)-PDFLIB_PDI_OFFSET); RETURN_TRUE; } /* }}} */ /* {{{ proto int pdf_open_pdi_page(int pdf, int doc, int page, string label); * Prepare a page for later use with PDF_place_image(). */ PHP_FUNCTION(pdf_open_pdi_page) { zval **arg1, **arg2, **arg3, **arg4; PDF *pdf; int pdi_image; if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &arg1, &arg2, &arg3, &arg4) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_long_ex(arg2); convert_to_long_ex(arg3); convert_to_string_ex(arg4); pdi_image = PDF_open_pdi_page(pdf, Z_LVAL_PP(arg2)-PDFLIB_PDI_OFFSET, Z_LVAL_PP(arg3), Z_STRVAL_PP(arg4)); RETURN_LONG(pdi_image+PDFLIB_IMAGE_OFFSET); } /* }}} */ /* {{{ proto void pdf_place_pdi_page(int pdf, int page, float x, float y, float sx, float sy) * Place a PDF page with the lower left corner at (x, y), and scale it. */ PHP_FUNCTION(pdf_place_pdi_page) { zval **arg1, **arg2, **arg3, **arg4, **arg5, **arg6; PDF *pdf; if (ZEND_NUM_ARGS() != 6 || zend_get_parameters_ex(6, &arg1, &arg2, &arg3, &arg4, &arg5, &arg6) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_long_ex(arg2); convert_to_double_ex(arg3); convert_to_double_ex(arg4); convert_to_double_ex(arg5); convert_to_double_ex(arg6); PDF_place_pdi_page(pdf, Z_LVAL_PP(arg2)-PDFLIB_IMAGE_OFFSET, (float) Z_DVAL_PP(arg3), (float) Z_DVAL_PP(arg4), (float) Z_DVAL_PP(arg5), (float) Z_DVAL_PP(arg6)); RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_close_pdi_page(int pdf, int page); * Close the page handle, and free all page-related resources. */ PHP_FUNCTION(pdf_close_pdi_page) { zval **arg1, **arg2; PDF *pdf; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_long_ex(arg2); PDF_close_pdi_page(pdf, Z_LVAL_PP(arg2)-PDFLIB_IMAGE_OFFSET); RETURN_TRUE; } /* }}} */ /* {{{ proto string pdf_get_pdi_parameter(int pdf, string key, int doc, int page, int index); * Get the contents of some PDI document parameter with string type. */ PHP_FUNCTION(pdf_get_pdi_parameter) { zval **arg1, **arg2, **arg3, **arg4, **arg5; PDF *pdf; const char *buffer; int size; if (ZEND_NUM_ARGS() != 5 || zend_get_parameters_ex(5, &arg1, &arg2, &arg3, &arg4, &arg5) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_string_ex(arg2); convert_to_long_ex(arg3); convert_to_long_ex(arg4); convert_to_long_ex(arg5); buffer = PDF_get_pdi_parameter(pdf, Z_STRVAL_PP(arg2), Z_LVAL_PP(arg3)-PDFLIB_PDI_OFFSET, Z_LVAL_PP(arg4)-PDFLIB_IMAGE_OFFSET, Z_LVAL_PP(arg5), &size); RETURN_STRINGL((char *)buffer, size, 1); } /* }}} */ /* {{{ proto float pdf_get_pdi_value(int pdf, string key, int doc, int page, int index); * Get the contents of some PDI document parameter with numerical type. */ PHP_FUNCTION(pdf_get_pdi_value) { zval **arg1, **arg2, **arg3, **arg4, **arg5; PDF *pdf; double value; if (ZEND_NUM_ARGS() != 5 || zend_get_parameters_ex(5, &arg1, &arg2, &arg3, &arg4, &arg5) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_string_ex(arg2); convert_to_long_ex(arg3); convert_to_long_ex(arg4); convert_to_long_ex(arg5); value = (double)PDF_get_pdi_value(pdf, Z_STRVAL_PP(arg2), Z_LVAL_PP(arg3)-PDFLIB_PDI_OFFSET, Z_LVAL_PP(arg4)-PDFLIB_IMAGE_OFFSET, Z_LVAL_PP(arg5)); RETURN_DOUBLE(value); } /* }}} */ /* {{{ proto int pdf_begin_pattern(int pdf, float width, float height, float xstep, float ystep, int painttype); * Start a new pattern definition. */ PHP_FUNCTION(pdf_begin_pattern) { zval **arg1, **arg2, **arg3, **arg4, **arg5, **arg6; PDF *pdf; int pattern_image; if (ZEND_NUM_ARGS() != 6 || zend_get_parameters_ex(6, &arg1, &arg2, &arg3, &arg4, &arg5, &arg6) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_double_ex(arg2); convert_to_double_ex(arg3); convert_to_double_ex(arg4); convert_to_double_ex(arg5); convert_to_long_ex(arg6); pattern_image = PDF_begin_pattern(pdf, (float) Z_DVAL_PP(arg2), (float) Z_DVAL_PP(arg3), (float) Z_DVAL_PP(arg4), (float) Z_DVAL_PP(arg5), Z_LVAL_PP(arg6)); RETURN_LONG(pattern_image+PDFLIB_PATTERN_OFFSET); } /* }}} */ /* {{{ proto void pdf_end_pattern(int pdf); * Finish the pattern definition. */ PHP_FUNCTION(pdf_end_pattern) { zval **arg1; PDF *pdf; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); PDF_end_pattern(pdf); RETURN_TRUE; } /* }}} */ /* {{{ proto int pdf_begin_template(int pdf, float width, float height); * Start a new template definition. */ PHP_FUNCTION(pdf_begin_template) { zval **arg1, **arg2, **arg3; PDF *pdf; int tmpl_image; if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &arg1, &arg2, &arg3) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_double_ex(arg2); convert_to_double_ex(arg3); tmpl_image = PDF_begin_template(pdf, (float) Z_DVAL_PP(arg2), (float) Z_DVAL_PP(arg3)); RETURN_LONG(tmpl_image+PDFLIB_IMAGE_OFFSET); } /* }}} */ /* {{{ proto void pdf_end_template(int pdf); * Finish the template definition. */ PHP_FUNCTION(pdf_end_template) { zval **arg1; PDF *pdf; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); PDF_end_template(pdf); RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_setcolor(int pdf, string type, string colorspace, float c1 [, float c2 [, float c3 [, float c4]]]); * Set the current color space and color. */ PHP_FUNCTION(pdf_setcolor) { zval **arg1, **arg2, **arg3, **arg4, **arg5, **arg6, **arg7; PDF *pdf; double c1; int argc = ZEND_NUM_ARGS(); if(argc < 4 || argc > 7) { WRONG_PARAM_COUNT; } switch(argc) { case 4: if(zend_get_parameters_ex(4, &arg1, &arg2, &arg3, &arg4) == FAILURE) { WRONG_PARAM_COUNT; } break; case 5: if(zend_get_parameters_ex(5, &arg1, &arg2, &arg3, &arg4, &arg5) == FAILURE) { WRONG_PARAM_COUNT; } break; case 6: if(zend_get_parameters_ex(6, &arg1, &arg2, &arg3, &arg4, &arg5, &arg6) == FAILURE) { WRONG_PARAM_COUNT; } break; case 7: if(zend_get_parameters_ex(7, &arg1, &arg2, &arg3, &arg4, &arg5, &arg6, &arg7) == FAILURE) { WRONG_PARAM_COUNT; } break; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_string_ex(arg2); convert_to_string_ex(arg3); convert_to_double_ex(arg4); if(argc > 4) convert_to_double_ex(arg5); if(argc > 5) convert_to_double_ex(arg6); if(argc > 6) convert_to_double_ex(arg7); if (0 == (strcmp(Z_STRVAL_PP(arg3), "spot"))) { c1 = Z_DVAL_PP(arg4)-PDFLIB_SPOT_OFFSET; } else if(0 == (strcmp(Z_STRVAL_PP(arg3), "pattern"))) { c1 = Z_DVAL_PP(arg4)-PDFLIB_PATTERN_OFFSET; } else { c1 = Z_DVAL_PP(arg4); } PDF_setcolor(pdf, Z_STRVAL_PP(arg2), Z_STRVAL_PP(arg3), (float) c1, (float) ((argc>4) ? Z_DVAL_PP(arg5):0), (float) ((argc>5) ? Z_DVAL_PP(arg6):0), (float) ((argc>6) ? Z_DVAL_PP(arg7):0)); RETURN_TRUE; } /* }}} */ /* {{{ proto int pdf_makespotcolor(int pdf, string spotname); * Make a named spot color from the current color. */ PHP_FUNCTION(pdf_makespotcolor) { zval **arg1, **arg2; PDF *pdf; int spotcolor; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_string_ex(arg2); spotcolor = PDF_makespotcolor(pdf, Z_STRVAL_PP(arg2), Z_STRLEN_PP(arg2)); RETURN_LONG(spotcolor+PDFLIB_SPOT_OFFSET); } /* }}} */ /* {{{ proto void pdf_arcn(int pdf, float x, float y, float r, float alpha, float beta); * Draw a clockwise circular arc from alpha to beta degrees. */ PHP_FUNCTION(pdf_arcn) { zval **arg1, **arg2, **arg3, **arg4, **arg5, **arg6; PDF *pdf; if (ZEND_NUM_ARGS() != 6 || zend_get_parameters_ex(6, &arg1, &arg2, &arg3, &arg4, &arg5, &arg6) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_double_ex(arg2); convert_to_double_ex(arg3); convert_to_double_ex(arg4); convert_to_double_ex(arg5); convert_to_double_ex(arg6); PDF_arcn(pdf, (float) Z_DVAL_PP(arg2), (float) Z_DVAL_PP(arg3), (float) Z_DVAL_PP(arg4), (float) Z_DVAL_PP(arg5), (float) Z_DVAL_PP(arg6)); RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_initgraphics(int pdf); * Reset all implicit color and graphics state parameters to their defaults. */ PHP_FUNCTION(pdf_initgraphics) { zval **arg1; PDF *pdf; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg1) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); PDF_initgraphics(pdf); RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_add_thumbnail(int pdf, int image); * Add an existing image as thumbnail for the current page. */ PHP_FUNCTION(pdf_add_thumbnail) { zval **arg1, **arg2; PDF *pdf; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_long_ex(arg2); PDF_add_thumbnail(pdf, Z_LVAL_PP(arg2)-PDFLIB_IMAGE_OFFSET); RETURN_TRUE; } /* }}} */ /* {{{ proto void pdf_setmatrix(int pdf, float a, float b, float c, float d, float e, float f) Explicitly set the current transformation matrix. */ PHP_FUNCTION(pdf_setmatrix) { zval **arg1, **arg2, **arg3, **arg4, **arg5, **arg6, **arg7; PDF *pdf; if (ZEND_NUM_ARGS() != 7 || zend_get_parameters_ex(7, &arg1, &arg2, &arg3, &arg4, &arg5, &arg6, &arg7) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(pdf, PDF *, arg1, -1, "pdf object", le_pdf); convert_to_double_ex(arg2); convert_to_double_ex(arg3); convert_to_double_ex(arg4); convert_to_double_ex(arg5); convert_to_double_ex(arg6); convert_to_double_ex(arg7); PDF_setmatrix(pdf, (float) Z_DVAL_PP(arg2), (float) Z_DVAL_PP(arg3), (float) Z_DVAL_PP(arg4), (float) Z_DVAL_PP(arg5), (float) Z_DVAL_PP(arg6), (float) Z_DVAL_PP(arg7)); RETURN_TRUE; } /* }}} */ #endif /* PDFlib >= V4 */ #endif /* * Local variables: * tab-width: 4 * c-basic-offset: 4 * End: * vim600: sw=4 ts=4 fdm=marker * vim<600: sw=4 ts=4 */ php-4.4.8/ext/pdf/config.m40000644000175000017500000000774110152564103014670 0ustar derickderickdnl dnl $Id: config.m4,v 1.35.2.6 2004/11/29 09:13:39 derick Exp $ dnl PHP_ARG_WITH(pdflib,for PDFlib support, [ --with-pdflib[=DIR] Include PDFlib support.]) if test -z "$PHP_JPEG_DIR"; then PHP_ARG_WITH(jpeg-dir, for the location of libjpeg, [ --with-jpeg-dir[=DIR] PDFLIB: define libjpeg install directory. (OPTIONAL for PDFlib v4)], no, no) fi if test -z "$PHP_PNG_DIR"; then PHP_ARG_WITH(png-dir, for the location of libpng, [ --with-png-dir[=DIR] PDFLIB: define libpng install directory. (OPTIONAL for PDFlib v4)], no, no) fi if test -z "$PHP_ZLIB_DIR"; then PHP_ARG_WITH(zlib-dir, for the location of libz, [ --with-zlib-dir[=DIR] PDFLIB: define libz install directory. (OPTIONAL for PDFlib v4)], no, no) fi PHP_ARG_WITH(tiff-dir, for the location of libtiff, [ --with-tiff-dir[=DIR] PDFLIB: define libtiff install directory. (OPTIONAL for PDFlib v4)], no, no) if test "$PHP_PDFLIB" != "no"; then PHP_NEW_EXTENSION(pdf, pdf.c, $ext_shared) PHP_SUBST(PDF_SHARED_LIBADD) dnl # dnl # Optional libraries for PDFlib dnl # dnl # libjpeg if test "$PHP_JPEG_DIR" != "no"; then PHP_CHECK_LIBRARY(jpeg,jpeg_read_header, [ PHP_ADD_LIBRARY_WITH_PATH(jpeg, $PHP_JPEG_DIR/lib, PDF_SHARED_LIBADD) ],[ AC_MSG_ERROR([libjpeg not found!]) ],[ -L$PHP_JPEG_DIR/lib ]) else AC_MSG_WARN([If configure fails, try --with-jpeg-dir=]) fi dnl # libpng if test "$PHP_PNG_DIR" != "no"; then PHP_CHECK_LIBRARY(png,png_create_info_struct, [ PHP_ADD_LIBRARY_WITH_PATH(png, $PHP_PNG_DIR/lib, PDF_SHARED_LIBADD) ],[ AC_MSG_ERROR([libpng not found!]) ],[ -L$PHP_PNG_DIR/lib ]) else AC_MSG_WARN([If configure fails, try --with-png-dir=]) fi dnl # libtiff if test "$PHP_TIFF_DIR" != "no"; then PHP_CHECK_LIBRARY(tiff,TIFFOpen, [ PHP_ADD_LIBRARY_WITH_PATH(tiff, $PHP_TIFF_DIR/lib, PDF_SHARED_LIBADD) ],[ AC_MSG_ERROR([libtiff not found!]) ],[ -L$PHP_TIFF_DIR/lib ]) else AC_MSG_WARN([If configure fails, try --with-tiff-dir=]) fi dnl # zlib AC_MSG_CHECKING([for the location of zlib]) if test "$PHP_ZLIB_DIR" = "no"; then AC_MSG_RESULT([no. If configure fails, try --with-zlib-dir=]) else AC_MSG_RESULT([$PHP_ZLIB_DIR]) PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR/lib, PDF_SHARED_LIBADD) fi dnl # dnl # The main PDFlib configure dnl # dnl # MacOSX requires this case $host_alias in *darwin*) PHP_ADD_FRAMEWORK(CoreServices) PHP_ADD_FRAMEWORK(ApplicationServices) ;; esac case $PHP_PDFLIB in yes) AC_CHECK_LIB(pdf, PDF_show_boxed, [ AC_DEFINE(HAVE_PDFLIB,1,[ ]) PHP_ADD_LIBRARY(pdf,, PDF_SHARED_LIBADD) ],[ AC_MSG_ERROR([ PDFlib extension requires at least pdflib 3.x. You may also need libtiff, libjpeg, libpng and libz. Use the options --with-tiff-dir=, --with-jpeg-dir=, --with-png-dir= and --with-zlib-dir= See config.log for more information. ]) ]) ;; *) if test -f "$PHP_PDFLIB/include/pdflib.h" ; then PHP_CHECK_LIBRARY(pdf, PDF_show_boxed, [ AC_DEFINE(HAVE_PDFLIB,1,[ ]) PHP_ADD_LIBRARY_WITH_PATH(pdf, $PHP_PDFLIB/lib, PDF_SHARED_LIBADD) PHP_ADD_INCLUDE($PHP_PDFLIB/include) ],[ AC_MSG_ERROR([ PDFlib extension requires at least pdflib 3.x. You may also need libtiff, libjpeg, libpng and libz. Use the options --with-tiff-dir=, --with-jpeg-dir=, --with-png-dir= and --with-zlib-dir= See config.log for more information. ]) ],[ -L$PHP_PDFLIB/lib $PDF_SHARED_LIBADD ]) else AC_MSG_ERROR([pdflib.h not found! Check the path passed to --with-pdflib=. PATH should be the install prefix directory.]) fi ;; esac fi php-4.4.8/ext/pdf/php_pdf.h0000644000175000017500000001433410736114312014747 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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: Uwe Steinmann | +----------------------------------------------------------------------+ */ /* $Id: php_pdf.h,v 1.24.8.3.2.3 2007/12/31 07:22:50 sebastian Exp $ */ #ifndef PHP_PDF_H #define PHP_PDF_H #if HAVE_PDFLIB #include extern zend_module_entry pdf_module_entry; #define pdf_module_ptr &pdf_module_entry PHP_MINFO_FUNCTION(pdf); PHP_MINIT_FUNCTION(pdf); PHP_MSHUTDOWN_FUNCTION(pdf); PHP_FUNCTION(pdf_new); /* new function */ PHP_FUNCTION(pdf_delete); /* new function */ PHP_FUNCTION(pdf_open_file); PHP_FUNCTION(pdf_get_buffer); /* new function */ PHP_FUNCTION(pdf_close); PHP_FUNCTION(pdf_begin_page); PHP_FUNCTION(pdf_end_page); PHP_FUNCTION(pdf_get_majorversion); PHP_FUNCTION(pdf_get_minorversion); PHP_FUNCTION(pdf_get_value); PHP_FUNCTION(pdf_set_value); PHP_FUNCTION(pdf_get_parameter); PHP_FUNCTION(pdf_set_parameter); PHP_FUNCTION(pdf_findfont); /* new function */ PHP_FUNCTION(pdf_setfont); /* new function */ PHP_FUNCTION(pdf_show); PHP_FUNCTION(pdf_show_xy); PHP_FUNCTION(pdf_continue_text); PHP_FUNCTION(pdf_show_boxed); PHP_FUNCTION(pdf_stringwidth); /* new parameters: [int font, float size] */ PHP_FUNCTION(pdf_set_text_pos); PHP_FUNCTION(pdf_setdash); PHP_FUNCTION(pdf_setpolydash); /* new function: not yet finished */ PHP_FUNCTION(pdf_setflat); PHP_FUNCTION(pdf_setlinejoin); PHP_FUNCTION(pdf_setlinecap); PHP_FUNCTION(pdf_setmiterlimit); PHP_FUNCTION(pdf_setlinewidth); PHP_FUNCTION(pdf_save); PHP_FUNCTION(pdf_restore); PHP_FUNCTION(pdf_translate); PHP_FUNCTION(pdf_scale); PHP_FUNCTION(pdf_rotate); PHP_FUNCTION(pdf_skew); PHP_FUNCTION(pdf_concat); /* new function */ PHP_FUNCTION(pdf_moveto); PHP_FUNCTION(pdf_lineto); PHP_FUNCTION(pdf_curveto); PHP_FUNCTION(pdf_circle); PHP_FUNCTION(pdf_arc); PHP_FUNCTION(pdf_rect); PHP_FUNCTION(pdf_closepath); PHP_FUNCTION(pdf_stroke); PHP_FUNCTION(pdf_closepath_stroke); PHP_FUNCTION(pdf_fill); PHP_FUNCTION(pdf_fill_stroke); PHP_FUNCTION(pdf_closepath_fill_stroke); PHP_FUNCTION(pdf_clip); PHP_FUNCTION(pdf_endpath); PHP_FUNCTION(pdf_setgray_fill); PHP_FUNCTION(pdf_setgray_stroke); PHP_FUNCTION(pdf_setgray); PHP_FUNCTION(pdf_setrgbcolor_fill); PHP_FUNCTION(pdf_setrgbcolor_stroke); PHP_FUNCTION(pdf_setrgbcolor); PHP_FUNCTION(pdf_open_image_file); /* new parameters: [char *stringpram, int intparam] */ PHP_FUNCTION(pdf_open_ccitt); /* new function */ PHP_FUNCTION(pdf_open_image); /* new function: checkit not yet completeted :( */ PHP_FUNCTION(pdf_close_image); PHP_FUNCTION(pdf_place_image); PHP_FUNCTION(pdf_add_bookmark); PHP_FUNCTION(pdf_set_info); PHP_FUNCTION(pdf_attach_file); /* new function */ PHP_FUNCTION(pdf_add_note); /* new function */ PHP_FUNCTION(pdf_add_pdflink); PHP_FUNCTION(pdf_add_locallink); /* new function */ PHP_FUNCTION(pdf_add_launchlink); /* new function */ PHP_FUNCTION(pdf_add_weblink); PHP_FUNCTION(pdf_set_border_style); PHP_FUNCTION(pdf_set_border_color); PHP_FUNCTION(pdf_set_border_dash); /* RJS: End of the official PDFLIB V3.x API */ /* old font handling */ PHP_FUNCTION(pdf_set_font); /* deprecated */ PHP_FUNCTION(pdf_get_font); /* deprecated */ PHP_FUNCTION(pdf_get_fontname); /* deprecated */ PHP_FUNCTION(pdf_get_fontsize); /* deprecated */ /* old way of starting a PDF document */ PHP_FUNCTION(pdf_open); /* deprecated */ /* old stuff for setting infos */ PHP_FUNCTION(pdf_set_info_creator); /* deprecated */ PHP_FUNCTION(pdf_set_info_title); /* deprecated */ PHP_FUNCTION(pdf_set_info_subject); /* deprecated */ PHP_FUNCTION(pdf_set_info_author); /* deprecated */ PHP_FUNCTION(pdf_set_info_keywords); /* deprecated */ PHP_FUNCTION(pdf_set_leading); /* deprecated */ PHP_FUNCTION(pdf_set_text_rendering); /* deprecated */ PHP_FUNCTION(pdf_set_horiz_scaling); /* deprecated */ PHP_FUNCTION(pdf_set_text_rise); /* deprecated */ PHP_FUNCTION(pdf_set_char_spacing); /* deprecated */ PHP_FUNCTION(pdf_set_word_spacing); /* deprecated */ PHP_FUNCTION(pdf_set_transition); /* deprecated */ PHP_FUNCTION(pdf_set_duration); /* deprecated */ PHP_FUNCTION(pdf_get_image_height); /* deprecated */ PHP_FUNCTION(pdf_get_image_width); /* deprecated */ /* old stuff for opening images */ PHP_FUNCTION(pdf_open_jpeg); /* deprecated */ PHP_FUNCTION(pdf_open_tiff); /* deprecated */ PHP_FUNCTION(pdf_open_png); /* deprecated */ PHP_FUNCTION(pdf_open_gif); /* deprecated */ /* some more stuff for compatibility */ PHP_FUNCTION(pdf_add_annotation); #if HAVE_LIBGD13 PHP_FUNCTION(pdf_open_memory_image); #endif #if (PDFLIB_MAJORVERSION >= 4) /* support for new functions in PDFlib V4.0 */ PHP_FUNCTION(pdf_open_pdi); PHP_FUNCTION(pdf_close_pdi); PHP_FUNCTION(pdf_open_pdi_page); PHP_FUNCTION(pdf_place_pdi_page); PHP_FUNCTION(pdf_close_pdi_page); PHP_FUNCTION(pdf_get_pdi_parameter); PHP_FUNCTION(pdf_get_pdi_value); PHP_FUNCTION(pdf_begin_pattern); PHP_FUNCTION(pdf_end_pattern); PHP_FUNCTION(pdf_setcolor); PHP_FUNCTION(pdf_makespotcolor); PHP_FUNCTION(pdf_begin_template); PHP_FUNCTION(pdf_end_template); PHP_FUNCTION(pdf_arcn); PHP_FUNCTION(pdf_add_thumbnail); PHP_FUNCTION(pdf_initgraphics); PHP_FUNCTION(pdf_setmatrix); #endif /* PDFlib >= V4 */ #ifdef ZTS #define PDFG(v) TSRMG(pdf_globals_id, php_pdf_globals *, v) #else #define PDFG(v) (pdf_globals.v) #endif #else #define pdf_module_ptr NULL #endif #define phpext_pdf_ptr pdf_module_ptr #endif /* PHP_PDF_H */ php-4.4.8/ext/pdf/pdf.dsp0000644000175000017500000001147310121352355014437 0ustar derickderick# Microsoft Developer Studio Project File - Name="pdf" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 CFG=pdf - 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 "pdf.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 "pdf.mak" CFG="pdf - Win32 Release_TS" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "pdf - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "pdf - 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)" == "pdf - 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_PDF" /D ZTS=1 /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 "_MBCS" /D "_USRDLL" /D "PDF_EXPORTS" /D "COMPILE_DL_PDF" /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_PDFLIB=1 /D ZTS=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 php4ts.lib /nologo /dll /machine:I386 # ADD LINK32 php4ts.lib pdflib.lib zlib.lib libpng.lib libtiff.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_pdf.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline" # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "pdf - 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 1 # 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 "COMPILE_DL_PDF" /D ZTS=1 /YX /FD /c # ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "PDF_EXPORTS" /D "COMPILE_DL_PDF" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_PDFLIB=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 php4ts_debug.lib /nologo /dll /machine:I386 # ADD LINK32 php4ts_debug.lib pdflib.lib zlib.lib libpng.lib libtiff.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_pdf.dll" /libpath:"..\..\Debug_TS" !ENDIF # Begin Target # Name "pdf - Win32 Release_TS" # Name "pdf - Win32 Debug_TS" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=.\pdf.c # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=.\php_pdf.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 php-4.4.8/ext/pdf/CREDITS0000644000175000017500000000004110121352355014163 0ustar derickderickPDF Uwe Steinmann, Rainer Schaaf php-4.4.8/ext/swf/0000755000175000017500000000000010737115146013206 5ustar derickderickphp-4.4.8/ext/swf/swf.c0000644000175000017500000010550010736114315014146 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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: swf.c,v 1.46.2.5.2.3 2007/12/31 07:22:53 sebastian Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "php.h" #if HAVE_SWF #include #include #include "ext/standard/info.h" #include "php_open_temporary_file.h" #include "php_swf.h" ZEND_DECLARE_MODULE_GLOBALS(swf) /* {{{ swf_functions[] */ function_entry swf_functions[] = { PHP_FE(swf_openfile, NULL) PHP_FE(swf_closefile, NULL) PHP_FE(swf_labelframe, NULL) PHP_FE(swf_showframe, NULL) PHP_FE(swf_setframe, NULL) PHP_FE(swf_getframe, NULL) PHP_FE(swf_mulcolor, NULL) PHP_FE(swf_addcolor, NULL) PHP_FE(swf_placeobject, NULL) PHP_FE(swf_modifyobject, NULL) PHP_FE(swf_removeobject, NULL) PHP_FE(swf_nextid, NULL) PHP_FE(swf_startdoaction, NULL) PHP_FE(swf_enddoaction, NULL) PHP_FE(swf_actiongotoframe, NULL) PHP_FE(swf_actiongeturl, NULL) PHP_FE(swf_actionnextframe, NULL) PHP_FE(swf_actionprevframe, NULL) PHP_FE(swf_actionplay, NULL) PHP_FE(swf_actionstop, NULL) PHP_FE(swf_actiontogglequality, NULL) PHP_FE(swf_actionwaitforframe, NULL) PHP_FE(swf_actionsettarget, NULL) PHP_FE(swf_actiongotolabel, NULL) PHP_FE(swf_defineline, NULL) PHP_FE(swf_definerect, NULL) PHP_FE(swf_definepoly, NULL) PHP_FE(swf_startshape, NULL) PHP_FE(swf_shapelinesolid, NULL) PHP_FE(swf_shapefilloff, NULL) PHP_FE(swf_shapefillsolid, NULL) PHP_FE(swf_shapefillbitmapclip, NULL) PHP_FE(swf_shapefillbitmaptile, NULL) PHP_FE(swf_shapemoveto, NULL) PHP_FE(swf_shapelineto, NULL) PHP_FE(swf_shapecurveto, NULL) PHP_FE(swf_shapecurveto3, NULL) PHP_FE(swf_shapearc, NULL) PHP_FE(swf_endshape, NULL) PHP_FE(swf_definefont, NULL) PHP_FE(swf_setfont, NULL) PHP_FE(swf_fontsize, NULL) PHP_FE(swf_fontslant, NULL) PHP_FE(swf_fonttracking, NULL) PHP_FE(swf_getfontinfo, NULL) PHP_FE(swf_definetext, NULL) PHP_FE(swf_textwidth, NULL) PHP_FE(swf_definebitmap, NULL) PHP_FE(swf_getbitmapinfo, NULL) PHP_FE(swf_startsymbol, NULL) PHP_FE(swf_endsymbol, NULL) PHP_FE(swf_startbutton, NULL) PHP_FE(swf_addbuttonrecord, NULL) PHP_FE(swf_oncondition, NULL) PHP_FE(swf_endbutton, NULL) PHP_FE(swf_viewport, NULL) PHP_FE(swf_ortho, NULL) PHP_FE(swf_ortho2, NULL) PHP_FE(swf_perspective, NULL) PHP_FE(swf_polarview, NULL) PHP_FE(swf_lookat, NULL) PHP_FE(swf_pushmatrix, NULL) PHP_FE(swf_popmatrix, NULL) PHP_FE(swf_scale, NULL) PHP_FE(swf_translate, NULL) PHP_FE(swf_rotate, NULL) PHP_FE(swf_posround, NULL) {NULL,NULL,NULL} }; /* }}} */ /* {{{ swf_module_entry */ zend_module_entry swf_module_entry = { STANDARD_MODULE_HEADER, "swf", swf_functions, PHP_MINIT(swf), NULL, PHP_RINIT(swf), NULL, PHP_MINFO(swf), NO_VERSION_YET, STANDARD_MODULE_PROPERTIES }; /* }}} */ #ifdef COMPILE_DL_SWF ZEND_GET_MODULE(swf) #endif /* {{{ PHP_MINFO_FUNCTION */ PHP_MINFO_FUNCTION(swf) { php_info_print_table_start(); php_info_print_table_row(2, "swf support", "enabled"); php_info_print_table_end(); } /* }}} */ /* {{{ _swf_init_globals */ static void _swf_init_globals(zend_swf_globals *sg) { memset(sg, 0, sizeof(zend_swf_globals)); } /* }}} */ /* {{{ PHP_MINIT_FUNCTION */ PHP_MINIT_FUNCTION(swf) { ZEND_INIT_MODULE_GLOBALS(swf, _swf_init_globals, NULL); REGISTER_LONG_CONSTANT("MOD_COLOR", MOD_COLOR, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("MOD_MATRIX", MOD_MATRIX, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("TYPE_PUSHBUTTON", TYPE_PUSHBUTTON, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("TYPE_MENUBUTTON", TYPE_MENUBUTTON, CONST_CS | CONST_PERSISTENT); REGISTER_DOUBLE_CONSTANT("BSHitTest", BSHitTest, CONST_CS | CONST_PERSISTENT); REGISTER_DOUBLE_CONSTANT("BSDown", BSDown, CONST_CS | CONST_PERSISTENT); REGISTER_DOUBLE_CONSTANT("BSOver", BSOver, CONST_CS | CONST_PERSISTENT); REGISTER_DOUBLE_CONSTANT("BSUp", BSUp, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("OverDowntoIdle", OverDowntoIdle, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("IdletoOverDown", IdletoOverDown, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("OutDowntoIdle", OutDowntoIdle, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("OutDowntoOverDown", OutDowntoOverDown, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("OverDowntoOutDown", OverDowntoOutDown, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("OverUptoOverDown", OverUptoOverDown, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("OverUptoIdle", OverUptoIdle, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("IdletoOverUp", IdletoOverUp, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("ButtonEnter", ButtonEnter, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("ButtonExit", ButtonExit, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("MenuEnter", MenuEnter, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("MenuExit", MenuExit, CONST_CS | CONST_PERSISTENT); return SUCCESS; } /* }}} */ /* {{{ PHP_RINIT_FUNCTION */ PHP_RINIT_FUNCTION(swf) { SWFG(use_file) = 0; return SUCCESS; } /* }}} */ /* {{{ proto void swf_openfile(string name, float xsize, float ysize, float framerate, float r, float g, float b) Create a Shockwave Flash file given by name, with width xsize and height ysize at a frame rate of framerate and a background color specified by a red value of r, green value of g and a blue value of b */ PHP_FUNCTION(swf_openfile) { zval **name, **sizeX, **sizeY, **frameRate, **r, **g, **b; char *na, *tmpna; zend_bool free_na = 0; if (ZEND_NUM_ARGS() != 7 || zend_get_parameters_ex(7, &name, &sizeX, &sizeY, &frameRate, &r, &g, &b) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_string_ex(name); convert_to_double_ex(sizeX); convert_to_double_ex(sizeY); convert_to_double_ex(frameRate); convert_to_double_ex(r); convert_to_double_ex(g); convert_to_double_ex(b); tmpna = Z_STRVAL_PP(name); if (strcasecmp("php://stdout", tmpna) == 0) { FILE *fp; fp = php_open_temporary_file(NULL, "php_swf_stdout", &na TSRMLS_CC); if (!fp) { free_na = 0; RETURN_FALSE; } VCWD_UNLINK((const char *)na); fclose(fp); free_na = 1; SWFG(use_file) = 0; } else { na = tmpna; SWFG(use_file) = 1; } #ifdef VIRTUAL_DIR if (virtual_filepath_ex(na, &tmpna, NULL TSRMLS_CC)) { if (free_na) { efree(na); } return; } if (free_na) { efree(na); } na = tmpna; #endif if (php_check_open_basedir(na TSRMLS_CC) || (PG(safe_mode) && !php_checkuid(na, "wb+", CHECKUID_CHECK_MODE_PARAM))) { #ifdef VIRTUAL_DIR free(na); #endif return; } if (!SWFG(use_file)) SWFG(tmpfile_name) = na; swf_openfile(na,(float)Z_DVAL_PP(sizeX), (float)Z_DVAL_PP(sizeY), (float)Z_DVAL_PP(frameRate), (float)Z_DVAL_PP(r), (float)Z_DVAL_PP(g), (float)Z_DVAL_PP(b)); } /* }}} */ /* {{{ proto void swf_closefile(void) Close a Shockwave flash file that was opened with swf_openfile */ PHP_FUNCTION(swf_closefile) { swf_closefile(); if (!SWFG(use_file)) { FILE *f; char buf[4096]; int b; if ((f = VCWD_FOPEN(SWFG(tmpfile_name), "r")) == NULL) { php_error(E_WARNING, "Cannot create temporary file for stdout support with SWF"); RETURN_NULL(); } while ((b = fread(buf, 1, sizeof(buf), f)) > 0) php_write(buf, b TSRMLS_CC); fclose(f); VCWD_UNLINK((const char *)SWFG(tmpfile_name)); efree(SWFG(tmpfile_name)); } } /* }}} */ /* {{{ proto void swf_labelframe(string name) Adds string name to the current frame */ PHP_FUNCTION(swf_labelframe) { zval **name; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &name) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_string_ex(name); swf_labelframe(Z_STRVAL_PP(name)); } /* }}} */ /* {{{ proto void swf_showframe(void) Finish the current frame */ PHP_FUNCTION(swf_showframe) { swf_showframe(); } /* }}} */ /* {{{ proto void swf_setframe(int frame_number) Set the current frame number to the number given by frame_number */ PHP_FUNCTION(swf_setframe) { zval **frameno; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &frameno) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_long_ex(frameno); swf_setframe(Z_LVAL_PP(frameno)); } /* }}} */ /* {{{ proto int swf_getframe(void) Returns the current frame */ PHP_FUNCTION(swf_getframe) { RETURN_LONG(swf_getframe()); } /* }}} */ /* {{{ col_swf */ void col_swf(INTERNAL_FUNCTION_PARAMETERS, int opt) { zval **r, **g, **b, **a; if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &r, &g, &b, &a) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_double_ex(r); convert_to_double_ex(g); convert_to_double_ex(b); convert_to_double_ex(a); if (opt) { swf_addcolor((float)Z_DVAL_PP(r), (float)Z_DVAL_PP(g), (float)Z_DVAL_PP(b), (float)Z_DVAL_PP(a)); } else { swf_mulcolor((float)Z_DVAL_PP(r), (float)Z_DVAL_PP(g), (float)Z_DVAL_PP(b), (float)Z_DVAL_PP(a)); } } /* }}} */ /* {{{ proto void swf_mulcolor(float r, float g, float b, float a) Sets the global multiply color to the rgba value specified */ PHP_FUNCTION(swf_mulcolor) { col_swf(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); } /* }}} */ /* {{{ proto void swf_addcolor(float r, float g, float b, float a) Set the global add color to the rgba value specified */ PHP_FUNCTION(swf_addcolor) { col_swf(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); } /* }}} */ /* {{{ proto void swf_placeobject(int objid, int depth) Places the object, objid, in the current frame at depth, depth */ PHP_FUNCTION(swf_placeobject) { zval **objid, **depth; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &objid, &depth) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_long_ex(objid); convert_to_long_ex(depth); swf_placeobject(Z_LVAL_PP(objid), Z_LVAL_PP(depth)); } /* }}} */ /* {{{ proto void swf_modifyobject(int depth, int how) Updates the position and/or color of the object */ PHP_FUNCTION(swf_modifyobject) { zval **depth, **how; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &depth, &how) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_long_ex(depth); convert_to_long_ex(how); swf_modifyobject(Z_LVAL_PP(depth), Z_LVAL_PP(how)); } /* }}} */ /* {{{ proto void swf_removeobject(int depth) Removes the object at the specified depth */ PHP_FUNCTION(swf_removeobject) { zval **depth; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &depth) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_long_ex(depth); swf_removeobject(Z_LVAL_PP(depth)); } /* }}} */ /* {{{ proto int swf_nextid(void) Returns a free objid */ PHP_FUNCTION(swf_nextid) { RETURN_LONG(swf_nextid()); } /* }}} */ /* {{{ proto void swf_startdoaction(void) Starts the description of an action list for the current frame */ PHP_FUNCTION(swf_startdoaction) { swf_startdoaction(); } /* }}} */ /* {{{ proto void swf_enddoaction(void) Ends the list of actions to perform for the current frame */ PHP_FUNCTION(swf_enddoaction) { swf_enddoaction(); } /* }}} */ /* {{{ proto void swf_actiongotoframe(int frame_number) Causes the Flash movie to display the specified frame, frame_number, and then stop. */ PHP_FUNCTION(swf_actiongotoframe) { zval **frameno; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &frameno) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_long_ex(frameno); swf_actionGotoFrame(Z_LVAL_PP(frameno)); } /* }}} */ /* {{{ proto void swf_actiongeturl(string url, string target) Gets the specified url */ PHP_FUNCTION(swf_actiongeturl) { zval **url, **target; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &url, &target) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_string_ex(url); convert_to_string_ex(target); swf_actionGetURL(Z_STRVAL_PP(url), Z_STRVAL_PP(target)); } /* }}} */ /* {{{ proto void swf_actionnextframe(void) Goes foward one frame */ PHP_FUNCTION(swf_actionnextframe) { swf_actionNextFrame(); } /* }}} */ /* {{{ proto void swf_actionprevframe(void) Goes backward one frame */ PHP_FUNCTION(swf_actionprevframe) { swf_actionPrevFrame(); } /* }}} */ /* {{{ proto void swf_actionplay(void) Starts playing the Flash movie from the current frame */ PHP_FUNCTION(swf_actionplay) { swf_actionPlay(); } /* }}} */ /* {{{ proto void swf_actionstop(void) Stops playing the Flash movie at the current frame */ PHP_FUNCTION(swf_actionstop) { swf_actionStop(); } /* }}} */ /* {{{ proto void swf_actiontogglequality(void) Toggles between high and low quality */ PHP_FUNCTION(swf_actiontogglequality) { swf_actionToggleQuality(); } /* }}} */ /* {{{ proto void swf_actionwaitforframe(int frame, int skipcount) If the specified frame has not been loaded, skip the specified number of actions in the action list */ PHP_FUNCTION(swf_actionwaitforframe) { zval **frame, **skipcount; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &frame, &skipcount) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_long_ex(frame); convert_to_long_ex(skipcount); swf_actionWaitForFrame(Z_LVAL_PP(frame), Z_LVAL_PP(skipcount)); } /* }}} */ /* {{{ proto void swf_actionsettarget(string target) Sets the context for actions */ PHP_FUNCTION(swf_actionsettarget) { zval **target; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &target) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_string_ex(target); swf_actionSetTarget(Z_STRVAL_PP(target)); } /* }}} */ /* {{{ proto void swf_actiongotolabel(string label) Causes the flash movie to display the frame with the given label and then stop */ PHP_FUNCTION(swf_actiongotolabel) { zval **label; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &label) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_string_ex(label); swf_actionGoToLabel(Z_STRVAL_PP(label)); } /* }}} */ /* {{{ php_swf_define */ void php_swf_define(INTERNAL_FUNCTION_PARAMETERS, int opt) { zval **objid, **x1, **y1, **x2, **y2, **width; if (ZEND_NUM_ARGS() != 6 || zend_get_parameters_ex(6, &objid, &x1, &y1, &x2, &y2, &width) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_long_ex(objid); convert_to_double_ex(x1); convert_to_double_ex(y1); convert_to_double_ex(x2); convert_to_double_ex(y2); convert_to_double_ex(width); if (opt) { swf_defineline(Z_LVAL_PP(objid), (float)Z_DVAL_PP(x1), (float)Z_DVAL_PP(y1), (float)Z_DVAL_PP(x2), (float)Z_DVAL_PP(y2), (float)Z_DVAL_PP(width)); } else { swf_definerect(Z_LVAL_PP(objid), (float)Z_DVAL_PP(x1), (float)Z_DVAL_PP(y1), (float)Z_DVAL_PP(x2), (float)Z_DVAL_PP(y2), (float)Z_DVAL_PP(width)); } } /* }}} */ /* {{{ proto void swf_defineline(int objid, float x1, float y1, float x2, float y2, float width) Create a line with object id, objid, starting from x1, y1 and going to x2, y2 with width, width */ PHP_FUNCTION(swf_defineline) { php_swf_define(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); } /* }}} */ /* {{{ proto void swf_definerect(int objid, float x1, float y1, float x2, float y2, float width) Create a rectangle with object id, objid, the upper lefthand coordinate is given by x1, y1 the bottom right coordinate is x2, y2 and with is the width of the line */ PHP_FUNCTION(swf_definerect) { php_swf_define(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); } /* }}} */ /* {{{ proto void swf_definepoly(int obj_id, array coords, int npoints, float width) Define a Polygon from an array of x,y coordinates, coords. */ PHP_FUNCTION(swf_definepoly) { zval **obj_id, **coordinates, **NumPoints, **width, **var; int npoints, i; float coords[256][2]; if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &obj_id, &coordinates, &NumPoints, &width) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_long_ex(obj_id); convert_to_long_ex(NumPoints); convert_to_double_ex(width); if (Z_TYPE_PP(coordinates) != IS_ARRAY) { php_error(E_WARNING, "Wrong datatype of second argument to swf_definepoly"); RETURN_FALSE; } if (Z_LVAL_PP(NumPoints) > 256) { php_error(E_WARNING, "The npoints value cannot be larger then 256."); RETURN_FALSE; } npoints = Z_LVAL_PP(NumPoints); for (i = 0; i < npoints; i++) { if (zend_hash_index_find(Z_ARRVAL_PP(coordinates), (i * 2), (void **)&var) == SUCCESS) { SEPARATE_ZVAL(var); convert_to_double_ex(var); coords[i][0] = (float)Z_DVAL_PP(var); } if (zend_hash_index_find(Z_ARRVAL_PP(coordinates), (i * 2) + 1, (void **)&var) == SUCCESS) { SEPARATE_ZVAL(var); convert_to_double_ex(var); coords[i][1] = (float)Z_DVAL_PP(var); } } swf_definepoly(Z_LVAL_PP(obj_id), coords, npoints, (float)Z_DVAL_PP(width)); } /* }}} */ /* {{{ proto void swf_startshape(int objid) Initialize a new shape with object id, objid */ PHP_FUNCTION(swf_startshape) { zval **objid; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &objid) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_long_ex(objid); swf_startshape(Z_LVAL_PP(objid)); } /* }}} */ /* {{{ proto void swf_shapelinesolid(float r, float g, float b, float a, float width) Create a line with color defined by rgba, and a width of width */ PHP_FUNCTION(swf_shapelinesolid) { zval **r, **g, **b, **a, **width; if (ZEND_NUM_ARGS() != 5 || zend_get_parameters_ex(5, &r, &g, &b, &a, &width) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_double_ex(r); convert_to_double_ex(g); convert_to_double_ex(b); convert_to_double_ex(a); convert_to_double_ex(width); swf_shapelinesolid((float)Z_DVAL_PP(r), (float)Z_DVAL_PP(g), (float)Z_DVAL_PP(b), (float)Z_DVAL_PP(a), (float)Z_DVAL_PP(width)); } /* }}} */ /* {{{ proto void swf_shapefilloff(void) Turns off filling */ PHP_FUNCTION(swf_shapefilloff) { swf_shapefilloff(); } /* }}} */ /* {{{ proto void swf_shapefillsolid(float r, float g, float b, float a) Sets the current fill style to a solid fill with the specified rgba color */ PHP_FUNCTION(swf_shapefillsolid) { zval **r, **g, **b, **a; if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &r, &g, &b, &a) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_double_ex(r); convert_to_double_ex(g); convert_to_double_ex(b); convert_to_double_ex(a); swf_shapefillsolid((float)Z_DVAL_PP(r), (float)Z_DVAL_PP(g), (float)Z_DVAL_PP(b), (float)Z_DVAL_PP(a)); } /* }}} */ /* {{{ php_swf_fill_bitmap */ void php_swf_fill_bitmap(INTERNAL_FUNCTION_PARAMETERS, int opt) { zval **bitmapid; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &bitmapid) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_long_ex(bitmapid); if (opt) { swf_shapefillbitmapclip(Z_LVAL_PP(bitmapid)); } else { swf_shapefillbitmaptile(Z_LVAL_PP(bitmapid)); } } /* }}} */ /* {{{ proto void swf_shapefillbitmapclip(int bitmapid) Sets the current fill mode to clipped bitmap fill. Pixels from the previously defined bitmapid will be used to fill areas */ PHP_FUNCTION(swf_shapefillbitmapclip) { php_swf_fill_bitmap(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); } /* }}} */ /* {{{ proto void swf_shapefillbitmaptile(int bitmapid) Sets the current fill mode to tiled bitmap fill. Pixels from the previously defined bitmapid will be used to fill areas */ PHP_FUNCTION(swf_shapefillbitmaptile) { php_swf_fill_bitmap(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); } /* }}} */ /* {{{ php_swf_shape */ void php_swf_shape(INTERNAL_FUNCTION_PARAMETERS, int opt) { zval **x, **y; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &x, &y) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_double_ex(x); convert_to_double_ex(y); if (opt) { swf_shapemoveto((float)Z_DVAL_PP(x), (float)Z_DVAL_PP(y)); } else { swf_shapelineto((float)Z_DVAL_PP(x), (float)Z_DVAL_PP(y)); } } /* }}} */ /* {{{ proto void swf_shapemoveto(float x, float y) swf_shapemoveto moves the current position to the given x,y. */ PHP_FUNCTION(swf_shapemoveto) { php_swf_shape(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); } /* }}} */ /* {{{ proto void swf_shapelineto(float x, float y) Draws a line from the current position to x,y, the current position is then set to x,y */ PHP_FUNCTION(swf_shapelineto) { php_swf_shape(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); } /* }}} */ /* {{{ proto void swf_shapecurveto(float x1, float y1, float x2, float y2) Draws a quadratic bezier curve starting at the current position using x1, y1 as an off curve control point and using x2, y2 as the end point. The current position is then set to x2, y2. */ PHP_FUNCTION(swf_shapecurveto) { zval **x1, **y1, **x2, **y2; if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &x1, &y1, &x2, &y2) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_double_ex(x1); convert_to_double_ex(y1); convert_to_double_ex(x2); convert_to_double_ex(y2); swf_shapecurveto((float)Z_DVAL_PP(x1), (float)Z_DVAL_PP(y1), (float)Z_DVAL_PP(x2), (float)Z_DVAL_PP(y2)); } /* }}} */ /* {{{ proto void swf_shapecurveto3(float x1, float y1, float x2, float y2, float x3, float y3) Draws a cubic bezier curve starting at the current position using x1, y1 and x2, y2 as off curve control points and using x3,y3 as the end point. The current position is then sent to x3, y3 */ PHP_FUNCTION(swf_shapecurveto3) { zval **x1, **y1, **x2, **y2, **x3, **y3; if (ZEND_NUM_ARGS() != 6 || zend_get_parameters_ex(6, &x1, &y1, &x2, &y2, &x3, &y3) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_double_ex(x1); convert_to_double_ex(y1); convert_to_double_ex(x2); convert_to_double_ex(y2); convert_to_double_ex(x3); convert_to_double_ex(y3); swf_shapecurveto3((float)Z_DVAL_PP(x1), (float)Z_DVAL_PP(y1), (float)Z_DVAL_PP(x2), (float)Z_DVAL_PP(y2), (float)Z_DVAL_PP(x3), (float)Z_DVAL_PP(y3)); } /* }}} */ /* {{{ proto void swf_shapearc(float x, float y, float r, float ang1, float ang2) Draws a circular arc from ang1 to ang2. The center of the circle is given by x, and y. r specifies the radius of the arc */ PHP_FUNCTION(swf_shapearc) { zval **x, **y, **r, **ang1, **ang2; if (ZEND_NUM_ARGS() != 5 || zend_get_parameters_ex(5, &x, &y, &r, &ang1, &ang2) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_double_ex(x); convert_to_double_ex(y); convert_to_double_ex(r); convert_to_double_ex(ang1); convert_to_double_ex(ang2); swf_shapearc((float)Z_DVAL_PP(x), (float)Z_DVAL_PP(y), (float)Z_DVAL_PP(r), (float)Z_DVAL_PP(ang1), (float)Z_DVAL_PP(ang2)); } /* }}} */ /* {{{ proto void swf_endshape(void) Completes the definition of the current shape */ PHP_FUNCTION(swf_endshape) { swf_endshape(); } /* }}} */ /* {{{ proto void swf_definefont(int fontid, string name) Defines a font. name specifies the PostScript name of the font to use. This font also becomes the current font. */ PHP_FUNCTION(swf_definefont) { zval **fontid, **name; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &fontid, &name) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_long_ex(fontid); convert_to_string_ex(name); swf_definefont(Z_LVAL_PP(fontid), Z_STRVAL_PP(name)); } /* }}} */ /* {{{ proto void swf_setfont(int fontid) Sets fontid to the current font */ PHP_FUNCTION(swf_setfont) { zval **fontid; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &fontid) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_long_ex(fontid); swf_setfont(Z_LVAL_PP(fontid)); } /* }}} */ /* {{{ proto void swf_fontsize(float height) Sets the current font's height to the value specified by height */ PHP_FUNCTION(swf_fontsize) { zval **height; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &height) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_double_ex(height); swf_fontsize((float)Z_DVAL_PP(height)); } /* }}} */ /* {{{ proto void swf_fontslant(float slant) Set the current font slant to the angle indicated by slant */ PHP_FUNCTION(swf_fontslant) { zval **slant; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &slant) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_double_ex(slant); swf_fontslant((float)Z_DVAL_PP(slant)); } /* }}} */ /* {{{ proto void swf_fonttracking(track) Sets the current font tracking to the specified value, track */ PHP_FUNCTION(swf_fonttracking) { zval **track; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &track) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_double_ex(track); swf_fonttracking((float)Z_DVAL_PP(track)); } /* }}} */ /* {{{ proto array swf_getfontinfo(void) Get information about the current font */ PHP_FUNCTION(swf_getfontinfo) { float A_height, x_height; swf_getfontinfo(&A_height, &x_height); if (array_init(return_value) == FAILURE) { php_error(E_WARNING, "Cannot initialize return value from swf_getfontinfo"); RETURN_FALSE; } add_assoc_double(return_value, "Aheight", A_height); add_assoc_double(return_value, "xheight", x_height); } /* }}} */ /* {{{ proto void swf_definetext(int objid, string str, int docCenter) defines a text string using the current font, current fontsize and current font slant. If docCenter is 1, the word is centered in x */ PHP_FUNCTION(swf_definetext) { zval **objid, **str, **docCenter; if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &objid, &str, &docCenter) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_long_ex(objid); convert_to_string_ex(str); convert_to_long_ex(docCenter); swf_definetext(Z_LVAL_PP(objid), Z_STRVAL_PP(str), Z_LVAL_PP(docCenter)); } /* }}} */ /* {{{ proto void swf_textwidth(string str) Calculates the width of a string, str, using the current fontsize & current font */ PHP_FUNCTION(swf_textwidth) { zval **str; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &str) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_string_ex(str); RETURN_DOUBLE((double)swf_textwidth(Z_STRVAL_PP(str))); } /* }}} */ /* {{{ proto void swf_definebitmap(int objid, string imgname) Defines a bitmap given the name of a .gif .rgb .jpeg or .fi image. The image will be converted into Flash jpeg or Flash color map format */ PHP_FUNCTION(swf_definebitmap) { zval **objid, **imgname; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &objid, &imgname) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_long_ex(objid); convert_to_string_ex(imgname); swf_definebitmap(Z_LVAL_PP(objid), Z_STRVAL_PP(imgname)); } /* }}} */ /* {{{ proto array swf_getbitmapinfo(int bitmapid) Returns an array of information about a bitmap specified by bitmapid */ PHP_FUNCTION(swf_getbitmapinfo) { zval **bitmapid; int size, width, height; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &bitmapid) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_long_ex(bitmapid); size = swf_getbitmapinfo(Z_LVAL_PP(bitmapid), &width, &height); if (array_init(return_value) == FAILURE) { php_error(E_WARNING, "Cannot initialize return value from swf_getbitmapinfo"); RETURN_FALSE; } add_assoc_long(return_value, "size", size); add_assoc_long(return_value, "width", width); add_assoc_long(return_value, "height", height); } /* }}} */ /* {{{ proto void swf_startsymbol(int objid) Create a new symbol with object id, objid */ PHP_FUNCTION(swf_startsymbol) { zval **objid; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &objid) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_long_ex(objid); swf_startsymbol(Z_LVAL_PP(objid)); } /* }}} */ /* {{{ proto void swf_endsymbol(void) End the current symbol */ PHP_FUNCTION(swf_endsymbol) { swf_endsymbol(); } /* }}} */ /* {{{ proto void swf_startbutton(int objid, int type) Start a button with an object id, objid and a type of either TYPE_MENUBUTTON or TYPE_PUSHBUTTON */ PHP_FUNCTION(swf_startbutton) { zval **objid, **type; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &objid, &type) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_long_ex(objid); convert_to_long_ex(type); swf_startbutton(Z_LVAL_PP(objid), Z_LVAL_PP(type)); /* TYPE_MENUBUTTON, TYPE_PUSHBUTTON */ } /* }}} */ /* {{{ proto void swf_addbuttonrecord(int state, int objid, int depth) Controls the location, appearance and active area of the current button */ PHP_FUNCTION(swf_addbuttonrecord) { zval **state, **objid, **depth; if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &state, &objid, &depth) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_long_ex(state); convert_to_long_ex(objid); convert_to_long_ex(depth); swf_addbuttonrecord(Z_LVAL_PP(state), Z_LVAL_PP(objid), Z_LVAL_PP(depth)); } /* }}} */ /* {{{ proto void swf_oncondition(int transitions) Describes a transition used to trigger an action list */ PHP_FUNCTION(swf_oncondition) { zval **transitions; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &transitions) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_long_ex(transitions); swf_oncondition(Z_LVAL_PP(transitions)); } /* }}} */ /* {{{ proto void swf_endbutton(void) Complete the definition of the current button */ PHP_FUNCTION(swf_endbutton) { swf_endbutton(); } /* }}} */ /* {{{ php_swf_geo_same */ void php_swf_geo_same(INTERNAL_FUNCTION_PARAMETERS, int opt) { zval **arg1, **arg2, **arg3, **arg4; if (ZEND_NUM_ARGS() != 4 || zend_get_parameters_ex(4, &arg1, &arg2, &arg3, &arg4) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_double_ex(arg1); convert_to_double_ex(arg2); convert_to_double_ex(arg3); convert_to_double_ex(arg4); if (opt == 0) { swf_viewport(Z_DVAL_PP(arg1), Z_DVAL_PP(arg2), Z_DVAL_PP(arg3), Z_DVAL_PP(arg4)); } else if (opt == 1) { swf_ortho2(Z_DVAL_PP(arg1), Z_DVAL_PP(arg2), Z_DVAL_PP(arg3), Z_DVAL_PP(arg4)); } else if (opt == 2) { swf_polarview(Z_DVAL_PP(arg1), Z_DVAL_PP(arg2), Z_DVAL_PP(arg3), Z_DVAL_PP(arg4)); } else if (opt == 3) { swf_perspective(Z_DVAL_PP(arg1), Z_DVAL_PP(arg2), Z_DVAL_PP(arg3), Z_DVAL_PP(arg4)); } } /* }}} */ /* {{{ proto void swf_viewport(float xmin, float xmax, float ymin, float ymax) Selects an area on the drawing surface for future drawing */ PHP_FUNCTION(swf_viewport) { php_swf_geo_same(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); } /* }}} */ /* {{{ proto void swf_ortho2(float xmin, float xmax, float ymin, float ymax) Defines a 2-D orthographic mapping of user coordinates onto the current viewport */ PHP_FUNCTION(swf_ortho2) { php_swf_geo_same(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); } /* }}} */ /* {{{ proto void swf_ortho(float xmin, float xmax, float ymin, float ymax, float zmin, float zmax) Defines an orthographic mapping of user coordinates onto the current viewport */ PHP_FUNCTION(swf_ortho) { zval **xmin, **xmax, **ymin, **ymax, **zmin, **zmax; if (ZEND_NUM_ARGS() != 6 || zend_get_parameters_ex(6, &xmin, &xmax, &ymin, &ymax, &zmin, &zmax) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_double_ex(xmin); convert_to_double_ex(xmax); convert_to_double_ex(ymin); convert_to_double_ex(ymax); convert_to_double_ex(zmin); convert_to_double_ex(zmax); swf_ortho(Z_DVAL_PP(xmin), Z_DVAL_PP(xmax), Z_DVAL_PP(ymin), Z_DVAL_PP(ymax), Z_DVAL_PP(zmin), Z_DVAL_PP(zmax)); } /* }}} */ /* {{{ proto void swf_polarview(float dist, float azimuth, float incidence, float twist) Defines he viewer's position in polar coordinates */ PHP_FUNCTION(swf_polarview) { php_swf_geo_same(INTERNAL_FUNCTION_PARAM_PASSTHRU, 2); } /* }}} */ /* {{{ proto void swf_perspective(float fovy, float aspect, float near, float far) Define a perspective projection transformation. */ PHP_FUNCTION(swf_perspective) { php_swf_geo_same(INTERNAL_FUNCTION_PARAM_PASSTHRU, 3); } /* }}} */ /* {{{ proto void swf_lookat(float vx, float vy, float vz, float px, float py, float pz, float twist) Defines a viewing transformation by giving the view position vx, vy, vz, and the coordinates of a reference point in the scene at px, py, pz. Twist controls a rotation along the viewer's z axis */ PHP_FUNCTION(swf_lookat) { zval **vx, **vy, **vz, **px, **py, **pz, **twist; if (ZEND_NUM_ARGS() != 7 || zend_get_parameters_ex(7, &vx, &vy, &vz, &px, &py, &pz, &twist) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_double_ex(vx); convert_to_double_ex(vy); convert_to_double_ex(vz); convert_to_double_ex(px); convert_to_double_ex(py); convert_to_double_ex(pz); convert_to_double_ex(twist); swf_lookat(Z_DVAL_PP(vx), Z_DVAL_PP(vy), Z_DVAL_PP(vz), Z_DVAL_PP(px), Z_DVAL_PP(py), Z_DVAL_PP(pz), Z_DVAL_PP(twist)); } /* }}} */ /* {{{ proto void swf_pushmatrix(void) Push the current transformation matrix onto the stack */ PHP_FUNCTION(swf_pushmatrix) { swf_pushmatrix(); } /* }}} */ /* {{{ proto void swf_popmatrix(void) Restore a previous transformation matrix */ PHP_FUNCTION(swf_popmatrix) { swf_popmatrix(); } /* }}} */ /* {{{ proto void swf_scale(float x, float y, float z) Scale the current transformation */ PHP_FUNCTION(swf_scale) { zval **x, **y, **z; if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &x, &y, &z) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_double_ex(x); convert_to_double_ex(y); convert_to_double_ex(z); swf_scale(Z_DVAL_PP(x), Z_DVAL_PP(y), Z_DVAL_PP(z)); } /* }}} */ /* {{{ proto void swf_translate(float x, float y, float z) Translate the current transformation */ PHP_FUNCTION(swf_translate) { zval **x, **y, **z; if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &x, &y, &z) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_double_ex(x); convert_to_double_ex(y); convert_to_double_ex(z); swf_translate(Z_DVAL_PP(x), Z_DVAL_PP(y), Z_DVAL_PP(z)); } /* }}} */ /* {{{ proto void swf_rotate(float angle, string axis) Rotate the current transformation by the given angle about x, y, or z axis. The axis may be 'x', 'y', or 'z' */ PHP_FUNCTION(swf_rotate) { zval **angle, **axis; if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &angle, &axis) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_double_ex(angle); convert_to_string_ex(axis); swf_rotate(Z_DVAL_PP(angle), (char)(Z_STRVAL_PP(axis))[0]); } /* }}} */ /* {{{ proto void swf_posround(int doit) This enables or disables rounding of the translation when objects are places or moved */ PHP_FUNCTION(swf_posround) { zval **doit; if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &doit) == FAILURE) { WRONG_PARAM_COUNT; } convert_to_long_ex(doit); swf_posround(Z_LVAL_PP(doit)); } /* }}} */ #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 */ php-4.4.8/ext/swf/config.m40000644000175000017500000000154607443427157014733 0ustar derickderickdnl dnl $Id: config.m4,v 1.12 2002/03/12 16:35:59 sas Exp $ dnl PHP_ARG_WITH(swf, for libswf support, [ --with-swf[=DIR] Include swf support]) if test "$PHP_SWF" != "no"; then if test -r $PHP_SWF/lib/libswf.a; then SWF_DIR=$PHP_SWF else AC_MSG_CHECKING(for libswf in default path) for i in /usr/local /usr; do if test -r $i/lib/libswf.a; then SWF_DIR=$i AC_MSG_RESULT(found in $i) fi done fi if test -z "$SWF_DIR"; then AC_MSG_RESULT(not found) AC_MSG_ERROR(Please reinstall the libswf distribution - swf.h should be /include and libswf.a should be in /lib) fi PHP_ADD_INCLUDE($SWF_DIR/include) PHP_SUBST(SWF_SHARED_LIBADD) PHP_ADD_LIBRARY_WITH_PATH(swf, $SWF_DIR/lib, SWF_SHARED_LIBADD) AC_DEFINE(HAVE_SWF,1,[ ]) PHP_NEW_EXTENSION(swf, swf.c, $ext_shared) fi php-4.4.8/ext/swf/php_swf.h0000644000175000017500000000765710736114315015040 0ustar derickderick/* +----------------------------------------------------------------------+ | PHP Version 4 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable 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: php_swf.h,v 1.16.8.1.8.3 2007/12/31 07:22:53 sebastian Exp $ */ #ifndef PHP_SWF_H #define PHP_SWF_H #if HAVE_SWF extern zend_module_entry swf_module_entry; #define swf_module_ptr &swf_module_entry PHP_MINIT_FUNCTION(swf); PHP_MINFO_FUNCTION(swf); PHP_RINIT_FUNCTION(swf); void php_swf_define(INTERNAL_FUNCTION_PARAMETERS, int opt); void php_swf_fill_bitmap(INTERNAL_FUNCTION_PARAMETERS, int opt); void php_swf_geo_same(INTERNAL_FUNCTION_PARAMETERS, int opt); PHP_FUNCTION(swf_openfile); PHP_FUNCTION(swf_closefile); PHP_FUNCTION(swf_labelframe); PHP_FUNCTION(swf_showframe); PHP_FUNCTION(swf_setframe); PHP_FUNCTION(swf_getframe); PHP_FUNCTION(swf_mulcolor); PHP_FUNCTION(swf_addcolor); PHP_FUNCTION(swf_placeobject); PHP_FUNCTION(swf_modifyobject); PHP_FUNCTION(swf_removeobject); PHP_FUNCTION(swf_nextid); PHP_FUNCTION(swf_startdoaction); PHP_FUNCTION(swf_enddoaction); PHP_FUNCTION(swf_actiongotoframe); PHP_FUNCTION(swf_actiongeturl); PHP_FUNCTION(swf_actionnextframe); PHP_FUNCTION(swf_actionprevframe); PHP_FUNCTION(swf_actionplay); PHP_FUNCTION(swf_actionstop); PHP_FUNCTION(swf_actiontogglequality); PHP_FUNCTION(swf_actionwaitforframe); PHP_FUNCTION(swf_actionsettarget); PHP_FUNCTION(swf_actiongotolabel); PHP_FUNCTION(swf_defineline); PHP_FUNCTION(swf_definerect); PHP_FUNCTION(swf_definepoly); PHP_FUNCTION(swf_startshape); PHP_FUNCTION(swf_shapelinesolid); PHP_FUNCTION(swf_shapefilloff); PHP_FUNCTION(swf_shapefillsolid); PHP_FUNCTION(swf_shapefillbitmapclip); PHP_FUNCTION(swf_shapefillbitmaptile); PHP_FUNCTION(swf_shapemoveto); PHP_FUNCTION(swf_shapelineto); PHP_FUNCTION(swf_shapecurveto); PHP_FUNCTION(swf_shapecurveto3); PHP_FUNCTION(swf_shapearc); PHP_FUNCTION(swf_endshape); PHP_FUNCTION(swf_definefont); PHP_FUNCTION(swf_setfont); PHP_FUNCTION(swf_fontsize); PHP_FUNCTION(swf_fontslant); PHP_FUNCTION(swf_fonttracking); PHP_FUNCTION(swf_getfontinfo); PHP_FUNCTION(swf_definetext); PHP_FUNCTION(swf_textwidth); PHP_FUNCTION(swf_definebitmap); PHP_FUNCTION(swf_getbitmapinfo); PHP_FUNCTION(swf_startsymbol); PHP_FUNCTION(swf_endsymbol); PHP_FUNCTION(swf_startbutton); PHP_FUNCTION(swf_addbuttonrecord); PHP_FUNCTION(swf_oncondition); PHP_FUNCTION(swf_endbutton); PHP_FUNCTION(swf_viewport); PHP_FUNCTION(swf_ortho); PHP_FUNCTION(swf_ortho2); PHP_FUNCTION(swf_perspective); PHP_FUNCTION(swf_polarview); PHP_FUNCTION(swf_lookat); PHP_FUNCTION(swf_pushmatrix); PHP_FUNCTION(swf_popmatrix); PHP_FUNCTION(swf_scale); PHP_FUNCTION(swf_translate); PHP_FUNCTION(swf_rotate); PHP_FUNCTION(swf_posround); ZEND_BEGIN_MODULE_GLOBALS(swf) int use_file; char *tmpfile_name; ZEND_END_MODULE_GLOBALS(swf) #ifdef ZTS #define SWFG(v) TSRMG(swf_globals_id, zend_swf_globals *, v) #else #define SWFG(v) (swf_globals.v) #endif #else #define swf_module_ptr NULL #endif /* HAVE_FLASH */ #define phpext_swf_ptr swf_module_ptr #endif /* _PHP_FLASH_H */ php-4.4.8/ext/swf/CREDITS0000644000175000017500000000002407206176612014224 0ustar derickderickSWF Sterling Hughes php-4.4.8/ext/xml/0000755000175000017500000000000010737115146013207 5ustar derickderickphp-4.4.8/ext/xml/expat/0000755000175000017500000000000010737115146014330 5ustar derickderickphp-4.4.8/ext/xml/expat/internal.h0000644000175000017500000000351607706723610016325 0ustar derickderick/* internal.h Internal definitions used by Expat. This is not needed to compile client code. The following calling convention macros are defined for frequently called functions: FASTCALL - Used for those internal functions that have a simple body and a low number of arguments and local variables. PTRCALL - Used for functions called though function pointers. PTRFASTCALL - Like PTRCALL, but for low number of arguments. inline - Used for selected internal functions for which inlining may improve performance on some platforms. Note: Use of these macros is based on judgement, not hard rules, and therefore subject to change. */ #if defined(__GNUC__) /* Instability reported with egcs on a RedHat Linux 7.3. Let's comment it out: #define FASTCALL __attribute__((stdcall, regparm(3))) and let's try this: */ #define FASTCALL __attribute__((regparm(3))) #define PTRCALL #define PTRFASTCALL __attribute__((regparm(3))) #elif defined(WIN32) /* Using __fastcall seems to have an unexpected negative effect under MS VC++, especially for function pointers, so we won't use it for now on that platform. It may be reconsidered for a future release if it can be made more effective. Likely reason: __fastcall on Windows is like stdcall, therefore the compiler cannot perform stack optimizations for call clusters. */ #define FASTCALL #define PTRCALL #define PTRFASTCALL #endif #ifndef FASTCALL #define FASTCALL #endif #ifndef PTRCALL #define PTRCALL #endif #ifndef PTRFASTCALL #define PTRFASTCALL #endif #ifndef XML_MIN_SIZE #if !defined(__cplusplus) && !defined(inline) #ifdef __GNUC__ #define inline __inline #endif /* __GNUC__ */ #endif #endif /* XML_MIN_SIZE */ #ifdef __cplusplus #define inline inline #else #ifndef inline #define inline #endif #endif php-4.4.8/ext/xml/expat/latin1tab.h0000644000175000017500000000342507706723610016367 0ustar derickderick/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd See the file COPYING for copying permission. */ /* 0x80 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0x84 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0x88 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0x8C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0x90 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0x94 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0x98 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0x9C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0xA0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0xA4 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0xA8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER, /* 0xAC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0xB0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0xB4 */ BT_OTHER, BT_NMSTRT, BT_OTHER, BT_NAME, /* 0xB8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER, /* 0xBC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER, /* 0xC0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xC4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xC8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xCC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xD0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xD4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, /* 0xD8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xDC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xE0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xE4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xE8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xEC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xF0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xF4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, /* 0xF8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0xFC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, php-4.4.8/ext/xml/expat/README0000644000175000017500000001060607706723610015216 0ustar derickderick Expat, Release 1.95.6 This is Expat, a C library for parsing XML, written by James Clark. Expat is a stream-oriented XML parser. This means that you register handlers with the parser before starting the parse. These handlers are called when the parser discovers the associated structures in the document being parsed. A start tag is an example of the kind of structures for which you may register handlers. Windows users should use the expat_win32bin package, which includes both precompiled libraries and executalbes, and source code for developers. Expat is free software. You may copy, distribute, and modify it under the terms of the License contained in the file COPYING distributed with this package. This license is the same as the MIT/X Consortium license. Versions of Expat that have an odd minor version (the middle number in the release above), are development releases and should be considered as beta software. Releases with even minor version numbers are intended to be production grade software. If you are building Expat from a check-out from the CVS repository, you need to run a script that generates the configure script using the GNU autoconf and libtool tools. To do this, you need to have autoconf 2.52 or newer and libtool 1.4 or newer. Run the script like this: ./buildconf.sh Once this has been done, follow the same instructions as for building from a source distribution. To build Expat from a source distribution, you first run the configuration shell script in the top level distribution directory: ./configure There are many options which you may provide to configure (which you can discover by running configure with the --help option). But the one of most interest is the one that sets the installation directory. By default, the configure script will set things up to install libexpat into /usr/local/lib, expat.h into /usr/local/include, and xmlwf into /usr/local/bin. If, for example, you'd prefer to install into /home/me/mystuff/lib, /home/me/mystuff/include, and /home/me/mystuff/bin, you can tell configure about that with: ./configure --prefix=/home/me/mystuff After running the configure script, the "make" command will build things and "make install" will install things into their proper location. Note that you need to have write permission into the directories into which things will be installed. If you are interested in building Expat to provide document information in UTF-16 rather than the default UTF-8, following these instructions: 1. For UTF-16 output as unsigned short (and version/error strings as char), run: ./configure CPPFLAGS=-DXML_UNICODE For UTF-16 output as wchar_t (incl. version/error strings), run: ./configure CFLAGS="-g -O2 -fshort-wchar" \ CPPFLAGS=-DXML_UNICODE_WCHAR_T 2. Edit the MakeFile, changing: LIBRARY = libexpat.la to: LIBRARY = libexpatw.la (Note the additional "w" in the library name.) 3. Run "make buildlib" (which builds the library only). 4. Run "make installlib" (which installs the library only). Note for Solaris users: The "ar" command is usually located in "/usr/ccs/bin", which is not in the default PATH. You will need to add this to your path for the "make" command, and probably also switch to GNU make (the "make" found in /usr/ccs/bin does not seem to work properly -- appearantly it does not understand .PHONY directives). If you're using ksh or bash, use this command to build: PATH=/usr/ccs/bin:$PATH make When using Expat with a project using autoconf for configuration, you can use the probing macro in conftools/expat.m4 to determine how to include Expat. See the comments at the top of that file for more information. A reference manual is available in the file doc/reference.html in this distribution. The homepage for this project is http://www.libexpat.org/. There are links there to connect you to the bug reports page. If you need to report a bug when you don't have access to a browser, you may also send a bug report by email to expat-bugs@mail.libexpat.org. Discussion related to the direction of future expat development takes place on expat-discuss@mail.libexpat.org. Archives of this list and other Expat-related lists may be found at: http://mail.libexpat.org/mailman-21/listinfo/ php-4.4.8/ext/xml/expat/asciitab.h0000644000175000017500000000334007706723610016263 0ustar derickderick/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd See the file COPYING for copying permission. */ /* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML, /* 0x0C */ BT_NONXML, BT_CR, BT_NONXML, BT_NONXML, /* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML, /* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM, /* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS, /* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS, /* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL, /* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, /* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT, /* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI, /* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST, /* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, /* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, /* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB, /* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT, /* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX, /* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT, /* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, /* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER, /* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER, php-4.4.8/ext/xml/expat/Changes0000644000175000017500000001316507706723610015634 0ustar derickderickRelease 1.95.6 Tue Jan 28 2003 - Added XML_FreeContentModel(). - Added XML_MemMalloc(), XML_MemRealloc(), XML_MemFree(). - Fixed a variety of bugs: see SF issues 615606, 616863, 618199, 653180, 673791. - Enhanced the regression test suite. - Man page improvements: includes SF issue 632146. Release 1.95.5 Fri Sep 6 2002 - Added XML_UseForeignDTD() for improved SAX2 support. - Added XML_GetFeatureList(). - Defined XML_Bool type and the values XML_TRUE and XML_FALSE. - Use an incomplete struct instead of a void* for the parser (may not retain). - Fixed UTF-8 decoding bug that caused legal UTF-8 to be rejected. - Finally fixed bug where default handler would report DTD events that were already handled by another handler. Initial patch contributed by Darryl Miles. - Removed unnecessary DllMain() function that caused static linking into a DLL to be difficult. - Added VC++ projects for building static libraries. - Reduced line-length for all source code and headers to be no longer than 80 characters, to help with AS/400 support. - Reduced memory copying during parsing (SF patch #600964). - Fixed a variety of bugs: see SF issues 580793, 434664, 483514, 580503, 581069, 584041, 584183, 584832, 585537, 596555, 596678, 598352, 598944, 599715, 600479, 600971. Release 1.95.4 Fri Jul 12 2002 - Added support for VMS, contributed by Craig Berry. See vms/README.vms for more information. - Added Mac OS (classic) support, with a makefile for MPW, contributed by Thomas Wegner and Daryle Walker. - Added Borland C++ Builder 5 / BCC 5.5 support, contributed by Patrick McConnell (SF patch #538032). - Fixed a variety of bugs: see SF issues 441449, 563184, 564342, 566334, 566901, 569461, 570263, 575168, 579196. - Made skippedEntityHandler conform to SAX2 (see source comment) - Re-implemented WFC: Entity Declared from XML 1.0 spec and added a new error "entity declared in parameter entity": see SF bug report 569461 and SF patch 578161 - Re-implemented section 5.1 from XML 1.0 spec: see SF bug report 570263 and SF patch 578161 Release 1.95.3 Mon Jun 3 2002 - Added a project to the MSVC workspace to create a wchar_t version of the library; the DLLs are named libexpatw.dll. - Changed the name of the Windows DLLs from expat.dll to libexpat.dll; this fixes SF bug #432456. - Added the XML_ParserReset() API function. - Fixed XML_SetReturnNSTriplet() to work for element names. - Made the XML_UNICODE builds usable (thanks, Karl!). - Allow xmlwf to read from standard input. - Install a man page for xmlwf on Unix systems. - Fixed many bugs; see SF bug reports 231864, 461380, 464837, 466885, 469226, 477667, 484419, 487840, 494749, 496505, 547350. Other bugs which we can't test as easily may also have been fixed, especially in the area of build support. Release 1.95.2 Fri Jul 27 2001 - More changes to make MSVC happy with the build; add a single workspace to support both the library and xmlwf application. - Added a Windows installer for Windows users; includes xmlwf.exe. - Added compile-time constants that can be used to determine the Expat version - Removed a lot of GNU-specific dependencies to aide portability among the various Unix flavors. - Fix the UTF-8 BOM bug. - Cleaned up warning messages for several compilers. - Added the -Wall, -Wstrict-prototypes options for GCC. Release 1.95.1 Sun Oct 22 15:11:36 EDT 2000 - Changes to get expat to build under Microsoft compiler - Removed all aborts and instead return an UNEXPECTED_STATE error. - Fixed a bug where a stray '%' in an entity value would cause an abort. - Defined XML_SetEndNamespaceDeclHandler. Thanks to Darryl Miles for finding this oversight. - Changed default patterns in lib/Makefile.in to fit non-GNU makes Thanks to robin@unrated.net for reporting and providing an account to test on. - The reference had the wrong label for XML_SetStartNamespaceDecl. Reported by an anonymous user. Release 1.95.0 Fri Sep 29 2000 - XML_ParserCreate_MM Allows you to set a memory management suite to replace the standard malloc,realloc, and free. - XML_SetReturnNSTriplet If you turn this feature on when namespace processing is in effect, then qualified, prefixed element and attribute names are returned as "uri|name|prefix" where '|' is whatever separator character is used in namespace processing. - Merged in features from perl-expat o XML_SetElementDeclHandler o XML_SetAttlistDeclHandler o XML_SetXmlDeclHandler o XML_SetEntityDeclHandler o StartDoctypeDeclHandler takes 3 additional parameters: sysid, pubid, has_internal_subset o Many paired handler setters (like XML_SetElementHandler) now have corresponding individual handler setters o XML_GetInputContext for getting the input context of the current parse position. - Added reference material - Packaged into a distribution that builds a sharable library php-4.4.8/ext/xml/expat/expat.h0000644000175000017500000010677507706723610015645 0ustar derickderick/* Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd See the file COPYING for copying permission. */ #ifndef XmlParse_INCLUDED #define XmlParse_INCLUDED 1 #ifdef __VMS /* 0 1 2 3 0 1 2 3 1234567890123456789012345678901 1234567890123456789012345678901 */ #define XML_SetProcessingInstructionHandler XML_SetProcessingInstrHandler #define XML_SetUnparsedEntityDeclHandler XML_SetUnparsedEntDeclHandler #define XML_SetStartNamespaceDeclHandler XML_SetStartNamespcDeclHandler #define XML_SetExternalEntityRefHandlerArg XML_SetExternalEntRefHandlerArg #endif #include #include "php_compat.h" #ifndef XMLPARSEAPI #if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__) #ifdef XML_STATIC #define XMLPARSEAPI(type) type __cdecl #else #define XMLPARSEAPI(type) __declspec(dllimport) type __cdecl #endif #else #define XMLPARSEAPI(type) type #endif #endif /* not defined XMLPARSEAPI */ #ifdef __cplusplus extern "C" { #endif #ifdef XML_UNICODE_WCHAR_T #define XML_UNICODE #endif struct XML_ParserStruct; typedef struct XML_ParserStruct *XML_Parser; #ifdef XML_UNICODE /* Information is UTF-16 encoded. */ #ifdef XML_UNICODE_WCHAR_T typedef wchar_t XML_Char; typedef wchar_t XML_LChar; #else typedef unsigned short XML_Char; typedef char XML_LChar; #endif /* XML_UNICODE_WCHAR_T */ #else /* Information is UTF-8 encoded. */ typedef char XML_Char; typedef char XML_LChar; #endif /* XML_UNICODE */ /* Should this be defined using stdbool.h when C99 is available? */ typedef unsigned char XML_Bool; #define XML_TRUE ((XML_Bool) 1) #define XML_FALSE ((XML_Bool) 0) 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 }; enum XML_Content_Quant { XML_CQUANT_NONE, XML_CQUANT_OPT, XML_CQUANT_REP, XML_CQUANT_PLUS }; /* If type == XML_CTYPE_EMPTY or XML_CTYPE_ANY, then quant will be XML_CQUANT_NONE, and the other fields will be zero or NULL. If type == XML_CTYPE_MIXED, then quant will be NONE or REP and numchildren will contain number of elements that may be mixed in and children point to an array of XML_Content cells that will be all of XML_CTYPE_NAME type with no quantification. If type == XML_CTYPE_NAME, then the name points to the name, and the numchildren field will be zero and children will be NULL. The quant fields indicates any quantifiers placed on the name. CHOICE and SEQ will have name NULL, the number of children in numchildren and children will point, recursively, to an array of XML_Content cells. The EMPTY, ANY, and MIXED types will only occur at top level. */ typedef struct XML_cp XML_Content; struct XML_cp { enum XML_Content_Type type; enum XML_Content_Quant quant; XML_Char * name; unsigned int numchildren; XML_Content * children; }; /* This is called for an element declaration. See above for description of the model argument. It's the caller's responsibility to free model when finished with it. */ typedef void (*XML_ElementDeclHandler) (void *userData, const XML_Char *name, XML_Content *model); XMLPARSEAPI(void) XML_SetElementDeclHandler(XML_Parser parser, XML_ElementDeclHandler eldecl); /* The Attlist declaration handler is called for *each* attribute. So a single Attlist declaration with multiple attributes declared will generate multiple calls to this handler. The "default" parameter may be NULL in the case of the "#IMPLIED" or "#REQUIRED" keyword. The "isrequired" parameter will be true and the default value will be NULL in the case of "#REQUIRED". If "isrequired" is true and default is non-NULL, then this is a "#FIXED" default. */ typedef void (*XML_AttlistDeclHandler) (void *userData, const XML_Char *elname, const XML_Char *attname, const XML_Char *att_type, const XML_Char *dflt, int isrequired); XMLPARSEAPI(void) XML_SetAttlistDeclHandler(XML_Parser parser, XML_AttlistDeclHandler attdecl); /* The XML declaration handler is called for *both* XML declarations and text declarations. The way to distinguish is that the version parameter will be NULL for text declarations. The encoding parameter may be NULL for XML declarations. The standalone parameter will be -1, 0, or 1 indicating respectively that there was no standalone parameter in the declaration, that it was given as no, or that it was given as yes. */ typedef void (*XML_XmlDeclHandler) (void *userData, const XML_Char *version, const XML_Char *encoding, int standalone); XMLPARSEAPI(void) XML_SetXmlDeclHandler(XML_Parser parser, XML_XmlDeclHandler xmldecl); typedef struct { void *(*malloc_fcn)(size_t size); void *(*realloc_fcn)(void *ptr, size_t size); void (*free_fcn)(void *ptr); } XML_Memory_Handling_Suite; /* Constructs a new parser; encoding is the encoding specified by the external protocol or NULL if there is none specified. */ XMLPARSEAPI(XML_Parser) XML_ParserCreate(const XML_Char *encoding); /* Constructs a new parser and namespace processor. Element type names and attribute names that belong to a namespace will be expanded; unprefixed attribute names are never expanded; unprefixed element type names are expanded only if there is a default namespace. The expanded name is the concatenation of the namespace URI, the namespace separator character, and the local part of the name. If the namespace separator is '\0' then the namespace URI and the local part will be concatenated without any separator. When a namespace is not declared, the name and prefix will be passed through without expansion. */ XMLPARSEAPI(XML_Parser) XML_ParserCreateNS(const XML_Char *encoding, XML_Char namespaceSeparator); /* Constructs a new parser using the memory management suite referred to by memsuite. If memsuite is NULL, then use the standard library memory suite. If namespaceSeparator is non-NULL it creates a parser with namespace processing as described above. The character pointed at will serve as the namespace separator. All further memory operations used for the created parser will come from the given suite. */ XMLPARSEAPI(XML_Parser) XML_ParserCreate_MM(const XML_Char *encoding, const XML_Memory_Handling_Suite *memsuite, const XML_Char *namespaceSeparator); /* Prepare a parser object to be re-used. This is particularly valuable when memory allocation overhead is disproportionatly high, such as when a large number of small documnents need to be parsed. All handlers are cleared from the parser, except for the unknownEncodingHandler. The parser's external state is re-initialized except for the values of ns and ns_triplets. Added in Expat 1.95.3. */ XMLPARSEAPI(XML_Bool) XML_ParserReset(XML_Parser parser, const XML_Char *encoding); /* atts is array of name/value pairs, terminated by 0; names and values are 0 terminated. */ typedef void (*XML_StartElementHandler)(void *userData, const XML_Char *name, const XML_Char **atts); typedef void (*XML_EndElementHandler)(void *userData, const XML_Char *name); /* s is not 0 terminated. */ typedef void (*XML_CharacterDataHandler)(void *userData, const XML_Char *s, int len); /* target and data are 0 terminated */ typedef void (*XML_ProcessingInstructionHandler)(void *userData, const XML_Char *target, const XML_Char *data); /* data is 0 terminated */ typedef void (*XML_CommentHandler)(void *userData, const XML_Char *data); typedef void (*XML_StartCdataSectionHandler)(void *userData); typedef void (*XML_EndCdataSectionHandler)(void *userData); /* This is called for any characters in the XML document for which there is no applicable handler. This includes both characters that are part of markup which is of a kind that is not reported (comments, markup declarations), or characters that are part of a construct which could be reported but for which no handler has been supplied. The characters are passed exactly as they were in the XML document except that they will be encoded in UTF-8 or UTF-16. Line boundaries are not normalized. Note that a byte order mark character is not passed to the default handler. There are no guarantees about how characters are divided between calls to the default handler: for example, a comment might be split between multiple calls. */ typedef void (*XML_DefaultHandler)(void *userData, const XML_Char *s, int len); /* This is called for the start of the DOCTYPE declaration, before any DTD or internal subset is parsed. */ typedef void (*XML_StartDoctypeDeclHandler)(void *userData, const XML_Char *doctypeName, const XML_Char *sysid, const XML_Char *pubid, int has_internal_subset); /* This is called for the start of the DOCTYPE declaration when the closing > is encountered, but after processing any external subset. */ typedef void (*XML_EndDoctypeDeclHandler)(void *userData); /* This is called for entity declarations. The is_parameter_entity argument will be non-zero if the entity is a parameter entity, zero otherwise. For internal entities (), value will be non-NULL and systemId, publicID, and notationName will be NULL. The value string is NOT nul-terminated; the length is provided in the value_length argument. Since it is legal to have zero-length values, do not use this argument to test for internal entities. For external entities, value will be NULL and systemId will be non-NULL. The publicId argument will be NULL unless a public identifier was provided. The notationName argument will have a non-NULL value only for unparsed entity declarations. Note that is_parameter_entity can't be changed to XML_Bool, since that would break binary compatibility. */ typedef void (*XML_EntityDeclHandler) (void *userData, const XML_Char *entityName, int is_parameter_entity, const XML_Char *value, int value_length, const XML_Char *base, const XML_Char *systemId, const XML_Char *publicId, const XML_Char *notationName); XMLPARSEAPI(void) XML_SetEntityDeclHandler(XML_Parser parser, XML_EntityDeclHandler handler); /* OBSOLETE -- OBSOLETE -- OBSOLETE This handler has been superceded by the EntityDeclHandler above. It is provided here for backward compatibility. This is called for a declaration of an unparsed (NDATA) entity. The base argument is whatever was set by XML_SetBase. The entityName, systemId and notationName arguments will never be NULL. The other arguments may be. */ typedef 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); /* This is called for a declaration of notation. The base argument is whatever was set by XML_SetBase. The notationName will never be NULL. The other arguments can be. */ typedef void (*XML_NotationDeclHandler)(void *userData, const XML_Char *notationName, const XML_Char *base, const XML_Char *systemId, const XML_Char *publicId); /* When namespace processing is enabled, these are called once for each namespace declaration. The call to the start and end element handlers occur between the calls to the start and end namespace declaration handlers. For an xmlns attribute, prefix will be NULL. For an xmlns="" attribute, uri will be NULL. */ typedef void (*XML_StartNamespaceDeclHandler)(void *userData, const XML_Char *prefix, const XML_Char *uri); typedef void (*XML_EndNamespaceDeclHandler)(void *userData, const XML_Char *prefix); /* This is called if the document is not standalone, that is, it has an external subset or a reference to a parameter entity, but does not have standalone="yes". If this handler returns XML_STATUS_ERROR, then processing will not continue, and the parser will return a XML_ERROR_NOT_STANDALONE error. If parameter entity parsing is enabled, then in addition to the conditions above this handler will only be called if the referenced entity was actually read. */ typedef int (*XML_NotStandaloneHandler)(void *userData); /* This is called for a reference to an external parsed general entity. The referenced entity is not automatically parsed. The application can parse it immediately or later using XML_ExternalEntityParserCreate. The parser argument is the parser parsing the entity containing the reference; it can be passed as the parser argument to XML_ExternalEntityParserCreate. The systemId argument is the system identifier as specified in the entity declaration; it will not be NULL. The base argument is the system identifier that should be used as the base for resolving systemId if systemId was relative; this is set by XML_SetBase; it may be NULL. The publicId argument is the public identifier as specified in the entity declaration, or NULL if none was specified; the whitespace in the public identifier will have been normalized as required by the XML spec. The context argument specifies the parsing context in the format expected by the context argument to XML_ExternalEntityParserCreate; context is valid only until the handler returns, so if the referenced entity is to be parsed later, it must be copied. context is NULL only when the entity is a parameter entity. The handler should return XML_STATUS_ERROR if processing should not continue because of a fatal error in the handling of the external entity. In this case the calling parser will return an XML_ERROR_EXTERNAL_ENTITY_HANDLING error. Note that unlike other handlers the first argument is the parser, not userData. */ typedef int (*XML_ExternalEntityRefHandler)(XML_Parser parser, const XML_Char *context, const XML_Char *base, const XML_Char *systemId, const XML_Char *publicId); /* This is called in two situations: 1) An entity reference is encountered for which no declaration has been read *and* this is not an error. 2) An internal entity reference is read, but not expanded, because XML_SetDefaultHandler has been called. Note: skipped parameter entities in declarations and skipped general entities in attribute values cannot be reported, because the event would be out of sync with the reporting of the declarations or attribute values */ typedef void (*XML_SkippedEntityHandler)(void *userData, const XML_Char *entityName, int is_parameter_entity); /* This structure is filled in by the XML_UnknownEncodingHandler to provide information to the parser about encodings that are unknown to the parser. The map[b] member gives information about byte sequences whose first byte is b. If map[b] is c where c is >= 0, then b by itself encodes the Unicode scalar value c. If map[b] is -1, then the byte sequence is malformed. If map[b] is -n, where n >= 2, then b is the first byte of an n-byte sequence that encodes a single Unicode scalar value. The data member will be passed as the first argument to the convert function. The convert function is used to convert multibyte sequences; s will point to a n-byte sequence where map[(unsigned char)*s] == -n. The convert function must return the Unicode scalar value represented by this byte sequence or -1 if the byte sequence is malformed. The convert function may be NULL if the encoding is a single-byte encoding, that is if map[b] >= -1 for all bytes b. When the parser is finished with the encoding, then if release is not NULL, it will call release passing it the data member; once release has been called, the convert function will not be called again. Expat places certain restrictions on the encodings that are supported using this mechanism. 1. Every ASCII character that can appear in a well-formed XML document, other than the characters $@\^`{}~ must be represented by a single byte, and that byte must be the same byte that represents that character in ASCII. 2. No character may require more than 4 bytes to encode. 3. All characters encoded must have Unicode scalar values <= 0xFFFF, (i.e., characters that would be encoded by surrogates in UTF-16 are not allowed). Note that this restriction doesn't apply to the built-in support for UTF-8 and UTF-16. 4. No Unicode character may be encoded by more than one distinct sequence of bytes. */ typedef struct { int map[256]; void *data; int (*convert)(void *data, const char *s); void (*release)(void *data); } XML_Encoding; /* This is called for an encoding that is unknown to the parser. The encodingHandlerData argument is that which was passed as the second argument to XML_SetUnknownEncodingHandler. The name argument gives the name of the encoding as specified in the encoding declaration. If the callback can provide information about the encoding, it must fill in the XML_Encoding structure, and return XML_STATUS_OK. Otherwise it must return XML_STATUS_ERROR. If info does not describe a suitable encoding, then the parser will return an XML_UNKNOWN_ENCODING error. */ typedef int (*XML_UnknownEncodingHandler)(void *encodingHandlerData, const XML_Char *name, XML_Encoding *info); XMLPARSEAPI(void) XML_SetElementHandler(XML_Parser parser, XML_StartElementHandler start, XML_EndElementHandler end); XMLPARSEAPI(void) XML_SetStartElementHandler(XML_Parser, XML_StartElementHandler); XMLPARSEAPI(void) XML_SetEndElementHandler(XML_Parser, XML_EndElementHandler); XMLPARSEAPI(void) XML_SetCharacterDataHandler(XML_Parser parser, XML_CharacterDataHandler handler); XMLPARSEAPI(void) XML_SetProcessingInstructionHandler(XML_Parser parser, XML_ProcessingInstructionHandler handler); XMLPARSEAPI(void) XML_SetCommentHandler(XML_Parser parser, XML_CommentHandler handler); XMLPARSEAPI(void) XML_SetCdataSectionHandler(XML_Parser parser, XML_StartCdataSectionHandler start, XML_EndCdataSectionHandler end); XMLPARSEAPI(void) XML_SetStartCdataSectionHandler(XML_Parser parser, XML_StartCdataSectionHandler start); XMLPARSEAPI(void) XML_SetEndCdataSectionHandler(XML_Parser parser, XML_EndCdataSectionHandler end); /* This sets the default handler and also inhibits expansion of internal entities. These entity references will be passed to the default handler, or to the skipped entity handler, if one is set. */ XMLPARSEAPI(void) XML_SetDefaultHandler(XML_Parser parser, XML_DefaultHandler handler); /* This sets the default handler but does not inhibit expansion of internal entities. The entity reference will not be passed to the default handler. */ XMLPARSEAPI(void) XML_SetDefaultHandlerExpand(XML_Parser parser, XML_DefaultHandler handler); XMLPARSEAPI(void) XML_SetDoctypeDeclHandler(XML_Parser parser, XML_StartDoctypeDeclHandler start, XML_EndDoctypeDeclHandler end); XMLPARSEAPI(void) XML_SetStartDoctypeDeclHandler(XML_Parser parser, XML_StartDoctypeDeclHandler start); XMLPARSEAPI(void) XML_SetEndDoctypeDeclHandler(XML_Parser parser, XML_EndDoctypeDeclHandler end); XMLPARSEAPI(void) XML_SetUnparsedEntityDeclHandler(XML_Parser parser, XML_UnparsedEntityDeclHandler handler); XMLPARSEAPI(void) XML_SetNotationDeclHandler(XML_Parser parser, XML_NotationDeclHandler handler); XMLPARSEAPI(void) XML_SetNamespaceDeclHandler(XML_Parser parser, XML_StartNamespaceDeclHandler start, XML_EndNamespaceDeclHandler end); XMLPARSEAPI(void) XML_SetStartNamespaceDeclHandler(XML_Parser parser, XML_StartNamespaceDeclHandler start); XMLPARSEAPI(void) XML_SetEndNamespaceDeclHandler(XML_Parser parser, XML_EndNamespaceDeclHandler end); XMLPARSEAPI(void) XML_SetNotStandaloneHandler(XML_Parser parser, XML_NotStandaloneHandler handler); XMLPARSEAPI(void) XML_SetExternalEntityRefHandler(XML_Parser parser, XML_ExternalEntityRefHandler handler); /* If a non-NULL value for arg is specified here, then it will be passed as the first argument to the external entity ref handler instead of the parser object. */ XMLPARSEAPI(void) XML_SetExternalEntityRefHandlerArg(XML_Parser, void *arg); XMLPARSEAPI(void) XML_SetSkippedEntityHandler(XML_Parser parser, XML_SkippedEntityHandler handler); XMLPARSEAPI(void) XML_SetUnknownEncodingHandler(XML_Parser parser, XML_UnknownEncodingHandler handler, void *encodingHandlerData); /* This can be called within a handler for a start element, end element, processing instruction or character data. It causes the corresponding markup to be passed to the default handler. */ XMLPARSEAPI(void) XML_DefaultCurrent(XML_Parser parser); /* If do_nst is non-zero, and namespace processing is in effect, and a name has a prefix (i.e. an explicit namespace qualifier) then that name is returned as a triplet in a single string separated by the separator character specified when the parser was created: URI + sep + local_name + sep + prefix. If do_nst is zero, then namespace information is returned in the default manner (URI + sep + local_name) whether or not the name has a prefix. Note: Calling XML_SetReturnNSTriplet after XML_Parse or XML_ParseBuffer has no effect. */ XMLPARSEAPI(void) XML_SetReturnNSTriplet(XML_Parser parser, int do_nst); /* This value is passed as the userData argument to callbacks. */ XMLPARSEAPI(void) XML_SetUserData(XML_Parser parser, void *userData); /* Returns the last value set by XML_SetUserData or NULL. */ #define XML_GetUserData(parser) (*(void **)(parser)) /* This is equivalent to supplying an encoding argument to XML_ParserCreate. On success XML_SetEncoding returns non-zero, zero otherwise. Note: Calling XML_SetEncoding after XML_Parse or XML_ParseBuffer has no effect and returns XML_STATUS_ERROR. */ XMLPARSEAPI(enum XML_Status) XML_SetEncoding(XML_Parser parser, const XML_Char *encoding); /* If this function is called, then the parser will be passed as the first argument to callbacks instead of userData. The userData will still be accessible using XML_GetUserData. */ XMLPARSEAPI(void) XML_UseParserAsHandlerArg(XML_Parser parser); /* If useDTD == XML_TRUE is passed to this function, then the parser will assume that there is an external subset, even if none is specified in the document. In such a case the parser will call the externalEntityRefHandler with a value of NULL for the systemId argument (the publicId and context arguments will be NULL as well). Note: If this function is called, then this must be done before the first call to XML_Parse or XML_ParseBuffer, since it will have no effect after that. Returns XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING. Note: If the document does not have a DOCTYPE declaration at all, then startDoctypeDeclHandler and endDoctypeDeclHandler will not be called, despite an external subset being parsed. Note: If XML_DTD is not defined when Expat is compiled, returns XML_ERROR_FEATURE_REQUIRES_XML_DTD. */ XMLPARSEAPI(enum XML_Error) XML_UseForeignDTD(XML_Parser parser, XML_Bool useDTD); /* Sets the base to be used for resolving relative URIs in system identifiers in declarations. Resolving relative identifiers is left to the application: this value will be passed through as the base argument to the XML_ExternalEntityRefHandler, XML_NotationDeclHandler and XML_UnparsedEntityDeclHandler. The base argument will be copied. Returns XML_STATUS_ERROR if out of memory, XML_STATUS_OK otherwise. */ XMLPARSEAPI(enum XML_Status) XML_SetBase(XML_Parser parser, const XML_Char *base); XMLPARSEAPI(const XML_Char *) XML_GetBase(XML_Parser parser); /* Returns the number of the attribute/value pairs passed in last call to the XML_StartElementHandler that were specified in the start-tag rather than defaulted. Each attribute/value pair counts as 2; thus this correspondds to an index into the atts array passed to the XML_StartElementHandler. */ XMLPARSEAPI(int) XML_GetSpecifiedAttributeCount(XML_Parser parser); /* Returns the index of the ID attribute passed in the last call to XML_StartElementHandler, or -1 if there is no ID attribute. Each attribute/value pair counts as 2; thus this correspondds to an index into the atts array passed to the XML_StartElementHandler. */ XMLPARSEAPI(int) XML_GetIdAttributeIndex(XML_Parser parser); /* Parses some input. Returns XML_STATUS_ERROR if a fatal error is detected. The last call to XML_Parse must have isFinal true; len may be zero for this call (or any other). The XML_Status enum gives the possible return values for the XML_Parse and XML_ParseBuffer functions. Though the return values for these functions has always been described as a Boolean value, the implementation, at least for the 1.95.x series, has always returned exactly one of these values. The preprocessor #defines are included so this stanza can be added to code that still needs to support older versions of Expat 1.95.x: #ifndef XML_STATUS_OK #define XML_STATUS_OK 1 #define XML_STATUS_ERROR 0 #endif Otherwise, the #define hackery is quite ugly and would have been dropped. */ enum XML_Status { XML_STATUS_ERROR = 0, #define XML_STATUS_ERROR XML_STATUS_ERROR XML_STATUS_OK = 1 #define XML_STATUS_OK XML_STATUS_OK }; XMLPARSEAPI(enum XML_Status) XML_Parse(XML_Parser parser, const char *s, int len, int isFinal); XMLPARSEAPI(void *) XML_GetBuffer(XML_Parser parser, int len); XMLPARSEAPI(enum XML_Status) XML_ParseBuffer(XML_Parser parser, int len, int isFinal); /* Creates an XML_Parser object that can parse an external general entity; context is a '\0'-terminated string specifying the parse context; encoding is a '\0'-terminated string giving the name of the externally specified encoding, or NULL if there is no externally specified encoding. The context string consists of a sequence of tokens separated by formfeeds (\f); a token consisting of a name specifies that the general entity of the name is open; a token of the form prefix=uri specifies the namespace for a particular prefix; a token of the form =uri specifies the default namespace. This can be called at any point after the first call to an ExternalEntityRefHandler so longer as the parser has not yet been freed. The new parser is completely independent and may safely be used in a separate thread. The handlers and userData are initialized from the parser argument. Returns NULL if out of memory. Otherwise returns a new XML_Parser object. */ XMLPARSEAPI(XML_Parser) XML_ExternalEntityParserCreate(XML_Parser parser, const XML_Char *context, const XML_Char *encoding); enum XML_ParamEntityParsing { XML_PARAM_ENTITY_PARSING_NEVER, XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE, XML_PARAM_ENTITY_PARSING_ALWAYS }; /* Controls parsing of parameter entities (including the external DTD subset). If parsing of parameter entities is enabled, then references to external parameter entities (including the external DTD subset) will be passed to the handler set with XML_SetExternalEntityRefHandler. The context passed will be 0. Unlike external general entities, external parameter entities can only be parsed synchronously. If the external parameter entity is to be parsed, it must be parsed during the call to the external entity ref handler: the complete sequence of XML_ExternalEntityParserCreate, XML_Parse/XML_ParseBuffer and XML_ParserFree calls must be made during this call. After XML_ExternalEntityParserCreate has been called to create the parser for the external parameter entity (context must be 0 for this call), it is illegal to make any calls on the old parser until XML_ParserFree has been called on the newly created parser. If the library has been compiled without support for parameter entity parsing (ie without XML_DTD being defined), then XML_SetParamEntityParsing will return 0 if parsing of parameter entities is requested; otherwise it will return non-zero. Note: If XML_SetParamEntityParsing is called after XML_Parse or XML_ParseBuffer, then it has no effect and will always return 0. */ XMLPARSEAPI(int) XML_SetParamEntityParsing(XML_Parser parser, enum XML_ParamEntityParsing parsing); /* If XML_Parse or XML_ParseBuffer have returned XML_STATUS_ERROR, then XML_GetErrorCode returns information about the error. */ XMLPARSEAPI(enum XML_Error) XML_GetErrorCode(XML_Parser parser); /* These functions return information about the current parse location. They may be called from any callback called to report some parse event; in this case the location is the location of the first of the sequence of characters that generated the event. They may also be called after returning from a call to XML_Parse or XML_ParseBuffer. If the return value is XML_STATUS_ERROR then the location is the location of the character at which the error was detected; otherwise the location is the location of the last parse event, as described above. */ XMLPARSEAPI(int) XML_GetCurrentLineNumber(XML_Parser parser); XMLPARSEAPI(int) XML_GetCurrentColumnNumber(XML_Parser parser); XMLPARSEAPI(long) XML_GetCurrentByteIndex(XML_Parser parser); /* Return the number of bytes in the current event. Returns 0 if the event is in an internal entity. */ XMLPARSEAPI(int) XML_GetCurrentByteCount(XML_Parser parser); /* If XML_CONTEXT_BYTES is defined, returns the input buffer, sets the integer pointed to by offset to the offset within this buffer of the current parse position, and sets the integer pointed to by size to the size of this buffer (the number of input bytes). Otherwise returns a NULL pointer. Also returns a NULL pointer if a parse isn't active. NOTE: The character pointer returned should not be used outside the handler that makes the call. */ XMLPARSEAPI(const char *) XML_GetInputContext(XML_Parser parser, int *offset, int *size); /* For backwards compatibility with previous versions. */ #define XML_GetErrorLineNumber XML_GetCurrentLineNumber #define XML_GetErrorColumnNumber XML_GetCurrentColumnNumber #define XML_GetErrorByteIndex XML_GetCurrentByteIndex /* Frees the content model passed to the element declaration handler */ XMLPARSEAPI(void) XML_FreeContentModel(XML_Parser parser, XML_Content *model); /* Exposing the memory handling functions used in Expat */ XMLPARSEAPI(void *) XML_MemMalloc(XML_Parser parser, size_t size); XMLPARSEAPI(void *) XML_MemRealloc(XML_Parser parser, void *ptr, size_t size); XMLPARSEAPI(void) XML_MemFree(XML_Parser parser, void *ptr); /* Frees memory used by the parser. */ XMLPARSEAPI(void) XML_ParserFree(XML_Parser parser); /* Returns a string describing the error. */ XMLPARSEAPI(const XML_LChar *) XML_ErrorString(enum XML_Error code); /* Return a string containing the version number of this expat */ XMLPARSEAPI(const XML_LChar *) XML_ExpatVersion(void); typedef struct { int major; int minor; int micro; } XML_Expat_Version; /* Return an XML_Expat_Version structure containing numeric version number information for this version of expat. */ XMLPARSEAPI(XML_Expat_Version) XML_ExpatVersionInfo(void); /* Added in Expat 1.95.5. */ enum XML_FeatureEnum { XML_FEATURE_END = 0, XML_FEATURE_UNICODE, XML_FEATURE_UNICODE_WCHAR_T, XML_FEATURE_DTD, XML_FEATURE_CONTEXT_BYTES, XML_FEATURE_MIN_SIZE, XML_FEATURE_SIZEOF_XML_CHAR, XML_FEATURE_SIZEOF_XML_LCHAR /* Additional features must be added to the end of this enum. */ }; typedef struct { enum XML_FeatureEnum feature; const XML_LChar *name; long int value; } XML_Feature; XMLPARSEAPI(const XML_Feature *) XML_GetFeatureList(void); /* Expat follows the GNU/Linux convention of odd number minor version for beta/development releases and even number minor version for stable releases. Micro is bumped with each release, and set to 0 with each change to major or minor version. */ #define XML_MAJOR_VERSION 1 #define XML_MINOR_VERSION 95 #define XML_MICRO_VERSION 6 #ifdef __cplusplus } #endif #endif /* not XmlParse_INCLUDED */ php-4.4.8/ext/xml/expat/README.php0000644000175000017500000000043307277024017015777 0ustar derickderickthis is the PHP-bundled version of expat 1.95.1 changes from the original version: - include instead of - include "php_compat.h" for namespace protection - hardcode version in xmlparse.c - stripped off all unneded files thies@thieso.net, 11th May, 2001 php-4.4.8/ext/xml/expat/xmltok_ns.c0000644000175000017500000000563007706723611016522 0ustar derickderick#include "php_compat.h" const ENCODING * NS(XmlGetUtf8InternalEncoding)(void) { return &ns(internal_utf8_encoding).enc; } const ENCODING * NS(XmlGetUtf16InternalEncoding)(void) { #if BYTEORDER == 1234 return &ns(internal_little2_encoding).enc; #elif BYTEORDER == 4321 return &ns(internal_big2_encoding).enc; #else const short n = 1; return (*(const char *)&n ? &ns(internal_little2_encoding).enc : &ns(internal_big2_encoding).enc); #endif } static const ENCODING *NS(encodings)[] = { &ns(latin1_encoding).enc, &ns(ascii_encoding).enc, &ns(utf8_encoding).enc, &ns(big2_encoding).enc, &ns(big2_encoding).enc, &ns(little2_encoding).enc, &ns(utf8_encoding).enc /* NO_ENC */ }; static int PTRCALL NS(initScanProlog)(const ENCODING *enc, const char *ptr, const char *end, const char **nextTokPtr) { return initScan(NS(encodings), (const INIT_ENCODING *)enc, XML_PROLOG_STATE, ptr, end, nextTokPtr); } static int PTRCALL NS(initScanContent)(const ENCODING *enc, const char *ptr, const char *end, const char **nextTokPtr) { return initScan(NS(encodings), (const INIT_ENCODING *)enc, XML_CONTENT_STATE, ptr, end, nextTokPtr); } int NS(XmlInitEncoding)(INIT_ENCODING *p, const ENCODING **encPtr, const char *name) { int i = getEncodingIndex(name); if (i == UNKNOWN_ENC) return 0; SET_INIT_ENC_INDEX(p, i); p->initEnc.scanners[XML_PROLOG_STATE] = NS(initScanProlog); p->initEnc.scanners[XML_CONTENT_STATE] = NS(initScanContent); p->initEnc.updatePosition = initUpdatePosition; p->encPtr = encPtr; *encPtr = &(p->initEnc); return 1; } static const ENCODING * NS(findEncoding)(const ENCODING *enc, const char *ptr, const char *end) { #define ENCODING_MAX 128 char buf[ENCODING_MAX]; char *p = buf; int i; XmlUtf8Convert(enc, &ptr, end, &p, p + ENCODING_MAX - 1); if (ptr != end) return 0; *p = 0; if (streqci(buf, KW_UTF_16) && enc->minBytesPerChar == 2) return enc; i = getEncodingIndex(buf); if (i == UNKNOWN_ENC) return 0; return NS(encodings)[i]; } int NS(XmlParseXmlDecl)(int isGeneralTextEntity, const ENCODING *enc, const char *ptr, const char *end, const char **badPtr, const char **versionPtr, const char **versionEndPtr, const char **encodingName, const ENCODING **encoding, int *standalone) { return doParseXmlDecl(NS(findEncoding), isGeneralTextEntity, enc, ptr, end, badPtr, versionPtr, versionEndPtr, encodingName, encoding, standalone); } php-4.4.8/ext/xml/expat/xmlparse.c0000644000175000017500000052120607710212053016325 0ustar derickderick/* Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd See the file COPYING for copying permission. */ #include "php_compat.h" #include #include /* memset(), memcpy() */ #ifdef COMPILED_FROM_DSP #include "winconfig.h" #define XMLPARSEAPI(type) __declspec(dllexport) type __cdecl #include "expat.h" #undef XMLPARSEAPI #elif defined(MACOS_CLASSIC) #include "macconfig.h" #include "expat.h" #else #include #ifdef __declspec #define XMLPARSEAPI(type) type __cdecl #endif #include "expat.h" #ifdef __declspec #undef XMLPARSEAPI #endif #endif /* ndef COMPILED_FROM_DSP */ #ifdef XML_UNICODE #define XML_ENCODE_MAX XML_UTF16_ENCODE_MAX #define XmlConvert XmlUtf16Convert #define XmlGetInternalEncoding XmlGetUtf16InternalEncoding #define XmlGetInternalEncodingNS XmlGetUtf16InternalEncodingNS #define XmlEncode XmlUtf16Encode #define MUST_CONVERT(enc, s) (!(enc)->isUtf16 || (((unsigned long)s) & 1)) typedef unsigned short ICHAR; #else #define XML_ENCODE_MAX XML_UTF8_ENCODE_MAX #define XmlConvert XmlUtf8Convert #define XmlGetInternalEncoding XmlGetUtf8InternalEncoding #define XmlGetInternalEncodingNS XmlGetUtf8InternalEncodingNS #define XmlEncode XmlUtf8Encode #define MUST_CONVERT(enc, s) (!(enc)->isUtf8) typedef char ICHAR; #endif #ifndef XML_NS #define XmlInitEncodingNS XmlInitEncoding #define XmlInitUnknownEncodingNS XmlInitUnknownEncoding #undef XmlGetInternalEncodingNS #define XmlGetInternalEncodingNS XmlGetInternalEncoding #define XmlParseXmlDeclNS XmlParseXmlDecl #endif #ifdef XML_UNICODE #ifdef XML_UNICODE_WCHAR_T #define XML_T(x) (const wchar_t)x #define XML_L(x) L ## x #else #define XML_T(x) (const unsigned short)x #define XML_L(x) x #endif #else #define XML_T(x) x #define XML_L(x) x #endif /* Round up n to be a multiple of sz, where sz is a power of 2. */ #define ROUND_UP(n, sz) (((n) + ((sz) - 1)) & ~((sz) - 1)) /* Handle the case where memmove() doesn't exist. */ #ifndef HAVE_MEMMOVE #ifdef HAVE_BCOPY #define memmove(d,s,l) bcopy((s),(d),(l)) #else #error memmove does not exist on this platform, nor is a substitute available #endif /* HAVE_BCOPY */ #endif /* HAVE_MEMMOVE */ #include "internal.h" #include "xmltok.h" #include "xmlrole.h" typedef const XML_Char *KEY; typedef struct { KEY name; } NAMED; typedef struct { NAMED **v; size_t size; size_t used; size_t usedLim; const XML_Memory_Handling_Suite *mem; } HASH_TABLE; typedef struct { NAMED **p; NAMED **end; } HASH_TABLE_ITER; #define INIT_TAG_BUF_SIZE 32 /* must be a multiple of sizeof(XML_Char) */ #define INIT_DATA_BUF_SIZE 1024 #define INIT_ATTS_SIZE 16 #define INIT_BLOCK_SIZE 1024 #define INIT_BUFFER_SIZE 1024 #define EXPAND_SPARE 24 typedef struct binding { struct prefix *prefix; struct binding *nextTagBinding; struct binding *prevPrefixBinding; const struct attribute_id *attId; XML_Char *uri; int uriLen; int uriAlloc; } BINDING; typedef struct prefix { const XML_Char *name; BINDING *binding; } PREFIX; typedef struct { const XML_Char *str; const XML_Char *localPart; const XML_Char *prefix; int strLen; int uriLen; int prefixLen; } TAG_NAME; /* TAG represents an open element. The name of the element is stored in both the document and API encodings. The memory buffer 'buf' is a separately-allocated memory area which stores the name. During the XML_Parse()/ XMLParseBuffer() when the element is open, the memory for the 'raw' version of the name (in the document encoding) is shared with the document buffer. If the element is open across calls to XML_Parse()/XML_ParseBuffer(), the buffer is re-allocated to contain the 'raw' name as well. A parser re-uses these structures, maintaining a list of allocated TAG objects in a free list. */ typedef struct tag { struct tag *parent; /* parent of this element */ const char *rawName; /* tagName in the original encoding */ int rawNameLength; TAG_NAME name; /* tagName in the API encoding */ char *buf; /* buffer for name components */ char *bufEnd; /* end of the buffer */ BINDING *bindings; } TAG; typedef struct { const XML_Char *name; const XML_Char *textPtr; int textLen; const XML_Char *systemId; const XML_Char *base; const XML_Char *publicId; const XML_Char *notation; XML_Bool open; XML_Bool is_param; XML_Bool is_internal; /* true if declared in internal subset outside PE */ } ENTITY; typedef struct { enum XML_Content_Type type; enum XML_Content_Quant quant; const XML_Char * name; int firstchild; int lastchild; int childcnt; int nextsib; } CONTENT_SCAFFOLD; #define INIT_SCAFFOLD_ELEMENTS 32 typedef struct block { struct block *next; int size; XML_Char s[1]; } BLOCK; typedef struct { BLOCK *blocks; BLOCK *freeBlocks; const XML_Char *end; XML_Char *ptr; XML_Char *start; const XML_Memory_Handling_Suite *mem; } STRING_POOL; /* The XML_Char before the name is used to determine whether an attribute has been specified. */ typedef struct attribute_id { XML_Char *name; PREFIX *prefix; XML_Bool maybeTokenized; XML_Bool xmlns; } ATTRIBUTE_ID; typedef struct { const ATTRIBUTE_ID *id; XML_Bool isCdata; const XML_Char *value; } DEFAULT_ATTRIBUTE; typedef struct { const XML_Char *name; PREFIX *prefix; const ATTRIBUTE_ID *idAtt; int nDefaultAtts; int allocDefaultAtts; DEFAULT_ATTRIBUTE *defaultAtts; } ELEMENT_TYPE; typedef struct { HASH_TABLE generalEntities; HASH_TABLE elementTypes; HASH_TABLE attributeIds; HASH_TABLE prefixes; STRING_POOL pool; STRING_POOL entityValuePool; /* false once a parameter entity reference has been skipped */ XML_Bool keepProcessing; /* true once an internal or external PE reference has been encountered; this includes the reference to an external subset */ XML_Bool hasParamEntityRefs; XML_Bool standalone; #ifdef XML_DTD /* indicates if external PE has been read */ XML_Bool paramEntityRead; HASH_TABLE paramEntities; #endif /* XML_DTD */ PREFIX defaultPrefix; /* === scaffolding for building content model === */ XML_Bool in_eldecl; CONTENT_SCAFFOLD *scaffold; unsigned contentStringLen; unsigned scaffSize; unsigned scaffCount; int scaffLevel; int *scaffIndex; } DTD; typedef struct open_internal_entity { const char *internalEventPtr; const char *internalEventEndPtr; struct open_internal_entity *next; ENTITY *entity; } OPEN_INTERNAL_ENTITY; typedef enum XML_Error PTRCALL Processor(XML_Parser parser, const char *start, const char *end, const char **endPtr); static Processor prologProcessor; static Processor prologInitProcessor; static Processor contentProcessor; static Processor cdataSectionProcessor; #ifdef XML_DTD static Processor ignoreSectionProcessor; static Processor externalParEntProcessor; static Processor externalParEntInitProcessor; static Processor entityValueProcessor; static Processor entityValueInitProcessor; #endif /* XML_DTD */ static Processor epilogProcessor; static Processor errorProcessor; static Processor externalEntityInitProcessor; static Processor externalEntityInitProcessor2; static Processor externalEntityInitProcessor3; static Processor externalEntityContentProcessor; static enum XML_Error handleUnknownEncoding(XML_Parser parser, const XML_Char *encodingName); static enum XML_Error processXmlDecl(XML_Parser parser, int isGeneralTextEntity, const char *, const char *); static enum XML_Error initializeEncoding(XML_Parser parser); static enum XML_Error doProlog(XML_Parser parser, const ENCODING *enc, const char *s, const char *end, int tok, const char *next, const char **nextPtr); static enum XML_Error processInternalParamEntity(XML_Parser parser, ENTITY *entity); static enum XML_Error doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc, const char *start, const char *end, const char **endPtr); static enum XML_Error doCdataSection(XML_Parser parser, const ENCODING *, const char **startPtr, const char *end, const char **nextPtr); #ifdef XML_DTD static enum XML_Error doIgnoreSection(XML_Parser parser, const ENCODING *, const char **startPtr, const char *end, const char **nextPtr); #endif /* XML_DTD */ static enum XML_Error storeAtts(XML_Parser parser, const ENCODING *, const char *s, TAG_NAME *tagNamePtr, BINDING **bindingsPtr); static enum XML_Error addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId, const XML_Char *uri, BINDING **bindingsPtr); static int defineAttribute(ELEMENT_TYPE *type, ATTRIBUTE_ID *, XML_Bool isCdata, XML_Bool isId, const XML_Char *dfltValue, XML_Parser parser); static enum XML_Error storeAttributeValue(XML_Parser parser, const ENCODING *, XML_Bool isCdata, const char *, const char *, STRING_POOL *); static enum XML_Error appendAttributeValue(XML_Parser parser, const ENCODING *, XML_Bool isCdata, const char *, const char *, STRING_POOL *); static ATTRIBUTE_ID * getAttributeId(XML_Parser parser, const ENCODING *enc, const char *start, const char *end); static int setElementTypePrefix(XML_Parser parser, ELEMENT_TYPE *); static enum XML_Error storeEntityValue(XML_Parser parser, const ENCODING *enc, const char *start, const char *end); static int reportProcessingInstruction(XML_Parser parser, const ENCODING *enc, const char *start, const char *end); static int reportComment(XML_Parser parser, const ENCODING *enc, const char *start, const char *end); static void reportDefault(XML_Parser parser, const ENCODING *enc, const char *start, const char *end); static const XML_Char * getContext(XML_Parser parser); static XML_Bool setContext(XML_Parser parser, const XML_Char *context); static void FASTCALL normalizePublicId(XML_Char *s); static DTD * dtdCreate(const XML_Memory_Handling_Suite *ms); /* do not call if parentParser != NULL */ static void dtdReset(DTD *p, const XML_Memory_Handling_Suite *ms); static void dtdDestroy(DTD *p, XML_Bool isDocEntity, const XML_Memory_Handling_Suite *ms); static int dtdCopy(DTD *newDtd, const DTD *oldDtd, const XML_Memory_Handling_Suite *ms); static int copyEntityTable(HASH_TABLE *, STRING_POOL *, const HASH_TABLE *); static NAMED * lookup(HASH_TABLE *table, KEY name, size_t createSize); static void FASTCALL hashTableInit(HASH_TABLE *, const XML_Memory_Handling_Suite *ms); static void FASTCALL hashTableClear(HASH_TABLE *); static void FASTCALL hashTableDestroy(HASH_TABLE *); static void FASTCALL hashTableIterInit(HASH_TABLE_ITER *, const HASH_TABLE *); static NAMED * FASTCALL hashTableIterNext(HASH_TABLE_ITER *); static void FASTCALL poolInit(STRING_POOL *, const XML_Memory_Handling_Suite *ms); static void FASTCALL poolClear(STRING_POOL *); static void FASTCALL poolDestroy(STRING_POOL *); static XML_Char * poolAppend(STRING_POOL *pool, const ENCODING *enc, const char *ptr, const char *end); static XML_Char * poolStoreString(STRING_POOL *pool, const ENCODING *enc, const char *ptr, const char *end); static XML_Bool FASTCALL poolGrow(STRING_POOL *pool); static const XML_Char * FASTCALL poolCopyString(STRING_POOL *pool, const XML_Char *s); static const XML_Char * poolCopyStringN(STRING_POOL *pool, const XML_Char *s, int n); static const XML_Char * FASTCALL poolAppendString(STRING_POOL *pool, const XML_Char *s); static int FASTCALL nextScaffoldPart(XML_Parser parser); static XML_Content * build_model(XML_Parser parser); static ELEMENT_TYPE * getElementType(XML_Parser parser, const ENCODING *enc, const char *ptr, const char *end); static XML_Parser parserCreate(const XML_Char *encodingName, const XML_Memory_Handling_Suite *memsuite, const XML_Char *nameSep, DTD *dtd); static void parserInit(XML_Parser parser, const XML_Char *encodingName); #define poolStart(pool) ((pool)->start) #define poolEnd(pool) ((pool)->ptr) #define poolLength(pool) ((pool)->ptr - (pool)->start) #define poolChop(pool) ((void)--(pool->ptr)) #define poolLastChar(pool) (((pool)->ptr)[-1]) #define poolDiscard(pool) ((pool)->ptr = (pool)->start) #define poolFinish(pool) ((pool)->start = (pool)->ptr) #define poolAppendChar(pool, c) \ (((pool)->ptr == (pool)->end && !poolGrow(pool)) \ ? 0 \ : ((*((pool)->ptr)++ = c), 1)) struct XML_ParserStruct { /* The first member must be userData so that the XML_GetUserData macro works. */ void *m_userData; void *m_handlerArg; char *m_buffer; const XML_Memory_Handling_Suite m_mem; /* first character to be parsed */ const char *m_bufferPtr; /* past last character to be parsed */ char *m_bufferEnd; /* allocated end of buffer */ const char *m_bufferLim; long m_parseEndByteIndex; const char *m_parseEndPtr; XML_Char *m_dataBuf; XML_Char *m_dataBufEnd; XML_StartElementHandler m_startElementHandler; XML_EndElementHandler m_endElementHandler; XML_CharacterDataHandler m_characterDataHandler; XML_ProcessingInstructionHandler m_processingInstructionHandler; XML_CommentHandler m_commentHandler; XML_StartCdataSectionHandler m_startCdataSectionHandler; XML_EndCdataSectionHandler m_endCdataSectionHandler; XML_DefaultHandler m_defaultHandler; XML_StartDoctypeDeclHandler m_startDoctypeDeclHandler; XML_EndDoctypeDeclHandler m_endDoctypeDeclHandler; XML_UnparsedEntityDeclHandler m_unparsedEntityDeclHandler; XML_NotationDeclHandler m_notationDeclHandler; XML_StartNamespaceDeclHandler m_startNamespaceDeclHandler; XML_EndNamespaceDeclHandler m_endNamespaceDeclHandler; XML_NotStandaloneHandler m_notStandaloneHandler; XML_ExternalEntityRefHandler m_externalEntityRefHandler; XML_Parser m_externalEntityRefHandlerArg; XML_SkippedEntityHandler m_skippedEntityHandler; XML_UnknownEncodingHandler m_unknownEncodingHandler; XML_ElementDeclHandler m_elementDeclHandler; XML_AttlistDeclHandler m_attlistDeclHandler; XML_EntityDeclHandler m_entityDeclHandler; XML_XmlDeclHandler m_xmlDeclHandler; const ENCODING *m_encoding; INIT_ENCODING m_initEncoding; const ENCODING *m_internalEncoding; const XML_Char *m_protocolEncodingName; XML_Bool m_ns; XML_Bool m_ns_triplets; void *m_unknownEncodingMem; void *m_unknownEncodingData; void *m_unknownEncodingHandlerData; void (*m_unknownEncodingRelease)(void *); PROLOG_STATE m_prologState; Processor *m_processor; enum XML_Error m_errorCode; const char *m_eventPtr; const char *m_eventEndPtr; const char *m_positionPtr; OPEN_INTERNAL_ENTITY *m_openInternalEntities; XML_Bool m_defaultExpandInternalEntities; int m_tagLevel; ENTITY *m_declEntity; const XML_Char *m_doctypeName; const XML_Char *m_doctypeSysid; const XML_Char *m_doctypePubid; const XML_Char *m_declAttributeType; const XML_Char *m_declNotationName; const XML_Char *m_declNotationPublicId; ELEMENT_TYPE *m_declElementType; ATTRIBUTE_ID *m_declAttributeId; XML_Bool m_declAttributeIsCdata; XML_Bool m_declAttributeIsId; DTD *m_dtd; const XML_Char *m_curBase; TAG *m_tagStack; TAG *m_freeTagList; BINDING *m_inheritedBindings; BINDING *m_freeBindingList; int m_attsSize; int m_nSpecifiedAtts; int m_idAttIndex; ATTRIBUTE *m_atts; POSITION m_position; STRING_POOL m_tempPool; STRING_POOL m_temp2Pool; char *m_groupConnector; unsigned m_groupSize; XML_Char m_namespaceSeparator; XML_Parser m_parentParser; #ifdef XML_DTD XML_Bool m_isParamEntity; XML_Bool m_useForeignDTD; enum XML_ParamEntityParsing m_paramEntityParsing; #endif }; #define MALLOC(s) (parser->m_mem.malloc_fcn((s))) #define REALLOC(p,s) (parser->m_mem.realloc_fcn((p),(s))) #define FREE(p) (parser->m_mem.free_fcn((p))) #define userData (parser->m_userData) #define handlerArg (parser->m_handlerArg) #define startElementHandler (parser->m_startElementHandler) #define endElementHandler (parser->m_endElementHandler) #define characterDataHandler (parser->m_characterDataHandler) #define processingInstructionHandler \ (parser->m_processingInstructionHandler) #define commentHandler (parser->m_commentHandler) #define startCdataSectionHandler \ (parser->m_startCdataSectionHandler) #define endCdataSectionHandler (parser->m_endCdataSectionHandler) #define defaultHandler (parser->m_defaultHandler) #define startDoctypeDeclHandler (parser->m_startDoctypeDeclHandler) #define endDoctypeDeclHandler (parser->m_endDoctypeDeclHandler) #define unparsedEntityDeclHandler \ (parser->m_unparsedEntityDeclHandler) #define notationDeclHandler (parser->m_notationDeclHandler) #define startNamespaceDeclHandler \ (parser->m_startNamespaceDeclHandler) #define endNamespaceDeclHandler (parser->m_endNamespaceDeclHandler) #define notStandaloneHandler (parser->m_notStandaloneHandler) #define externalEntityRefHandler \ (parser->m_externalEntityRefHandler) #define externalEntityRefHandlerArg \ (parser->m_externalEntityRefHandlerArg) #define internalEntityRefHandler \ (parser->m_internalEntityRefHandler) #define skippedEntityHandler (parser->m_skippedEntityHandler) #define unknownEncodingHandler (parser->m_unknownEncodingHandler) #define elementDeclHandler (parser->m_elementDeclHandler) #define attlistDeclHandler (parser->m_attlistDeclHandler) #define entityDeclHandler (parser->m_entityDeclHandler) #define xmlDeclHandler (parser->m_xmlDeclHandler) #define encoding (parser->m_encoding) #define initEncoding (parser->m_initEncoding) #define internalEncoding (parser->m_internalEncoding) #define unknownEncodingMem (parser->m_unknownEncodingMem) #define unknownEncodingData (parser->m_unknownEncodingData) #define unknownEncodingHandlerData \ (parser->m_unknownEncodingHandlerData) #define unknownEncodingRelease (parser->m_unknownEncodingRelease) #define protocolEncodingName (parser->m_protocolEncodingName) #define ns (parser->m_ns) #define ns_triplets (parser->m_ns_triplets) #define prologState (parser->m_prologState) #define processor (parser->m_processor) #define errorCode (parser->m_errorCode) #define eventPtr (parser->m_eventPtr) #define eventEndPtr (parser->m_eventEndPtr) #define positionPtr (parser->m_positionPtr) #define position (parser->m_position) #define openInternalEntities (parser->m_openInternalEntities) #define defaultExpandInternalEntities \ (parser->m_defaultExpandInternalEntities) #define tagLevel (parser->m_tagLevel) #define buffer (parser->m_buffer) #define bufferPtr (parser->m_bufferPtr) #define bufferEnd (parser->m_bufferEnd) #define parseEndByteIndex (parser->m_parseEndByteIndex) #define parseEndPtr (parser->m_parseEndPtr) #define bufferLim (parser->m_bufferLim) #define dataBuf (parser->m_dataBuf) #define dataBufEnd (parser->m_dataBufEnd) #define _dtd (parser->m_dtd) #define curBase (parser->m_curBase) #define declEntity (parser->m_declEntity) #define doctypeName (parser->m_doctypeName) #define doctypeSysid (parser->m_doctypeSysid) #define doctypePubid (parser->m_doctypePubid) #define declAttributeType (parser->m_declAttributeType) #define declNotationName (parser->m_declNotationName) #define declNotationPublicId (parser->m_declNotationPublicId) #define declElementType (parser->m_declElementType) #define declAttributeId (parser->m_declAttributeId) #define declAttributeIsCdata (parser->m_declAttributeIsCdata) #define declAttributeIsId (parser->m_declAttributeIsId) #define freeTagList (parser->m_freeTagList) #define freeBindingList (parser->m_freeBindingList) #define inheritedBindings (parser->m_inheritedBindings) #define tagStack (parser->m_tagStack) #define atts (parser->m_atts) #define attsSize (parser->m_attsSize) #define nSpecifiedAtts (parser->m_nSpecifiedAtts) #define idAttIndex (parser->m_idAttIndex) #define tempPool (parser->m_tempPool) #define temp2Pool (parser->m_temp2Pool) #define groupConnector (parser->m_groupConnector) #define groupSize (parser->m_groupSize) #define namespaceSeparator (parser->m_namespaceSeparator) #define parentParser (parser->m_parentParser) #ifdef XML_DTD #define isParamEntity (parser->m_isParamEntity) #define useForeignDTD (parser->m_useForeignDTD) #define paramEntityParsing (parser->m_paramEntityParsing) #endif /* XML_DTD */ #define parsing \ (parentParser \ ? \ (isParamEntity \ ? \ (processor != externalParEntInitProcessor) \ : \ (processor != externalEntityInitProcessor)) \ : \ (processor != prologInitProcessor)) XML_Parser XML_ParserCreate(const XML_Char *encodingName) { return XML_ParserCreate_MM(encodingName, NULL, NULL); } XML_Parser XML_ParserCreateNS(const XML_Char *encodingName, XML_Char nsSep) { XML_Char tmp[2]; *tmp = nsSep; return XML_ParserCreate_MM(encodingName, NULL, tmp); } static const XML_Char implicitContext[] = { 'x', 'm', 'l', '=', 'h', 't', 't', 'p', ':', '/', '/', 'w', 'w', 'w', '.', 'w', '3', '.', 'o', 'r', 'g', '/', 'X', 'M', 'L', '/', '1', '9', '9', '8', '/', 'n', 'a', 'm', 'e', 's', 'p', 'a', 'c', 'e', '\0' }; XML_Parser XML_ParserCreate_MM(const XML_Char *encodingName, const XML_Memory_Handling_Suite *memsuite, const XML_Char *nameSep) { XML_Parser parser = parserCreate(encodingName, memsuite, nameSep, NULL); if (parser != NULL && ns) { /* implicit context only set for root parser, since child parsers (i.e. external entity parsers) will inherit it */ if (!setContext(parser, implicitContext)) { XML_ParserFree(parser); return NULL; } } return parser; } static XML_Parser parserCreate(const XML_Char *encodingName, const XML_Memory_Handling_Suite *memsuite, const XML_Char *nameSep, DTD *dtd) { XML_Parser parser; if (memsuite) { XML_Memory_Handling_Suite *mtemp; parser = (XML_Parser) memsuite->malloc_fcn(sizeof(struct XML_ParserStruct)); if (parser != NULL) { mtemp = (XML_Memory_Handling_Suite *)&(parser->m_mem); mtemp->malloc_fcn = memsuite->malloc_fcn; mtemp->realloc_fcn = memsuite->realloc_fcn; mtemp->free_fcn = memsuite->free_fcn; } } else { XML_Memory_Handling_Suite *mtemp; parser = (XML_Parser)malloc(sizeof(struct XML_ParserStruct)); if (parser != NULL) { mtemp = (XML_Memory_Handling_Suite *)&(parser->m_mem); mtemp->malloc_fcn = malloc; mtemp->realloc_fcn = realloc; mtemp->free_fcn = free; } } if (!parser) return parser; buffer = NULL; bufferLim = NULL; attsSize = INIT_ATTS_SIZE; atts = (ATTRIBUTE *)MALLOC(attsSize * sizeof(ATTRIBUTE)); if (atts == NULL) { FREE(parser); return NULL; } dataBuf = (XML_Char *)MALLOC(INIT_DATA_BUF_SIZE * sizeof(XML_Char)); if (dataBuf == NULL) { FREE(atts); FREE(parser); return NULL; } dataBufEnd = dataBuf + INIT_DATA_BUF_SIZE; if (dtd) _dtd = dtd; else { _dtd = dtdCreate(&parser->m_mem); if (_dtd == NULL) { FREE(dataBuf); FREE(atts); FREE(parser); return NULL; } } freeBindingList = NULL; freeTagList = NULL; groupSize = 0; groupConnector = NULL; unknownEncodingHandler = NULL; unknownEncodingHandlerData = NULL; namespaceSeparator = '!'; ns = XML_FALSE; ns_triplets = XML_FALSE; poolInit(&tempPool, &(parser->m_mem)); poolInit(&temp2Pool, &(parser->m_mem)); parserInit(parser, encodingName); if (encodingName && !protocolEncodingName) { XML_ParserFree(parser); return NULL; } if (nameSep) { ns = XML_TRUE; internalEncoding = XmlGetInternalEncodingNS(); namespaceSeparator = *nameSep; } else { internalEncoding = XmlGetInternalEncoding(); } return parser; } static void parserInit(XML_Parser parser, const XML_Char *encodingName) { processor = prologInitProcessor; XmlPrologStateInit(&prologState); protocolEncodingName = (encodingName != NULL ? poolCopyString(&tempPool, encodingName) : NULL); curBase = NULL; XmlInitEncoding(&initEncoding, &encoding, 0); userData = NULL; handlerArg = NULL; startElementHandler = NULL; endElementHandler = NULL; characterDataHandler = NULL; processingInstructionHandler = NULL; commentHandler = NULL; startCdataSectionHandler = NULL; endCdataSectionHandler = NULL; defaultHandler = NULL; startDoctypeDeclHandler = NULL; endDoctypeDeclHandler = NULL; unparsedEntityDeclHandler = NULL; notationDeclHandler = NULL; startNamespaceDeclHandler = NULL; endNamespaceDeclHandler = NULL; notStandaloneHandler = NULL; externalEntityRefHandler = NULL; externalEntityRefHandlerArg = parser; skippedEntityHandler = NULL; elementDeclHandler = NULL; attlistDeclHandler = NULL; entityDeclHandler = NULL; xmlDeclHandler = NULL; bufferPtr = buffer; bufferEnd = buffer; parseEndByteIndex = 0; parseEndPtr = NULL; declElementType = NULL; declAttributeId = NULL; declEntity = NULL; doctypeName = NULL; doctypeSysid = NULL; doctypePubid = NULL; declAttributeType = NULL; declNotationName = NULL; declNotationPublicId = NULL; declAttributeIsCdata = XML_FALSE; declAttributeIsId = XML_FALSE; memset(&position, 0, sizeof(POSITION)); errorCode = XML_ERROR_NONE; eventPtr = NULL; eventEndPtr = NULL; positionPtr = NULL; openInternalEntities = 0; defaultExpandInternalEntities = XML_TRUE; tagLevel = 0; tagStack = NULL; inheritedBindings = NULL; nSpecifiedAtts = 0; unknownEncodingMem = NULL; unknownEncodingRelease = NULL; unknownEncodingData = NULL; parentParser = NULL; #ifdef XML_DTD isParamEntity = XML_FALSE; useForeignDTD = XML_FALSE; paramEntityParsing = XML_PARAM_ENTITY_PARSING_NEVER; #endif } /* moves list of bindings to freeBindingList */ static void FASTCALL moveToFreeBindingList(XML_Parser parser, BINDING *bindings) { while (bindings) { BINDING *b = bindings; bindings = bindings->nextTagBinding; b->nextTagBinding = freeBindingList; freeBindingList = b; } } XML_Bool XML_ParserReset(XML_Parser parser, const XML_Char *encodingName) { TAG *tStk; if (parentParser) return XML_FALSE; /* move tagStack to freeTagList */ tStk = tagStack; while (tStk) { TAG *tag = tStk; tStk = tStk->parent; tag->parent = freeTagList; moveToFreeBindingList(parser, tag->bindings); tag->bindings = NULL; freeTagList = tag; } moveToFreeBindingList(parser, inheritedBindings); if (unknownEncodingMem) FREE(unknownEncodingMem); if (unknownEncodingRelease) unknownEncodingRelease(unknownEncodingData); poolClear(&tempPool); poolClear(&temp2Pool); parserInit(parser, encodingName); dtdReset(_dtd, &parser->m_mem); return setContext(parser, implicitContext); } enum XML_Status XML_SetEncoding(XML_Parser parser, const XML_Char *encodingName) { /* Block after XML_Parse()/XML_ParseBuffer() has been called. XXX There's no way for the caller to determine which of the XXX possible error cases caused the XML_STATUS_ERROR return. */ if (parsing) return XML_STATUS_ERROR; if (encodingName == NULL) protocolEncodingName = NULL; else { protocolEncodingName = poolCopyString(&tempPool, encodingName); if (!protocolEncodingName) return XML_STATUS_ERROR; } return XML_STATUS_OK; } XML_Parser XML_ExternalEntityParserCreate(XML_Parser oldParser, const XML_Char *context, const XML_Char *encodingName) { XML_Parser parser = oldParser; DTD *newDtd = NULL; DTD *oldDtd = _dtd; XML_StartElementHandler oldStartElementHandler = startElementHandler; XML_EndElementHandler oldEndElementHandler = endElementHandler; XML_CharacterDataHandler oldCharacterDataHandler = characterDataHandler; XML_ProcessingInstructionHandler oldProcessingInstructionHandler = processingInstructionHandler; XML_CommentHandler oldCommentHandler = commentHandler; XML_StartCdataSectionHandler oldStartCdataSectionHandler = startCdataSectionHandler; XML_EndCdataSectionHandler oldEndCdataSectionHandler = endCdataSectionHandler; XML_DefaultHandler oldDefaultHandler = defaultHandler; XML_UnparsedEntityDeclHandler oldUnparsedEntityDeclHandler = unparsedEntityDeclHandler; XML_NotationDeclHandler oldNotationDeclHandler = notationDeclHandler; XML_StartNamespaceDeclHandler oldStartNamespaceDeclHandler = startNamespaceDeclHandler; XML_EndNamespaceDeclHandler oldEndNamespaceDeclHandler = endNamespaceDeclHandler; XML_NotStandaloneHandler oldNotStandaloneHandler = notStandaloneHandler; XML_ExternalEntityRefHandler oldExternalEntityRefHandler = externalEntityRefHandler; XML_SkippedEntityHandler oldSkippedEntityHandler = skippedEntityHandler; XML_UnknownEncodingHandler oldUnknownEncodingHandler = unknownEncodingHandler; XML_ElementDeclHandler oldElementDeclHandler = elementDeclHandler; XML_AttlistDeclHandler oldAttlistDeclHandler = attlistDeclHandler; XML_EntityDeclHandler oldEntityDeclHandler = entityDeclHandler; XML_XmlDeclHandler oldXmlDeclHandler = xmlDeclHandler; ELEMENT_TYPE * oldDeclElementType = declElementType; void *oldUserData = userData; void *oldHandlerArg = handlerArg; XML_Bool oldDefaultExpandInternalEntities = defaultExpandInternalEntities; XML_Parser oldExternalEntityRefHandlerArg = externalEntityRefHandlerArg; #ifdef XML_DTD enum XML_ParamEntityParsing oldParamEntityParsing = paramEntityParsing; int oldInEntityValue = prologState.inEntityValue; #endif XML_Bool oldns_triplets = ns_triplets; #ifdef XML_DTD if (!context) newDtd = oldDtd; #endif /* XML_DTD */ /* Note that the magical uses of the pre-processor to make field access look more like C++ require that `parser' be overwritten here. This makes this function more painful to follow than it would be otherwise. */ if (ns) { XML_Char tmp[2]; *tmp = namespaceSeparator; parser = parserCreate(encodingName, &parser->m_mem, tmp, newDtd); } else { parser = parserCreate(encodingName, &parser->m_mem, NULL, newDtd); } if (!parser) return NULL; startElementHandler = oldStartElementHandler; endElementHandler = oldEndElementHandler; characterDataHandler = oldCharacterDataHandler; processingInstructionHandler = oldProcessingInstructionHandler; commentHandler = oldCommentHandler; startCdataSectionHandler = oldStartCdataSectionHandler; endCdataSectionHandler = oldEndCdataSectionHandler; defaultHandler = oldDefaultHandler; unparsedEntityDeclHandler = oldUnparsedEntityDeclHandler; notationDeclHandler = oldNotationDeclHandler; startNamespaceDeclHandler = oldStartNamespaceDeclHandler; endNamespaceDeclHandler = oldEndNamespaceDeclHandler; notStandaloneHandler = oldNotStandaloneHandler; externalEntityRefHandler = oldExternalEntityRefHandler; skippedEntityHandler = oldSkippedEntityHandler; unknownEncodingHandler = oldUnknownEncodingHandler; elementDeclHandler = oldElementDeclHandler; attlistDeclHandler = oldAttlistDeclHandler; entityDeclHandler = oldEntityDeclHandler; xmlDeclHandler = oldXmlDeclHandler; declElementType = oldDeclElementType; userData = oldUserData; if (oldUserData == oldHandlerArg) handlerArg = userData; else handlerArg = parser; if (oldExternalEntityRefHandlerArg != oldParser) externalEntityRefHandlerArg = oldExternalEntityRefHandlerArg; defaultExpandInternalEntities = oldDefaultExpandInternalEntities; ns_triplets = oldns_triplets; parentParser = oldParser; #ifdef XML_DTD paramEntityParsing = oldParamEntityParsing; prologState.inEntityValue = oldInEntityValue; if (context) { #endif /* XML_DTD */ if (!dtdCopy(_dtd, oldDtd, &parser->m_mem) || !setContext(parser, context)) { XML_ParserFree(parser); return NULL; } processor = externalEntityInitProcessor; #ifdef XML_DTD } else { /* The DTD instance referenced by _dtd is shared between the document's root parser and external PE parsers, therefore one does not need to call setContext. In addition, one also *must* not call setContext, because this would overwrite existing prefix->binding pointers in _dtd with ones that get destroyed with the external PE parser. This would leave those prefixes with dangling pointers. */ isParamEntity = XML_TRUE; XmlPrologStateInitExternalEntity(&prologState); processor = externalParEntInitProcessor; } #endif /* XML_DTD */ return parser; } static void FASTCALL destroyBindings(BINDING *bindings, XML_Parser parser) { for (;;) { BINDING *b = bindings; if (!b) break; bindings = b->nextTagBinding; FREE(b->uri); FREE(b); } } void XML_ParserFree(XML_Parser parser) { for (;;) { TAG *p; if (tagStack == NULL) { if (freeTagList == NULL) break; tagStack = freeTagList; freeTagList = NULL; } p = tagStack; tagStack = tagStack->parent; FREE(p->buf); destroyBindings(p->bindings, parser); FREE(p); } destroyBindings(freeBindingList, parser); destroyBindings(inheritedBindings, parser); poolDestroy(&tempPool); poolDestroy(&temp2Pool); #ifdef XML_DTD /* external parameter entity parsers share the DTD structure parser->m_dtd with the root parser, so we must not destroy it */ if (!isParamEntity && _dtd) #else if (_dtd) #endif /* XML_DTD */ dtdDestroy(_dtd, (XML_Bool)!parentParser, &parser->m_mem); FREE((void *)atts); if (groupConnector) FREE(groupConnector); if (buffer) FREE(buffer); FREE(dataBuf); if (unknownEncodingMem) FREE(unknownEncodingMem); if (unknownEncodingRelease) unknownEncodingRelease(unknownEncodingData); FREE(parser); } void XML_UseParserAsHandlerArg(XML_Parser parser) { handlerArg = parser; } enum XML_Error XML_UseForeignDTD(XML_Parser parser, XML_Bool useDTD) { #ifdef XML_DTD /* block after XML_Parse()/XML_ParseBuffer() has been called */ if (parsing) return XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING; useForeignDTD = useDTD; return XML_ERROR_NONE; #else return XML_ERROR_FEATURE_REQUIRES_XML_DTD; #endif } void XML_SetReturnNSTriplet(XML_Parser parser, int do_nst) { /* block after XML_Parse()/XML_ParseBuffer() has been called */ if (parsing) return; ns_triplets = do_nst ? XML_TRUE : XML_FALSE; } void XML_SetUserData(XML_Parser parser, void *p) { if (handlerArg == userData) handlerArg = userData = p; else userData = p; } enum XML_Status XML_SetBase(XML_Parser parser, const XML_Char *p) { if (p) { p = poolCopyString(&_dtd->pool, p); if (!p) return XML_STATUS_ERROR; curBase = p; } else curBase = NULL; return XML_STATUS_OK; } const XML_Char * XML_GetBase(XML_Parser parser) { return curBase; } int XML_GetSpecifiedAttributeCount(XML_Parser parser) { return nSpecifiedAtts; } int XML_GetIdAttributeIndex(XML_Parser parser) { return idAttIndex; } void XML_SetElementHandler(XML_Parser parser, XML_StartElementHandler start, XML_EndElementHandler end) { startElementHandler = start; endElementHandler = end; } void XML_SetStartElementHandler(XML_Parser parser, XML_StartElementHandler start) { startElementHandler = start; } void XML_SetEndElementHandler(XML_Parser parser, XML_EndElementHandler end) { endElementHandler = end; } void XML_SetCharacterDataHandler(XML_Parser parser, XML_CharacterDataHandler handler) { characterDataHandler = handler; } void XML_SetProcessingInstructionHandler(XML_Parser parser, XML_ProcessingInstructionHandler handler) { processingInstructionHandler = handler; } void XML_SetCommentHandler(XML_Parser parser, XML_CommentHandler handler) { commentHandler = handler; } void XML_SetCdataSectionHandler(XML_Parser parser, XML_StartCdataSectionHandler start, XML_EndCdataSectionHandler end) { startCdataSectionHandler = start; endCdataSectionHandler = end; } void XML_SetStartCdataSectionHandler(XML_Parser parser, XML_StartCdataSectionHandler start) { startCdataSectionHandler = start; } void XML_SetEndCdataSectionHandler(XML_Parser parser, XML_EndCdataSectionHandler end) { endCdataSectionHandler = end; } void XML_SetDefaultHandler(XML_Parser parser, XML_DefaultHandler handler) { defaultHandler = handler; defaultExpandInternalEntities = XML_FALSE; } void XML_SetDefaultHandlerExpand(XML_Parser parser, XML_DefaultHandler handler) { defaultHandler = handler; defaultExpandInternalEntities = XML_TRUE; } void XML_SetDoctypeDeclHandler(XML_Parser parser, XML_StartDoctypeDeclHandler start, XML_EndDoctypeDeclHandler end) { startDoctypeDeclHandler = start; endDoctypeDeclHandler = end; } void XML_SetStartDoctypeDeclHandler(XML_Parser parser, XML_StartDoctypeDeclHandler start) { startDoctypeDeclHandler = start; } void XML_SetEndDoctypeDeclHandler(XML_Parser parser, XML_EndDoctypeDeclHandler end) { endDoctypeDeclHandler = end; } void XML_SetUnparsedEntityDeclHandler(XML_Parser parser, XML_UnparsedEntityDeclHandler handler) { unparsedEntityDeclHandler = handler; } void XML_SetNotationDeclHandler(XML_Parser parser, XML_NotationDeclHandler handler) { notationDeclHandler = handler; } void XML_SetNamespaceDeclHandler(XML_Parser parser, XML_StartNamespaceDeclHandler start, XML_EndNamespaceDeclHandler end) { startNamespaceDeclHandler = start; endNamespaceDeclHandler = end; } void XML_SetStartNamespaceDeclHandler(XML_Parser parser, XML_StartNamespaceDeclHandler start) { startNamespaceDeclHandler = start; } void XML_SetEndNamespaceDeclHandler(XML_Parser parser, XML_EndNamespaceDeclHandler end) { endNamespaceDeclHandler = end; } void XML_SetNotStandaloneHandler(XML_Parser parser, XML_NotStandaloneHandler handler) { notStandaloneHandler = handler; } void XML_SetExternalEntityRefHandler(XML_Parser parser, XML_ExternalEntityRefHandler handler) { externalEntityRefHandler = handler; } void XML_SetExternalEntityRefHandlerArg(XML_Parser parser, void *arg) { if (arg) externalEntityRefHandlerArg = (XML_Parser)arg; else externalEntityRefHandlerArg = parser; } void XML_SetSkippedEntityHandler(XML_Parser parser, XML_SkippedEntityHandler handler) { skippedEntityHandler = handler; } void XML_SetUnknownEncodingHandler(XML_Parser parser, XML_UnknownEncodingHandler handler, void *data) { unknownEncodingHandler = handler; unknownEncodingHandlerData = data; } void XML_SetElementDeclHandler(XML_Parser parser, XML_ElementDeclHandler eldecl) { elementDeclHandler = eldecl; } void XML_SetAttlistDeclHandler(XML_Parser parser, XML_AttlistDeclHandler attdecl) { attlistDeclHandler = attdecl; } void XML_SetEntityDeclHandler(XML_Parser parser, XML_EntityDeclHandler handler) { entityDeclHandler = handler; } void XML_SetXmlDeclHandler(XML_Parser parser, XML_XmlDeclHandler handler) { xmlDeclHandler = handler; } int XML_SetParamEntityParsing(XML_Parser parser, enum XML_ParamEntityParsing peParsing) { /* block after XML_Parse()/XML_ParseBuffer() has been called */ if (parsing) return 0; #ifdef XML_DTD paramEntityParsing = peParsing; return 1; #else return peParsing == XML_PARAM_ENTITY_PARSING_NEVER; #endif } enum XML_Status XML_Parse(XML_Parser parser, const char *s, int len, int isFinal) { if (len == 0) { if (!isFinal) return XML_STATUS_OK; positionPtr = bufferPtr; errorCode = processor(parser, bufferPtr, parseEndPtr = bufferEnd, 0); if (errorCode == XML_ERROR_NONE) return XML_STATUS_OK; eventEndPtr = eventPtr; processor = errorProcessor; return XML_STATUS_ERROR; } #ifndef XML_CONTEXT_BYTES else if (bufferPtr == bufferEnd) { const char *end; int nLeftOver; parseEndByteIndex += len; positionPtr = s; if (isFinal) { errorCode = processor(parser, s, parseEndPtr = s + len, 0); if (errorCode == XML_ERROR_NONE) return XML_STATUS_OK; eventEndPtr = eventPtr; processor = errorProcessor; return XML_STATUS_ERROR; } errorCode = processor(parser, s, parseEndPtr = s + len, &end); if (errorCode != XML_ERROR_NONE) { eventEndPtr = eventPtr; processor = errorProcessor; return XML_STATUS_ERROR; } XmlUpdatePosition(encoding, positionPtr, end, &position); positionPtr = end; nLeftOver = s + len - end; if (nLeftOver) { if (buffer == NULL || nLeftOver > bufferLim - buffer) { /* FIXME avoid integer overflow */ char *temp; temp = (buffer == NULL ? (char *)MALLOC(len * 2) : (char *)REALLOC(buffer, len * 2)); if (temp == NULL) { errorCode = XML_ERROR_NO_MEMORY; return XML_STATUS_ERROR; } buffer = temp; if (!buffer) { errorCode = XML_ERROR_NO_MEMORY; eventPtr = eventEndPtr = NULL; processor = errorProcessor; return XML_STATUS_ERROR; } bufferLim = buffer + len * 2; } memcpy(buffer, end, nLeftOver); bufferPtr = buffer; bufferEnd = buffer + nLeftOver; } return XML_STATUS_OK; } #endif /* not defined XML_CONTEXT_BYTES */ else { void *buff = XML_GetBuffer(parser, len); if (buff == NULL) return XML_STATUS_ERROR; else { memcpy(buff, s, len); return XML_ParseBuffer(parser, len, isFinal); } } } enum XML_Status XML_ParseBuffer(XML_Parser parser, int len, int isFinal) { const char *start = bufferPtr; positionPtr = start; bufferEnd += len; parseEndByteIndex += len; errorCode = processor(parser, start, parseEndPtr = bufferEnd, isFinal ? (const char **)NULL : &bufferPtr); if (errorCode == XML_ERROR_NONE) { if (!isFinal) { XmlUpdatePosition(encoding, positionPtr, bufferPtr, &position); positionPtr = bufferPtr; } return XML_STATUS_OK; } else { eventEndPtr = eventPtr; processor = errorProcessor; return XML_STATUS_ERROR; } } void * XML_GetBuffer(XML_Parser parser, int len) { if (len > bufferLim - bufferEnd) { /* FIXME avoid integer overflow */ int neededSize = len + (bufferEnd - bufferPtr); #ifdef XML_CONTEXT_BYTES int keep = bufferPtr - buffer; if (keep > XML_CONTEXT_BYTES) keep = XML_CONTEXT_BYTES; neededSize += keep; #endif /* defined XML_CONTEXT_BYTES */ if (neededSize <= bufferLim - buffer) { #ifdef XML_CONTEXT_BYTES if (keep < bufferPtr - buffer) { int offset = (bufferPtr - buffer) - keep; memmove(buffer, &buffer[offset], bufferEnd - bufferPtr + keep); bufferEnd -= offset; bufferPtr -= offset; } #else memmove(buffer, bufferPtr, bufferEnd - bufferPtr); bufferEnd = buffer + (bufferEnd - bufferPtr); bufferPtr = buffer; #endif /* not defined XML_CONTEXT_BYTES */ } else { char *newBuf; int bufferSize = bufferLim - bufferPtr; if (bufferSize == 0) bufferSize = INIT_BUFFER_SIZE; do { bufferSize *= 2; } while (bufferSize < neededSize); newBuf = (char *)MALLOC(bufferSize); if (newBuf == 0) { errorCode = XML_ERROR_NO_MEMORY; return NULL; } bufferLim = newBuf + bufferSize; #ifdef XML_CONTEXT_BYTES if (bufferPtr) { int keep = bufferPtr - buffer; if (keep > XML_CONTEXT_BYTES) keep = XML_CONTEXT_BYTES; memcpy(newBuf, &bufferPtr[-keep], bufferEnd - bufferPtr + keep); FREE(buffer); buffer = newBuf; bufferEnd = buffer + (bufferEnd - bufferPtr) + keep; bufferPtr = buffer + keep; } else { bufferEnd = newBuf + (bufferEnd - bufferPtr); bufferPtr = buffer = newBuf; } #else if (bufferPtr) { memcpy(newBuf, bufferPtr, bufferEnd - bufferPtr); FREE(buffer); } bufferEnd = newBuf + (bufferEnd - bufferPtr); bufferPtr = buffer = newBuf; #endif /* not defined XML_CONTEXT_BYTES */ } } return bufferEnd; } enum XML_Error XML_GetErrorCode(XML_Parser parser) { return errorCode; } long XML_GetCurrentByteIndex(XML_Parser parser) { if (eventPtr) return parseEndByteIndex - (parseEndPtr - eventPtr); return -1; } int XML_GetCurrentByteCount(XML_Parser parser) { if (eventEndPtr && eventPtr) return eventEndPtr - eventPtr; return 0; } const char * XML_GetInputContext(XML_Parser parser, int *offset, int *size) { #ifdef XML_CONTEXT_BYTES if (eventPtr && buffer) { *offset = eventPtr - buffer; *size = bufferEnd - buffer; return buffer; } #endif /* defined XML_CONTEXT_BYTES */ return (char *) 0; } int XML_GetCurrentLineNumber(XML_Parser parser) { if (eventPtr) { XmlUpdatePosition(encoding, positionPtr, eventPtr, &position); positionPtr = eventPtr; } return position.lineNumber + 1; } int XML_GetCurrentColumnNumber(XML_Parser parser) { if (eventPtr) { XmlUpdatePosition(encoding, positionPtr, eventPtr, &position); positionPtr = eventPtr; } return position.columnNumber; } void XML_FreeContentModel(XML_Parser parser, XML_Content *model) { FREE(model); } void * XML_MemMalloc(XML_Parser parser, size_t size) { return MALLOC(size); } void * XML_MemRealloc(XML_Parser parser, void *ptr, size_t size) { return REALLOC(ptr, size); } void XML_MemFree(XML_Parser parser, void *ptr) { FREE(ptr); } void XML_DefaultCurrent(XML_Parser parser) { if (defaultHandler) { if (openInternalEntities) reportDefault(parser, internalEncoding, openInternalEntities->internalEventPtr, openInternalEntities->internalEventEndPtr); else reportDefault(parser, encoding, eventPtr, eventEndPtr); } } const XML_LChar * XML_ErrorString(enum XML_Error code) { static const XML_LChar *message[] = { 0, XML_L("out of memory"), XML_L("syntax error"), XML_L("no element found"), XML_L("not well-formed (invalid token)"), XML_L("unclosed token"), XML_L("partial character"), XML_L("mismatched tag"), XML_L("duplicate attribute"), XML_L("junk after document element"), XML_L("illegal parameter entity reference"), XML_L("undefined entity"), XML_L("recursive entity reference"), XML_L("asynchronous entity"), XML_L("reference to invalid character number"), XML_L("reference to binary entity"), XML_L("reference to external entity in attribute"), XML_L("xml declaration not at start of external entity"), XML_L("unknown encoding"), XML_L("encoding specified in XML declaration is incorrect"), XML_L("unclosed CDATA section"), XML_L("error in processing external entity reference"), XML_L("document is not standalone"), XML_L("unexpected parser state - please send a bug report"), XML_L("entity declared in parameter entity"), XML_L("requested feature requires XML_DTD support in Expat"), XML_L("cannot change setting once parsing has begun") }; if (code > 0 && code < sizeof(message)/sizeof(message[0])) return message[code]; return NULL; } const XML_LChar * XML_ExpatVersion(void) { return "1.95.6"; } XML_Expat_Version XML_ExpatVersionInfo(void) { XML_Expat_Version version; version.major = XML_MAJOR_VERSION; version.minor = XML_MINOR_VERSION; version.micro = XML_MICRO_VERSION; return version; } const XML_Feature * XML_GetFeatureList(void) { static XML_Feature features[] = { {XML_FEATURE_SIZEOF_XML_CHAR, XML_L("sizeof(XML_Char)")}, {XML_FEATURE_SIZEOF_XML_LCHAR, XML_L("sizeof(XML_LChar)")}, #ifdef XML_UNICODE {XML_FEATURE_UNICODE, XML_L("XML_UNICODE")}, #endif #ifdef XML_UNICODE_WCHAR_T {XML_FEATURE_UNICODE_WCHAR_T, XML_L("XML_UNICODE_WCHAR_T")}, #endif #ifdef XML_DTD {XML_FEATURE_DTD, XML_L("XML_DTD")}, #endif #ifdef XML_CONTEXT_BYTES {XML_FEATURE_CONTEXT_BYTES, XML_L("XML_CONTEXT_BYTES"), XML_CONTEXT_BYTES}, #endif #ifdef XML_MIN_SIZE {XML_FEATURE_MIN_SIZE, XML_L("XML_MIN_SIZE")}, #endif {XML_FEATURE_END, NULL} }; features[0].value = sizeof(XML_Char); features[1].value = sizeof(XML_LChar); return features; } /* Initially tag->rawName always points into the parse buffer; for those TAG instances opened while the current parse buffer was processed, and not yet closed, we need to store tag->rawName in a more permanent location, since the parse buffer is about to be discarded. */ static XML_Bool storeRawNames(XML_Parser parser) { TAG *tag = tagStack; while (tag) { int bufSize; int nameLen = sizeof(XML_Char) * (tag->name.strLen + 1); char *rawNameBuf = tag->buf + nameLen; /* Stop if already stored. Since tagStack is a stack, we can stop at the first entry that has already been copied; everything below it in the stack is already been accounted for in a previous call to this function. */ if (tag->rawName == rawNameBuf) break; /* For re-use purposes we need to ensure that the size of tag->buf is a multiple of sizeof(XML_Char). */ bufSize = nameLen + ROUND_UP(tag->rawNameLength, sizeof(XML_Char)); if (bufSize > tag->bufEnd - tag->buf) { char *temp = (char *)REALLOC(tag->buf, bufSize); if (temp == NULL) return XML_FALSE; /* if tag->name.str points to tag->buf (only when namespace processing is off) then we have to update it */ if (tag->name.str == (XML_Char *)tag->buf) tag->name.str = (XML_Char *)temp; /* if tag->name.localPart is set (when namespace processing is on) then update it as well, since it will always point into tag->buf */ if (tag->name.localPart) tag->name.localPart = (XML_Char *)temp + (tag->name.localPart - (XML_Char *)tag->buf); tag->buf = temp; tag->bufEnd = temp + bufSize; rawNameBuf = temp + nameLen; } memcpy(rawNameBuf, tag->rawName, tag->rawNameLength); tag->rawName = rawNameBuf; tag = tag->parent; } return XML_TRUE; } static enum XML_Error PTRCALL contentProcessor(XML_Parser parser, const char *start, const char *end, const char **endPtr) { enum XML_Error result = doContent(parser, 0, encoding, start, end, endPtr); if (result != XML_ERROR_NONE) return result; if (!storeRawNames(parser)) return XML_ERROR_NO_MEMORY; return result; } static enum XML_Error PTRCALL externalEntityInitProcessor(XML_Parser parser, const char *start, const char *end, const char **endPtr) { enum XML_Error result = initializeEncoding(parser); if (result != XML_ERROR_NONE) return result; processor = externalEntityInitProcessor2; return externalEntityInitProcessor2(parser, start, end, endPtr); } static enum XML_Error PTRCALL externalEntityInitProcessor2(XML_Parser parser, const char *start, const char *end, const char **endPtr) { const char *next = start; /* XmlContentTok doesn't always set the last arg */ int tok = XmlContentTok(encoding, start, end, &next); switch (tok) { case XML_TOK_BOM: /* If we are at the end of the buffer, this would cause the next stage, i.e. externalEntityInitProcessor3, to pass control directly to doContent (by detecting XML_TOK_NONE) without processing any xml text declaration - causing the error XML_ERROR_MISPLACED_XML_PI in doContent. */ if (next == end && endPtr) { *endPtr = next; return XML_ERROR_NONE; } start = next; break; case XML_TOK_PARTIAL: if (endPtr) { *endPtr = start; return XML_ERROR_NONE; } eventPtr = start; return XML_ERROR_UNCLOSED_TOKEN; case XML_TOK_PARTIAL_CHAR: if (endPtr) { *endPtr = start; return XML_ERROR_NONE; } eventPtr = start; return XML_ERROR_PARTIAL_CHAR; } processor = externalEntityInitProcessor3; return externalEntityInitProcessor3(parser, start, end, endPtr); } static enum XML_Error PTRCALL externalEntityInitProcessor3(XML_Parser parser, const char *start, const char *end, const char **endPtr) { const char *next = start; /* XmlContentTok doesn't always set the last arg */ int tok = XmlContentTok(encoding, start, end, &next); switch (tok) { case XML_TOK_XML_DECL: { enum XML_Error result = processXmlDecl(parser, 1, start, next); if (result != XML_ERROR_NONE) return result; start = next; } break; case XML_TOK_PARTIAL: if (endPtr) { *endPtr = start; return XML_ERROR_NONE; } eventPtr = start; return XML_ERROR_UNCLOSED_TOKEN; case XML_TOK_PARTIAL_CHAR: if (endPtr) { *endPtr = start; return XML_ERROR_NONE; } eventPtr = start; return XML_ERROR_PARTIAL_CHAR; } processor = externalEntityContentProcessor; tagLevel = 1; return externalEntityContentProcessor(parser, start, end, endPtr); } static enum XML_Error PTRCALL externalEntityContentProcessor(XML_Parser parser, const char *start, const char *end, const char **endPtr) { enum XML_Error result = doContent(parser, 1, encoding, start, end, endPtr); if (result != XML_ERROR_NONE) return result; if (!storeRawNames(parser)) return XML_ERROR_NO_MEMORY; return result; } static enum XML_Error doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc, const char *s, const char *end, const char **nextPtr) { DTD * const dtd = _dtd; /* save one level of indirection */ const char **eventPP; const char **eventEndPP; if (enc == encoding) { eventPP = &eventPtr; eventEndPP = &eventEndPtr; } else { eventPP = &(openInternalEntities->internalEventPtr); eventEndPP = &(openInternalEntities->internalEventEndPtr); } *eventPP = s; for (;;) { const char *next = s; /* XmlContentTok doesn't always set the last arg */ int tok = XmlContentTok(enc, s, end, &next); *eventEndPP = next; switch (tok) { case XML_TOK_TRAILING_CR: if (nextPtr) { *nextPtr = s; return XML_ERROR_NONE; } *eventEndPP = end; if (characterDataHandler) { XML_Char c = 0xA; characterDataHandler(handlerArg, &c, 1); } else if (defaultHandler) reportDefault(parser, enc, s, end); if (startTagLevel == 0) return XML_ERROR_NO_ELEMENTS; if (tagLevel != startTagLevel) return XML_ERROR_ASYNC_ENTITY; return XML_ERROR_NONE; case XML_TOK_NONE: if (nextPtr) { *nextPtr = s; return XML_ERROR_NONE; } if (startTagLevel > 0) { if (tagLevel != startTagLevel) return XML_ERROR_ASYNC_ENTITY; return XML_ERROR_NONE; } return XML_ERROR_NO_ELEMENTS; case XML_TOK_INVALID: *eventPP = next; return XML_ERROR_INVALID_TOKEN; case XML_TOK_PARTIAL: if (nextPtr) { *nextPtr = s; return XML_ERROR_NONE; } return XML_ERROR_UNCLOSED_TOKEN; case XML_TOK_PARTIAL_CHAR: if (nextPtr) { *nextPtr = s; return XML_ERROR_NONE; } return XML_ERROR_PARTIAL_CHAR; case XML_TOK_ENTITY_REF: { const XML_Char *name; ENTITY *entity; XML_Char ch = (XML_Char) XmlPredefinedEntityName(enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar); if (ch) { if (characterDataHandler) characterDataHandler(handlerArg, &ch, 1); else if (defaultHandler) reportDefault(parser, enc, s, next); break; } name = poolStoreString(&dtd->pool, enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar); if (!name) return XML_ERROR_NO_MEMORY; entity = (ENTITY *)lookup(&dtd->generalEntities, name, 0); poolDiscard(&dtd->pool); /* First, determine if a check for an existing declaration is needed; if yes, check that the entity exists, and that it is internal, otherwise call the skipped entity or default handler. */ if (!dtd->hasParamEntityRefs || dtd->standalone) { if (!entity) return XML_ERROR_UNDEFINED_ENTITY; else if (!entity->is_internal) return XML_ERROR_ENTITY_DECLARED_IN_PE; } else if (!entity) { if (skippedEntityHandler) skippedEntityHandler(handlerArg, name, 0); else if (defaultHandler) reportDefault(parser, enc, s, next); break; } if (entity->open) return XML_ERROR_RECURSIVE_ENTITY_REF; if (entity->notation) return XML_ERROR_BINARY_ENTITY_REF; if (entity->textPtr) { enum XML_Error result; OPEN_INTERNAL_ENTITY openEntity; if (!defaultExpandInternalEntities) { if (skippedEntityHandler) skippedEntityHandler(handlerArg, entity->name, 0); else if (defaultHandler) reportDefault(parser, enc, s, next); break; } entity->open = XML_TRUE; openEntity.next = openInternalEntities; openInternalEntities = &openEntity; openEntity.entity = entity; openEntity.internalEventPtr = NULL; openEntity.internalEventEndPtr = NULL; result = doContent(parser, tagLevel, internalEncoding, (char *)entity->textPtr, (char *)(entity->textPtr + entity->textLen), 0); entity->open = XML_FALSE; openInternalEntities = openEntity.next; if (result) return result; } else if (externalEntityRefHandler) { const XML_Char *context; entity->open = XML_TRUE; context = getContext(parser); entity->open = XML_FALSE; if (!context) return XML_ERROR_NO_MEMORY; if (!externalEntityRefHandler((XML_Parser)externalEntityRefHandlerArg, context, entity->base, entity->systemId, entity->publicId)) return XML_ERROR_EXTERNAL_ENTITY_HANDLING; poolDiscard(&tempPool); } else if (defaultHandler) reportDefault(parser, enc, s, next); break; } case XML_TOK_START_TAG_NO_ATTS: /* fall through */ case XML_TOK_START_TAG_WITH_ATTS: { TAG *tag; enum XML_Error result; XML_Char *toPtr; if (freeTagList) { tag = freeTagList; freeTagList = freeTagList->parent; } else { tag = (TAG *)MALLOC(sizeof(TAG)); if (!tag) return XML_ERROR_NO_MEMORY; tag->buf = (char *)MALLOC(INIT_TAG_BUF_SIZE); if (!tag->buf) { FREE(tag); return XML_ERROR_NO_MEMORY; } tag->bufEnd = tag->buf + INIT_TAG_BUF_SIZE; } tag->bindings = NULL; tag->parent = tagStack; tagStack = tag; tag->name.localPart = NULL; tag->name.prefix = NULL; tag->rawName = s + enc->minBytesPerChar; tag->rawNameLength = XmlNameLength(enc, tag->rawName); ++tagLevel; { const char *rawNameEnd = tag->rawName + tag->rawNameLength; const char *fromPtr = tag->rawName; toPtr = (XML_Char *)tag->buf; for (;;) { int bufSize; int convLen; XmlConvert(enc, &fromPtr, rawNameEnd, (ICHAR **)&toPtr, (ICHAR *)tag->bufEnd - 1); convLen = toPtr - (XML_Char *)tag->buf; if (fromPtr == rawNameEnd) { tag->name.strLen = convLen; break; } bufSize = (tag->bufEnd - tag->buf) << 1; { char *temp = (char *)REALLOC(tag->buf, bufSize); if (temp == NULL) return XML_ERROR_NO_MEMORY; tag->buf = temp; tag->bufEnd = temp + bufSize; toPtr = (XML_Char *)temp + convLen; } } } tag->name.str = (XML_Char *)tag->buf; *toPtr = XML_T('\0'); result = storeAtts(parser, enc, s, &(tag->name), &(tag->bindings)); if (result) return result; if (startElementHandler) startElementHandler(handlerArg, tag->name.str, (const XML_Char **)atts); else if (defaultHandler) reportDefault(parser, enc, s, next); poolClear(&tempPool); break; } case XML_TOK_EMPTY_ELEMENT_NO_ATTS: /* fall through */ case XML_TOK_EMPTY_ELEMENT_WITH_ATTS: { const char *rawName = s + enc->minBytesPerChar; enum XML_Error result; BINDING *bindings = NULL; XML_Bool noElmHandlers = XML_TRUE; TAG_NAME name; name.str = poolStoreString(&tempPool, enc, rawName, rawName + XmlNameLength(enc, rawName)); if (!name.str) return XML_ERROR_NO_MEMORY; poolFinish(&tempPool); result = storeAtts(parser, enc, s, &name, &bindings); if (result) return result; poolFinish(&tempPool); if (startElementHandler) { startElementHandler(handlerArg, name.str, (const XML_Char **)atts); noElmHandlers = XML_FALSE; } if (endElementHandler) { if (startElementHandler) *eventPP = *eventEndPP; endElementHandler(handlerArg, name.str); noElmHandlers = XML_FALSE; } if (noElmHandlers && defaultHandler) reportDefault(parser, enc, s, next); poolClear(&tempPool); while (bindings) { BINDING *b = bindings; if (endNamespaceDeclHandler) endNamespaceDeclHandler(handlerArg, b->prefix->name); bindings = bindings->nextTagBinding; b->nextTagBinding = freeBindingList; freeBindingList = b; b->prefix->binding = b->prevPrefixBinding; } } if (tagLevel == 0) return epilogProcessor(parser, next, end, nextPtr); break; case XML_TOK_END_TAG: if (tagLevel == startTagLevel) return XML_ERROR_ASYNC_ENTITY; else { int len; const char *rawName; TAG *tag = tagStack; tagStack = tag->parent; tag->parent = freeTagList; freeTagList = tag; rawName = s + enc->minBytesPerChar*2; len = XmlNameLength(enc, rawName); if (len != tag->rawNameLength || memcmp(tag->rawName, rawName, len) != 0) { *eventPP = rawName; return XML_ERROR_TAG_MISMATCH; } --tagLevel; if (endElementHandler) { const XML_Char *localPart; const XML_Char *prefix; XML_Char *uri; localPart = tag->name.localPart; if (ns && localPart) { /* localPart and prefix may have been overwritten in tag->name.str, since this points to the binding->uri buffer which gets re-used; so we have to add them again */ uri = (XML_Char *)tag->name.str + tag->name.uriLen; /* don't need to check for space - already done in storeAtts() */ while (*localPart) *uri++ = *localPart++; prefix = (XML_Char *)tag->name.prefix; if (ns_triplets && prefix) { *uri++ = namespaceSeparator; while (*prefix) *uri++ = *prefix++; } *uri = XML_T('\0'); } endElementHandler(handlerArg, tag->name.str); } else if (defaultHandler) reportDefault(parser, enc, s, next); while (tag->bindings) { BINDING *b = tag->bindings; if (endNamespaceDeclHandler) endNamespaceDeclHandler(handlerArg, b->prefix->name); tag->bindings = tag->bindings->nextTagBinding; b->nextTagBinding = freeBindingList; freeBindingList = b; b->prefix->binding = b->prevPrefixBinding; } if (tagLevel == 0) return epilogProcessor(parser, next, end, nextPtr); } break; case XML_TOK_CHAR_REF: { int n = XmlCharRefNumber(enc, s); if (n < 0) return XML_ERROR_BAD_CHAR_REF; if (characterDataHandler) { XML_Char buf[XML_ENCODE_MAX]; characterDataHandler(handlerArg, buf, XmlEncode(n, (ICHAR *)buf)); } else if (defaultHandler) reportDefault(parser, enc, s, next); } break; case XML_TOK_XML_DECL: return XML_ERROR_MISPLACED_XML_PI; case XML_TOK_DATA_NEWLINE: if (characterDataHandler) { XML_Char c = 0xA; characterDataHandler(handlerArg, &c, 1); } else if (defaultHandler) reportDefault(parser, enc, s, next); break; case XML_TOK_CDATA_SECT_OPEN: { enum XML_Error result; if (startCdataSectionHandler) startCdataSectionHandler(handlerArg); #if 0 /* Suppose you doing a transformation on a document that involves changing only the character data. You set up a defaultHandler and a characterDataHandler. The defaultHandler simply copies characters through. The characterDataHandler does the transformation and writes the characters out escaping them as necessary. This case will fail to work if we leave out the following two lines (because & and < inside CDATA sections will be incorrectly escaped). However, now we have a start/endCdataSectionHandler, so it seems easier to let the user deal with this. */ else if (characterDataHandler) characterDataHandler(handlerArg, dataBuf, 0); #endif else if (defaultHandler) reportDefault(parser, enc, s, next); result = doCdataSection(parser, enc, &next, end, nextPtr); if (!next) { processor = cdataSectionProcessor; return result; } } break; case XML_TOK_TRAILING_RSQB: if (nextPtr) { *nextPtr = s; return XML_ERROR_NONE; } if (characterDataHandler) { if (MUST_CONVERT(enc, s)) { ICHAR *dataPtr = (ICHAR *)dataBuf; XmlConvert(enc, &s, end, &dataPtr, (ICHAR *)dataBufEnd); characterDataHandler(handlerArg, dataBuf, dataPtr - (ICHAR *)dataBuf); } else characterDataHandler(handlerArg, (XML_Char *)s, (XML_Char *)end - (XML_Char *)s); } else if (defaultHandler) reportDefault(parser, enc, s, end); if (startTagLevel == 0) { *eventPP = end; return XML_ERROR_NO_ELEMENTS; } if (tagLevel != startTagLevel) { *eventPP = end; return XML_ERROR_ASYNC_ENTITY; } return XML_ERROR_NONE; case XML_TOK_DATA_CHARS: if (characterDataHandler) { if (MUST_CONVERT(enc, s)) { for (;;) { ICHAR *dataPtr = (ICHAR *)dataBuf; XmlConvert(enc, &s, next, &dataPtr, (ICHAR *)dataBufEnd); *eventEndPP = s; characterDataHandler(handlerArg, dataBuf, dataPtr - (ICHAR *)dataBuf); if (s == next) break; *eventPP = s; } } else characterDataHandler(handlerArg, (XML_Char *)s, (XML_Char *)next - (XML_Char *)s); } else if (defaultHandler) reportDefault(parser, enc, s, next); break; case XML_TOK_PI: if (!reportProcessingInstruction(parser, enc, s, next)) return XML_ERROR_NO_MEMORY; break; case XML_TOK_COMMENT: if (!reportComment(parser, enc, s, next)) return XML_ERROR_NO_MEMORY; break; default: if (defaultHandler) reportDefault(parser, enc, s, next); break; } *eventPP = s = next; } /* not reached */ } /* Precondition: all arguments must be non-NULL; Purpose: - normalize attributes - check attributes for well-formedness - generate namespace aware attribute names (URI, prefix) - build list of attributes for startElementHandler - default attributes - process namespace declarations (check and report them) - generate namespace aware element name (URI, prefix) */ static enum XML_Error storeAtts(XML_Parser parser, const ENCODING *enc, const char *attStr, TAG_NAME *tagNamePtr, BINDING **bindingsPtr) { DTD * const dtd = _dtd; /* save one level of indirection */ ELEMENT_TYPE *elementType = NULL; int nDefaultAtts = 0; const XML_Char **appAtts; /* the attribute list for the application */ int attIndex = 0; int prefixLen; int i; int n; XML_Char *uri; int nPrefixes = 0; BINDING *binding; const XML_Char *localPart; /* lookup the element type name */ elementType = (ELEMENT_TYPE *)lookup(&dtd->elementTypes, tagNamePtr->str,0); if (!elementType) { const XML_Char *name = poolCopyString(&dtd->pool, tagNamePtr->str); if (!name) return XML_ERROR_NO_MEMORY; elementType = (ELEMENT_TYPE *)lookup(&dtd->elementTypes, name, sizeof(ELEMENT_TYPE)); if (!elementType) return XML_ERROR_NO_MEMORY; if (ns && !setElementTypePrefix(parser, elementType)) return XML_ERROR_NO_MEMORY; } nDefaultAtts = elementType->nDefaultAtts; /* get the attributes from the tokenizer */ n = XmlGetAttributes(enc, attStr, attsSize, atts); if (n + nDefaultAtts > attsSize) { int oldAttsSize = attsSize; ATTRIBUTE *temp; attsSize = n + nDefaultAtts + INIT_ATTS_SIZE; temp = (ATTRIBUTE *)REALLOC((void *)atts, attsSize * sizeof(ATTRIBUTE)); if (temp == NULL) return XML_ERROR_NO_MEMORY; atts = temp; if (n > oldAttsSize) XmlGetAttributes(enc, attStr, n, atts); } appAtts = (const XML_Char **)atts; for (i = 0; i < n; i++) { /* add the name and value to the attribute list */ ATTRIBUTE_ID *attId = getAttributeId(parser, enc, atts[i].name, atts[i].name + XmlNameLength(enc, atts[i].name)); if (!attId) return XML_ERROR_NO_MEMORY; /* detect duplicate attributes */ if ((attId->name)[-1]) { if (enc == encoding) eventPtr = atts[i].name; return XML_ERROR_DUPLICATE_ATTRIBUTE; } (attId->name)[-1] = 1; appAtts[attIndex++] = attId->name; if (!atts[i].normalized) { enum XML_Error result; XML_Bool isCdata = XML_TRUE; /* figure out whether declared as other than CDATA */ if (attId->maybeTokenized) { int j; for (j = 0; j < nDefaultAtts; j++) { if (attId == elementType->defaultAtts[j].id) { isCdata = elementType->defaultAtts[j].isCdata; break; } } } /* normalize the attribute value */ result = storeAttributeValue(parser, enc, isCdata, atts[i].valuePtr, atts[i].valueEnd, &tempPool); if (result) return result; appAtts[attIndex] = poolStart(&tempPool); poolFinish(&tempPool); } else { /* the value did not need normalizing */ appAtts[attIndex] = poolStoreString(&tempPool, enc, atts[i].valuePtr, atts[i].valueEnd); if (appAtts[attIndex] == 0) return XML_ERROR_NO_MEMORY; poolFinish(&tempPool); } /* handle prefixed attribute names */ if (attId->prefix) { if (attId->xmlns) { /* deal with namespace declarations here */ enum XML_Error result = addBinding(parser, attId->prefix, attId, appAtts[attIndex], bindingsPtr); if (result) return result; --attIndex; } else { /* deal with other prefixed names later */ attIndex++; nPrefixes++; (attId->name)[-1] = 2; } } else attIndex++; } /* set-up for XML_GetSpecifiedAttributeCount and XML_GetIdAttributeIndex */ nSpecifiedAtts = attIndex; if (elementType->idAtt && (elementType->idAtt->name)[-1]) { for (i = 0; i < attIndex; i += 2) if (appAtts[i] == elementType->idAtt->name) { idAttIndex = i; break; } } else idAttIndex = -1; /* do attribute defaulting */ for (i = 0; i < nDefaultAtts; i++) { const DEFAULT_ATTRIBUTE *da = elementType->defaultAtts + i; if (!(da->id->name)[-1] && da->value) { if (da->id->prefix) { if (da->id->xmlns) { enum XML_Error result = addBinding(parser, da->id->prefix, da->id, da->value, bindingsPtr); if (result) return result; } else { (da->id->name)[-1] = 2; nPrefixes++; appAtts[attIndex++] = da->id->name; appAtts[attIndex++] = da->value; } } else { (da->id->name)[-1] = 1; appAtts[attIndex++] = da->id->name; appAtts[attIndex++] = da->value; } } } appAtts[attIndex] = 0; i = 0; if (nPrefixes) { /* expand prefixed attribute names */ for (; i < attIndex; i += 2) { if (appAtts[i][-1] == 2) { ATTRIBUTE_ID *id; ((XML_Char *)(appAtts[i]))[-1] = 0; id = (ATTRIBUTE_ID *)lookup(&dtd->attributeIds, appAtts[i], 0); if (id->prefix->binding) { int j; const BINDING *b = id->prefix->binding; const XML_Char *s = appAtts[i]; for (j = 0; j < b->uriLen; j++) { if (!poolAppendChar(&tempPool, b->uri[j])) return XML_ERROR_NO_MEMORY; } while (*s++ != XML_T(':')) ; do { if (!poolAppendChar(&tempPool, *s)) return XML_ERROR_NO_MEMORY; } while (*s++); if (ns_triplets) { tempPool.ptr[-1] = namespaceSeparator; s = b->prefix->name; do { if (!poolAppendChar(&tempPool, *s)) return XML_ERROR_NO_MEMORY; } while (*s++); } appAtts[i] = poolStart(&tempPool); poolFinish(&tempPool); } if (!--nPrefixes) break; } else ((XML_Char *)(appAtts[i]))[-1] = 0; } } /* clear the flags that say whether attributes were specified */ for (; i < attIndex; i += 2) ((XML_Char *)(appAtts[i]))[-1] = 0; for (binding = *bindingsPtr; binding; binding = binding->nextTagBinding) binding->attId->name[-1] = 0; /* expand the element type name */ if (elementType->prefix) { binding = elementType->prefix->binding; if (!binding) return XML_ERROR_NONE; localPart = tagNamePtr->str; while (*localPart++ != XML_T(':')) ; } else if (dtd->defaultPrefix.binding) { binding = dtd->defaultPrefix.binding; localPart = tagNamePtr->str; } else return XML_ERROR_NONE; prefixLen = 0; if (ns && ns_triplets && binding->prefix->name) { for (; binding->prefix->name[prefixLen++];) ; } tagNamePtr->localPart = localPart; tagNamePtr->uriLen = binding->uriLen; tagNamePtr->prefix = binding->prefix->name; tagNamePtr->prefixLen = prefixLen; for (i = 0; localPart[i++];) ; n = i + binding->uriLen + prefixLen; if (n > binding->uriAlloc) { TAG *p; uri = (XML_Char *)MALLOC((n + EXPAND_SPARE) * sizeof(XML_Char)); if (!uri) return XML_ERROR_NO_MEMORY; binding->uriAlloc = n + EXPAND_SPARE; memcpy(uri, binding->uri, binding->uriLen * sizeof(XML_Char)); for (p = tagStack; p; p = p->parent) if (p->name.str == binding->uri) p->name.str = uri; FREE(binding->uri); binding->uri = uri; } uri = binding->uri + binding->uriLen; memcpy(uri, localPart, i * sizeof(XML_Char)); if (prefixLen) { uri = uri + (i - 1); if (namespaceSeparator) { *(uri) = namespaceSeparator; } memcpy(uri + 1, binding->prefix->name, prefixLen * sizeof(XML_Char)); } tagNamePtr->str = binding->uri; return XML_ERROR_NONE; } /* addBinding() overwrites the value of prefix->binding without checking. Therefore one must keep track of the old value outside of addBinding(). */ static enum XML_Error addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId, const XML_Char *uri, BINDING **bindingsPtr) { BINDING *b; int len; /* empty string is only valid when there is no prefix per XML NS 1.0 */ if (*uri == XML_T('\0') && prefix->name) return XML_ERROR_SYNTAX; for (len = 0; uri[len]; len++) ; if (namespaceSeparator) len++; if (freeBindingList) { b = freeBindingList; if (len > b->uriAlloc) { XML_Char *temp = (XML_Char *)REALLOC(b->uri, sizeof(XML_Char) * (len + EXPAND_SPARE)); if (temp == NULL) return XML_ERROR_NO_MEMORY; b->uri = temp; b->uriAlloc = len + EXPAND_SPARE; } freeBindingList = b->nextTagBinding; } else { b = (BINDING *)MALLOC(sizeof(BINDING)); if (!b) return XML_ERROR_NO_MEMORY; b->uri = (XML_Char *)MALLOC(sizeof(XML_Char) * (len + EXPAND_SPARE)); if (!b->uri) { FREE(b); return XML_ERROR_NO_MEMORY; } b->uriAlloc = len + EXPAND_SPARE; } b->uriLen = len; memcpy(b->uri, uri, len * sizeof(XML_Char)); if (namespaceSeparator) b->uri[len - 1] = namespaceSeparator; b->prefix = prefix; b->attId = attId; b->prevPrefixBinding = prefix->binding; if (*uri == XML_T('\0') && prefix == &_dtd->defaultPrefix) prefix->binding = NULL; else prefix->binding = b; b->nextTagBinding = *bindingsPtr; *bindingsPtr = b; if (startNamespaceDeclHandler) startNamespaceDeclHandler(handlerArg, prefix->name, prefix->binding ? uri : 0); return XML_ERROR_NONE; } /* The idea here is to avoid using stack for each CDATA section when the whole file is parsed with one call. */ static enum XML_Error PTRCALL cdataSectionProcessor(XML_Parser parser, const char *start, const char *end, const char **endPtr) { enum XML_Error result = doCdataSection(parser, encoding, &start, end, endPtr); if (start) { if (parentParser) { /* we are parsing an external entity */ processor = externalEntityContentProcessor; return externalEntityContentProcessor(parser, start, end, endPtr); } else { processor = contentProcessor; return contentProcessor(parser, start, end, endPtr); } } return result; } /* startPtr gets set to non-null is the section is closed, and to null if the section is not yet closed. */ static enum XML_Error doCdataSection(XML_Parser parser, const ENCODING *enc, const char **startPtr, const char *end, const char **nextPtr) { const char *s = *startPtr; const char **eventPP; const char **eventEndPP; if (enc == encoding) { eventPP = &eventPtr; *eventPP = s; eventEndPP = &eventEndPtr; } else { eventPP = &(openInternalEntities->internalEventPtr); eventEndPP = &(openInternalEntities->internalEventEndPtr); } *eventPP = s; *startPtr = NULL; for (;;) { const char *next; int tok = XmlCdataSectionTok(enc, s, end, &next); *eventEndPP = next; switch (tok) { case XML_TOK_CDATA_SECT_CLOSE: if (endCdataSectionHandler) endCdataSectionHandler(handlerArg); #if 0 /* see comment under XML_TOK_CDATA_SECT_OPEN */ else if (characterDataHandler) characterDataHandler(handlerArg, dataBuf, 0); #endif else if (defaultHandler) reportDefault(parser, enc, s, next); *startPtr = next; return XML_ERROR_NONE; case XML_TOK_DATA_NEWLINE: if (characterDataHandler) { XML_Char c = 0xA; characterDataHandler(handlerArg, &c, 1); } else if (defaultHandler) reportDefault(parser, enc, s, next); break; case XML_TOK_DATA_CHARS: if (characterDataHandler) { if (MUST_CONVERT(enc, s)) { for (;;) { ICHAR *dataPtr = (ICHAR *)dataBuf; XmlConvert(enc, &s, next, &dataPtr, (ICHAR *)dataBufEnd); *eventEndPP = next; characterDataHandler(handlerArg, dataBuf, dataPtr - (ICHAR *)dataBuf); if (s == next) break; *eventPP = s; } } else characterDataHandler(handlerArg, (XML_Char *)s, (XML_Char *)next - (XML_Char *)s); } else if (defaultHandler) reportDefault(parser, enc, s, next); break; case XML_TOK_INVALID: *eventPP = next; return XML_ERROR_INVALID_TOKEN; case XML_TOK_PARTIAL_CHAR: if (nextPtr) { *nextPtr = s; return XML_ERROR_NONE; } return XML_ERROR_PARTIAL_CHAR; case XML_TOK_PARTIAL: case XML_TOK_NONE: if (nextPtr) { *nextPtr = s; return XML_ERROR_NONE; } return XML_ERROR_UNCLOSED_CDATA_SECTION; default: *eventPP = next; return XML_ERROR_UNEXPECTED_STATE; } *eventPP = s = next; } /* not reached */ } #ifdef XML_DTD /* The idea here is to avoid using stack for each IGNORE section when the whole file is parsed with one call. */ static enum XML_Error PTRCALL ignoreSectionProcessor(XML_Parser parser, const char *start, const char *end, const char **endPtr) { enum XML_Error result = doIgnoreSection(parser, encoding, &start, end, endPtr); if (start) { processor = prologProcessor; return prologProcessor(parser, start, end, endPtr); } return result; } /* startPtr gets set to non-null is the section is closed, and to null if the section is not yet closed. */ static enum XML_Error doIgnoreSection(XML_Parser parser, const ENCODING *enc, const char **startPtr, const char *end, const char **nextPtr) { const char *next; int tok; const char *s = *startPtr; const char **eventPP; const char **eventEndPP; if (enc == encoding) { eventPP = &eventPtr; *eventPP = s; eventEndPP = &eventEndPtr; } else { eventPP = &(openInternalEntities->internalEventPtr); eventEndPP = &(openInternalEntities->internalEventEndPtr); } *eventPP = s; *startPtr = NULL; tok = XmlIgnoreSectionTok(enc, s, end, &next); *eventEndPP = next; switch (tok) { case XML_TOK_IGNORE_SECT: if (defaultHandler) reportDefault(parser, enc, s, next); *startPtr = next; return XML_ERROR_NONE; case XML_TOK_INVALID: *eventPP = next; return XML_ERROR_INVALID_TOKEN; case XML_TOK_PARTIAL_CHAR: if (nextPtr) { *nextPtr = s; return XML_ERROR_NONE; } return XML_ERROR_PARTIAL_CHAR; case XML_TOK_PARTIAL: case XML_TOK_NONE: if (nextPtr) { *nextPtr = s; return XML_ERROR_NONE; } return XML_ERROR_SYNTAX; /* XML_ERROR_UNCLOSED_IGNORE_SECTION */ default: *eventPP = next; return XML_ERROR_UNEXPECTED_STATE; } /* not reached */ } #endif /* XML_DTD */ static enum XML_Error initializeEncoding(XML_Parser parser) { const char *s; #ifdef XML_UNICODE char encodingBuf[128]; if (!protocolEncodingName) s = NULL; else { int i; for (i = 0; protocolEncodingName[i]; i++) { if (i == sizeof(encodingBuf) - 1 || (protocolEncodingName[i] & ~0x7f) != 0) { encodingBuf[0] = '\0'; break; } encodingBuf[i] = (char)protocolEncodingName[i]; } encodingBuf[i] = '\0'; s = encodingBuf; } #else s = protocolEncodingName; #endif if ((ns ? XmlInitEncodingNS : XmlInitEncoding)(&initEncoding, &encoding, s)) return XML_ERROR_NONE; return handleUnknownEncoding(parser, protocolEncodingName); } static enum XML_Error processXmlDecl(XML_Parser parser, int isGeneralTextEntity, const char *s, const char *next) { const char *encodingName = NULL; const XML_Char *storedEncName = NULL; const ENCODING *newEncoding = NULL; const char *version = NULL; const char *versionend; const XML_Char *storedversion = NULL; int standalone = -1; if (!(ns ? XmlParseXmlDeclNS : XmlParseXmlDecl)(isGeneralTextEntity, encoding, s, next, &eventPtr, &version, &versionend, &encodingName, &newEncoding, &standalone)) return XML_ERROR_SYNTAX; if (!isGeneralTextEntity && standalone == 1) { _dtd->standalone = XML_TRUE; #ifdef XML_DTD if (paramEntityParsing == XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE) paramEntityParsing = XML_PARAM_ENTITY_PARSING_NEVER; #endif /* XML_DTD */ } if (xmlDeclHandler) { if (encodingName != NULL) { storedEncName = poolStoreString(&temp2Pool, encoding, encodingName, encodingName + XmlNameLength(encoding, encodingName)); if (!storedEncName) return XML_ERROR_NO_MEMORY; poolFinish(&temp2Pool); } if (version) { storedversion = poolStoreString(&temp2Pool, encoding, version, versionend - encoding->minBytesPerChar); if (!storedversion) return XML_ERROR_NO_MEMORY; } xmlDeclHandler(handlerArg, storedversion, storedEncName, standalone); } else if (defaultHandler) reportDefault(parser, encoding, s, next); if (protocolEncodingName == NULL) { if (newEncoding) { if (newEncoding->minBytesPerChar != encoding->minBytesPerChar) { eventPtr = encodingName; return XML_ERROR_INCORRECT_ENCODING; } encoding = newEncoding; } else if (encodingName) { enum XML_Error result; if (!storedEncName) { storedEncName = poolStoreString( &temp2Pool, encoding, encodingName, encodingName + XmlNameLength(encoding, encodingName)); if (!storedEncName) return XML_ERROR_NO_MEMORY; } result = handleUnknownEncoding(parser, storedEncName); poolClear(&temp2Pool); if (result == XML_ERROR_UNKNOWN_ENCODING) eventPtr = encodingName; return result; } } if (storedEncName || storedversion) poolClear(&temp2Pool); return XML_ERROR_NONE; } static enum XML_Error handleUnknownEncoding(XML_Parser parser, const XML_Char *encodingName) { if (unknownEncodingHandler) { XML_Encoding info; int i; for (i = 0; i < 256; i++) info.map[i] = -1; info.convert = NULL; info.data = NULL; info.release = NULL; if (unknownEncodingHandler(unknownEncodingHandlerData, encodingName, &info)) { ENCODING *enc; unknownEncodingMem = MALLOC(XmlSizeOfUnknownEncoding()); if (!unknownEncodingMem) { if (info.release) info.release(info.data); return XML_ERROR_NO_MEMORY; } enc = (ns ? XmlInitUnknownEncodingNS : XmlInitUnknownEncoding)(unknownEncodingMem, info.map, info.convert, info.data); if (enc) { unknownEncodingData = info.data; unknownEncodingRelease = info.release; encoding = enc; return XML_ERROR_NONE; } } if (info.release != NULL) info.release(info.data); } return XML_ERROR_UNKNOWN_ENCODING; } static enum XML_Error PTRCALL prologInitProcessor(XML_Parser parser, const char *s, const char *end, const char **nextPtr) { enum XML_Error result = initializeEncoding(parser); if (result != XML_ERROR_NONE) return result; processor = prologProcessor; return prologProcessor(parser, s, end, nextPtr); } #ifdef XML_DTD static enum XML_Error PTRCALL externalParEntInitProcessor(XML_Parser parser, const char *s, const char *end, const char **nextPtr) { enum XML_Error result = initializeEncoding(parser); if (result != XML_ERROR_NONE) return result; /* we know now that XML_Parse(Buffer) has been called, so we consider the external parameter entity read */ _dtd->paramEntityRead = XML_TRUE; if (prologState.inEntityValue) { processor = entityValueInitProcessor; return entityValueInitProcessor(parser, s, end, nextPtr); } else { processor = externalParEntProcessor; return externalParEntProcessor(parser, s, end, nextPtr); } } static enum XML_Error PTRCALL entityValueInitProcessor(XML_Parser parser, const char *s, const char *end, const char **nextPtr) { const char *start = s; const char *next = s; int tok; for (;;) { tok = XmlPrologTok(encoding, start, end, &next); if (tok <= 0) { if (nextPtr != 0 && tok != XML_TOK_INVALID) { *nextPtr = s; return XML_ERROR_NONE; } switch (tok) { case XML_TOK_INVALID: return XML_ERROR_INVALID_TOKEN; case XML_TOK_PARTIAL: return XML_ERROR_UNCLOSED_TOKEN; case XML_TOK_PARTIAL_CHAR: return XML_ERROR_PARTIAL_CHAR; case XML_TOK_NONE: /* start == end */ default: break; } return storeEntityValue(parser, encoding, s, end); } else if (tok == XML_TOK_XML_DECL) { enum XML_Error result = processXmlDecl(parser, 0, start, next); if (result != XML_ERROR_NONE) return result; if (nextPtr) *nextPtr = next; /* stop scanning for text declaration - we found one */ processor = entityValueProcessor; return entityValueProcessor(parser, next, end, nextPtr); } /* If we are at the end of the buffer, this would cause XmlPrologTok to return XML_TOK_NONE on the next call, which would then cause the function to exit with *nextPtr set to s - that is what we want for other tokens, but not for the BOM - we would rather like to skip it; then, when this routine is entered the next time, XmlPrologTok will return XML_TOK_INVALID, since the BOM is still in the buffer */ else if (tok == XML_TOK_BOM && next == end && nextPtr) { *nextPtr = next; return XML_ERROR_NONE; } start = next; } } static enum XML_Error PTRCALL externalParEntProcessor(XML_Parser parser, const char *s, const char *end, const char **nextPtr) { const char *start = s; const char *next = s; int tok; tok = XmlPrologTok(encoding, start, end, &next); if (tok <= 0) { if (nextPtr != 0 && tok != XML_TOK_INVALID) { *nextPtr = s; return XML_ERROR_NONE; } switch (tok) { case XML_TOK_INVALID: return XML_ERROR_INVALID_TOKEN; case XML_TOK_PARTIAL: return XML_ERROR_UNCLOSED_TOKEN; case XML_TOK_PARTIAL_CHAR: return XML_ERROR_PARTIAL_CHAR; case XML_TOK_NONE: /* start == end */ default: break; } } /* This would cause the next stage, i.e. doProlog to be passed XML_TOK_BOM. However, when parsing an external subset, doProlog will not accept a BOM as valid, and report a syntax error, so we have to skip the BOM */ else if (tok == XML_TOK_BOM) { s = next; tok = XmlPrologTok(encoding, s, end, &next); } processor = prologProcessor; return doProlog(parser, encoding, s, end, tok, next, nextPtr); } static enum XML_Error PTRCALL entityValueProcessor(XML_Parser parser, const char *s, const char *end, const char **nextPtr) { const char *start = s; const char *next = s; const ENCODING *enc = encoding; int tok; for (;;) { tok = XmlPrologTok(enc, start, end, &next); if (tok <= 0) { if (nextPtr != 0 && tok != XML_TOK_INVALID) { *nextPtr = s; return XML_ERROR_NONE; } switch (tok) { case XML_TOK_INVALID: return XML_ERROR_INVALID_TOKEN; case XML_TOK_PARTIAL: return XML_ERROR_UNCLOSED_TOKEN; case XML_TOK_PARTIAL_CHAR: return XML_ERROR_PARTIAL_CHAR; case XML_TOK_NONE: /* start == end */ default: break; } return storeEntityValue(parser, enc, s, end); } start = next; } } #endif /* XML_DTD */ static enum XML_Error PTRCALL prologProcessor(XML_Parser parser, const char *s, const char *end, const char **nextPtr) { const char *next = s; int tok = XmlPrologTok(encoding, s, end, &next); return doProlog(parser, encoding, s, end, tok, next, nextPtr); } static enum XML_Error doProlog(XML_Parser parser, const ENCODING *enc, const char *s, const char *end, int tok, const char *next, const char **nextPtr) { #ifdef XML_DTD static const XML_Char externalSubsetName[] = { '#' , '\0' }; #endif /* XML_DTD */ static const XML_Char atypeCDATA[] = { 'C', 'D', 'A', 'T', 'A', '\0' }; static const XML_Char atypeID[] = { 'I', 'D', '\0' }; static const XML_Char atypeIDREF[] = { 'I', 'D', 'R', 'E', 'F', '\0' }; static const XML_Char atypeIDREFS[] = { 'I', 'D', 'R', 'E', 'F', 'S', '\0' }; static const XML_Char atypeENTITY[] = { 'E', 'N', 'T', 'I', 'T', 'Y', '\0' }; static const XML_Char atypeENTITIES[] = { 'E', 'N', 'T', 'I', 'T', 'I', 'E', 'S', '\0' }; static const XML_Char atypeNMTOKEN[] = { 'N', 'M', 'T', 'O', 'K', 'E', 'N', '\0' }; static const XML_Char atypeNMTOKENS[] = { 'N', 'M', 'T', 'O', 'K', 'E', 'N', 'S', '\0' }; static const XML_Char notationPrefix[] = { 'N', 'O', 'T', 'A', 'T', 'I', 'O', 'N', '(', '\0' }; static const XML_Char enumValueSep[] = { '|', '\0' }; static const XML_Char enumValueStart[] = { '(', '\0' }; DTD * const dtd = _dtd; /* save one level of indirection */ const char **eventPP; const char **eventEndPP; enum XML_Content_Quant quant; if (enc == encoding) { eventPP = &eventPtr; eventEndPP = &eventEndPtr; } else { eventPP = &(openInternalEntities->internalEventPtr); eventEndPP = &(openInternalEntities->internalEventEndPtr); } for (;;) { int role; XML_Bool handleDefault = XML_TRUE; *eventPP = s; *eventEndPP = next; if (tok <= 0) { if (nextPtr != 0 && tok != XML_TOK_INVALID) { *nextPtr = s; return XML_ERROR_NONE; } switch (tok) { case XML_TOK_INVALID: *eventPP = next; return XML_ERROR_INVALID_TOKEN; case XML_TOK_PARTIAL: return XML_ERROR_UNCLOSED_TOKEN; case XML_TOK_PARTIAL_CHAR: return XML_ERROR_PARTIAL_CHAR; case XML_TOK_NONE: #ifdef XML_DTD if (enc != encoding) return XML_ERROR_NONE; if (isParamEntity) { if (XmlTokenRole(&prologState, XML_TOK_NONE, end, end, enc) == XML_ROLE_ERROR) return XML_ERROR_SYNTAX; return XML_ERROR_NONE; } #endif /* XML_DTD */ return XML_ERROR_NO_ELEMENTS; default: tok = -tok; next = end; break; } } role = XmlTokenRole(&prologState, tok, s, next, enc); switch (role) { case XML_ROLE_XML_DECL: { enum XML_Error result = processXmlDecl(parser, 0, s, next); if (result != XML_ERROR_NONE) return result; enc = encoding; handleDefault = XML_FALSE; } break; case XML_ROLE_DOCTYPE_NAME: if (startDoctypeDeclHandler) { doctypeName = poolStoreString(&tempPool, enc, s, next); if (!doctypeName) return XML_ERROR_NO_MEMORY; poolFinish(&tempPool); doctypePubid = NULL; handleDefault = XML_FALSE; } doctypeSysid = NULL; /* always initialize to NULL */ break; case XML_ROLE_DOCTYPE_INTERNAL_SUBSET: if (startDoctypeDeclHandler) { startDoctypeDeclHandler(handlerArg, doctypeName, doctypeSysid, doctypePubid, 1); doctypeName = NULL; poolClear(&tempPool); handleDefault = XML_FALSE; } break; #ifdef XML_DTD case XML_ROLE_TEXT_DECL: { enum XML_Error result = processXmlDecl(parser, 1, s, next); if (result != XML_ERROR_NONE) return result; enc = encoding; handleDefault = XML_FALSE; } break; #endif /* XML_DTD */ case XML_ROLE_DOCTYPE_PUBLIC_ID: #ifdef XML_DTD useForeignDTD = XML_FALSE; #endif /* XML_DTD */ dtd->hasParamEntityRefs = XML_TRUE; if (startDoctypeDeclHandler) { doctypePubid = poolStoreString(&tempPool, enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar); if (!doctypePubid) return XML_ERROR_NO_MEMORY; poolFinish(&tempPool); handleDefault = XML_FALSE; } #ifdef XML_DTD declEntity = (ENTITY *)lookup(&dtd->paramEntities, externalSubsetName, sizeof(ENTITY)); if (!declEntity) return XML_ERROR_NO_MEMORY; #endif /* XML_DTD */ /* fall through */ case XML_ROLE_ENTITY_PUBLIC_ID: if (!XmlIsPublicId(enc, s, next, eventPP)) return XML_ERROR_SYNTAX; if (dtd->keepProcessing && declEntity) { XML_Char *tem = poolStoreString(&dtd->pool, enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar); if (!tem) return XML_ERROR_NO_MEMORY; normalizePublicId(tem); declEntity->publicId = tem; poolFinish(&dtd->pool); if (entityDeclHandler) handleDefault = XML_FALSE; } break; case XML_ROLE_DOCTYPE_CLOSE: if (doctypeName) { startDoctypeDeclHandler(handlerArg, doctypeName, doctypeSysid, doctypePubid, 0); poolClear(&tempPool); handleDefault = XML_FALSE; } /* doctypeSysid will be non-NULL in the case of a previous XML_ROLE_DOCTYPE_SYSTEM_ID, even if startDoctypeDeclHandler was not set, indicating an external subset */ #ifdef XML_DTD if (doctypeSysid || useForeignDTD) { dtd->hasParamEntityRefs = XML_TRUE; /* when docTypeSysid == NULL */ if (paramEntityParsing && externalEntityRefHandler) { ENTITY *entity = (ENTITY *)lookup(&dtd->paramEntities, externalSubsetName, sizeof(ENTITY)); if (!entity) return XML_ERROR_NO_MEMORY; if (useForeignDTD) entity->base = curBase; dtd->paramEntityRead = XML_FALSE; if (!externalEntityRefHandler(externalEntityRefHandlerArg, 0, entity->base, entity->systemId, entity->publicId)) return XML_ERROR_EXTERNAL_ENTITY_HANDLING; if (dtd->paramEntityRead && !dtd->standalone && notStandaloneHandler && !notStandaloneHandler(handlerArg)) return XML_ERROR_NOT_STANDALONE; /* end of DTD - no need to update dtd->keepProcessing */ } useForeignDTD = XML_FALSE; } #endif /* XML_DTD */ if (endDoctypeDeclHandler) { endDoctypeDeclHandler(handlerArg); handleDefault = XML_FALSE; } break; case XML_ROLE_INSTANCE_START: #ifdef XML_DTD /* if there is no DOCTYPE declaration then now is the last chance to read the foreign DTD */ if (useForeignDTD) { dtd->hasParamEntityRefs = XML_TRUE; if (paramEntityParsing && externalEntityRefHandler) { ENTITY *entity = (ENTITY *)lookup(&dtd->paramEntities, externalSubsetName, sizeof(ENTITY)); if (!entity) return XML_ERROR_NO_MEMORY; entity->base = curBase; dtd->paramEntityRead = XML_FALSE; if (!externalEntityRefHandler(externalEntityRefHandlerArg, 0, entity->base, entity->systemId, entity->publicId)) return XML_ERROR_EXTERNAL_ENTITY_HANDLING; if (dtd->paramEntityRead && !dtd->standalone && notStandaloneHandler && !notStandaloneHandler(handlerArg)) return XML_ERROR_NOT_STANDALONE; /* end of DTD - no need to update dtd->keepProcessing */ } } #endif /* XML_DTD */ processor = contentProcessor; return contentProcessor(parser, s, end, nextPtr); case XML_ROLE_ATTLIST_ELEMENT_NAME: declElementType = getElementType(parser, enc, s, next); if (!declElementType) return XML_ERROR_NO_MEMORY; goto checkAttListDeclHandler; case XML_ROLE_ATTRIBUTE_NAME: declAttributeId = getAttributeId(parser, enc, s, next); if (!declAttributeId) return XML_ERROR_NO_MEMORY; declAttributeIsCdata = XML_FALSE; declAttributeType = NULL; declAttributeIsId = XML_FALSE; goto checkAttListDeclHandler; case XML_ROLE_ATTRIBUTE_TYPE_CDATA: declAttributeIsCdata = XML_TRUE; declAttributeType = atypeCDATA; goto checkAttListDeclHandler; case XML_ROLE_ATTRIBUTE_TYPE_ID: declAttributeIsId = XML_TRUE; declAttributeType = atypeID; goto checkAttListDeclHandler; case XML_ROLE_ATTRIBUTE_TYPE_IDREF: declAttributeType = atypeIDREF; goto checkAttListDeclHandler; case XML_ROLE_ATTRIBUTE_TYPE_IDREFS: declAttributeType = atypeIDREFS; goto checkAttListDeclHandler; case XML_ROLE_ATTRIBUTE_TYPE_ENTITY: declAttributeType = atypeENTITY; goto checkAttListDeclHandler; case XML_ROLE_ATTRIBUTE_TYPE_ENTITIES: declAttributeType = atypeENTITIES; goto checkAttListDeclHandler; case XML_ROLE_ATTRIBUTE_TYPE_NMTOKEN: declAttributeType = atypeNMTOKEN; goto checkAttListDeclHandler; case XML_ROLE_ATTRIBUTE_TYPE_NMTOKENS: declAttributeType = atypeNMTOKENS; checkAttListDeclHandler: if (dtd->keepProcessing && attlistDeclHandler) handleDefault = XML_FALSE; break; case XML_ROLE_ATTRIBUTE_ENUM_VALUE: case XML_ROLE_ATTRIBUTE_NOTATION_VALUE: if (dtd->keepProcessing && attlistDeclHandler) { const XML_Char *prefix; if (declAttributeType) { prefix = enumValueSep; } else { prefix = (role == XML_ROLE_ATTRIBUTE_NOTATION_VALUE ? notationPrefix : enumValueStart); } if (!poolAppendString(&tempPool, prefix)) return XML_ERROR_NO_MEMORY; if (!poolAppend(&tempPool, enc, s, next)) return XML_ERROR_NO_MEMORY; declAttributeType = tempPool.start; handleDefault = XML_FALSE; } break; case XML_ROLE_IMPLIED_ATTRIBUTE_VALUE: case XML_ROLE_REQUIRED_ATTRIBUTE_VALUE: if (dtd->keepProcessing) { if (!defineAttribute(declElementType, declAttributeId, declAttributeIsCdata, declAttributeIsId, 0, parser)) return XML_ERROR_NO_MEMORY; if (attlistDeclHandler && declAttributeType) { if (*declAttributeType == XML_T('(') || (*declAttributeType == XML_T('N') && declAttributeType[1] == XML_T('O'))) { /* Enumerated or Notation type */ if (!poolAppendChar(&tempPool, XML_T(')')) || !poolAppendChar(&tempPool, XML_T('\0'))) return XML_ERROR_NO_MEMORY; declAttributeType = tempPool.start; poolFinish(&tempPool); } *eventEndPP = s; attlistDeclHandler(handlerArg, declElementType->name, declAttributeId->name, declAttributeType, 0, role == XML_ROLE_REQUIRED_ATTRIBUTE_VALUE); poolClear(&tempPool); handleDefault = XML_FALSE; } } break; case XML_ROLE_DEFAULT_ATTRIBUTE_VALUE: case XML_ROLE_FIXED_ATTRIBUTE_VALUE: if (dtd->keepProcessing) { const XML_Char *attVal; enum XML_Error result = storeAttributeValue(parser, enc, declAttributeIsCdata, s + enc->minBytesPerChar, next - enc->minBytesPerChar, &dtd->pool); if (result) return result; attVal = poolStart(&dtd->pool); poolFinish(&dtd->pool); /* ID attributes aren't allowed to have a default */ if (!defineAttribute(declElementType, declAttributeId, declAttributeIsCdata, XML_FALSE, attVal, parser)) return XML_ERROR_NO_MEMORY; if (attlistDeclHandler && declAttributeType) { if (*declAttributeType == XML_T('(') || (*declAttributeType == XML_T('N') && declAttributeType[1] == XML_T('O'))) { /* Enumerated or Notation type */ if (!poolAppendChar(&tempPool, XML_T(')')) || !poolAppendChar(&tempPool, XML_T('\0'))) return XML_ERROR_NO_MEMORY; declAttributeType = tempPool.start; poolFinish(&tempPool); } *eventEndPP = s; attlistDeclHandler(handlerArg, declElementType->name, declAttributeId->name, declAttributeType, attVal, role == XML_ROLE_FIXED_ATTRIBUTE_VALUE); poolClear(&tempPool); handleDefault = XML_FALSE; } } break; case XML_ROLE_ENTITY_VALUE: if (dtd->keepProcessing) { enum XML_Error result = storeEntityValue(parser, enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar); if (declEntity) { declEntity->textPtr = poolStart(&dtd->entityValuePool); declEntity->textLen = poolLength(&dtd->entityValuePool); poolFinish(&dtd->entityValuePool); if (entityDeclHandler) { *eventEndPP = s; entityDeclHandler(handlerArg, declEntity->name, declEntity->is_param, declEntity->textPtr, declEntity->textLen, curBase, 0, 0, 0); handleDefault = XML_FALSE; } } else poolDiscard(&dtd->entityValuePool); if (result != XML_ERROR_NONE) return result; } break; case XML_ROLE_DOCTYPE_SYSTEM_ID: #ifdef XML_DTD useForeignDTD = XML_FALSE; #endif /* XML_DTD */ dtd->hasParamEntityRefs = XML_TRUE; if (startDoctypeDeclHandler) { doctypeSysid = poolStoreString(&tempPool, enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar); if (doctypeSysid == NULL) return XML_ERROR_NO_MEMORY; poolFinish(&tempPool); handleDefault = XML_FALSE; } #ifdef XML_DTD else /* use externalSubsetName to make doctypeSysid non-NULL for the case where no startDoctypeDeclHandler is set */ doctypeSysid = externalSubsetName; #endif /* XML_DTD */ if (!dtd->standalone #ifdef XML_DTD && !paramEntityParsing #endif /* XML_DTD */ && notStandaloneHandler && !notStandaloneHandler(handlerArg)) return XML_ERROR_NOT_STANDALONE; #ifndef XML_DTD break; #else /* XML_DTD */ if (!declEntity) { declEntity = (ENTITY *)lookup(&dtd->paramEntities, externalSubsetName, sizeof(ENTITY)); if (!declEntity) return XML_ERROR_NO_MEMORY; declEntity->publicId = NULL; } /* fall through */ #endif /* XML_DTD */ case XML_ROLE_ENTITY_SYSTEM_ID: if (dtd->keepProcessing && declEntity) { declEntity->systemId = poolStoreString(&dtd->pool, enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar); if (!declEntity->systemId) return XML_ERROR_NO_MEMORY; declEntity->base = curBase; poolFinish(&dtd->pool); if (entityDeclHandler) handleDefault = XML_FALSE; } break; case XML_ROLE_ENTITY_COMPLETE: if (dtd->keepProcessing && declEntity && entityDeclHandler) { *eventEndPP = s; entityDeclHandler(handlerArg, declEntity->name, declEntity->is_param, 0,0, declEntity->base, declEntity->systemId, declEntity->publicId, 0); handleDefault = XML_FALSE; } break; case XML_ROLE_ENTITY_NOTATION_NAME: if (dtd->keepProcessing && declEntity) { declEntity->notation = poolStoreString(&dtd->pool, enc, s, next); if (!declEntity->notation) return XML_ERROR_NO_MEMORY; poolFinish(&dtd->pool); if (unparsedEntityDeclHandler) { *eventEndPP = s; unparsedEntityDeclHandler(handlerArg, declEntity->name, declEntity->base, declEntity->systemId, declEntity->publicId, declEntity->notation); handleDefault = XML_FALSE; } else if (entityDeclHandler) { *eventEndPP = s; entityDeclHandler(handlerArg, declEntity->name, 0,0,0, declEntity->base, declEntity->systemId, declEntity->publicId, declEntity->notation); handleDefault = XML_FALSE; } } break; case XML_ROLE_GENERAL_ENTITY_NAME: { if (XmlPredefinedEntityName(enc, s, next)) { declEntity = NULL; break; } if (dtd->keepProcessing) { const XML_Char *name = poolStoreString(&dtd->pool, enc, s, next); if (!name) return XML_ERROR_NO_MEMORY; declEntity = (ENTITY *)lookup(&dtd->generalEntities, name, sizeof(ENTITY)); if (!declEntity) return XML_ERROR_NO_MEMORY; if (declEntity->name != name) { poolDiscard(&dtd->pool); declEntity = NULL; } else { poolFinish(&dtd->pool); declEntity->publicId = NULL; declEntity->is_param = XML_FALSE; /* if we have a parent parser or are reading an internal parameter entity, then the entity declaration is not considered "internal" */ declEntity->is_internal = !(parentParser || openInternalEntities); if (entityDeclHandler) handleDefault = XML_FALSE; } } else { poolDiscard(&dtd->pool); declEntity = NULL; } } break; case XML_ROLE_PARAM_ENTITY_NAME: #ifdef XML_DTD if (dtd->keepProcessing) { const XML_Char *name = poolStoreString(&dtd->pool, enc, s, next); if (!name) return XML_ERROR_NO_MEMORY; declEntity = (ENTITY *)lookup(&dtd->paramEntities, name, sizeof(ENTITY)); if (!declEntity) return XML_ERROR_NO_MEMORY; if (declEntity->name != name) { poolDiscard(&dtd->pool); declEntity = NULL; } else { poolFinish(&dtd->pool); declEntity->publicId = NULL; declEntity->is_param = XML_TRUE; /* if we have a parent parser or are reading an internal parameter entity, then the entity declaration is not considered "internal" */ declEntity->is_internal = !(parentParser || openInternalEntities); if (entityDeclHandler) handleDefault = XML_FALSE; } } else { poolDiscard(&dtd->pool); declEntity = NULL; } #else /* not XML_DTD */ declEntity = NULL; #endif /* XML_DTD */ break; case XML_ROLE_NOTATION_NAME: declNotationPublicId = NULL; declNotationName = NULL; if (notationDeclHandler) { declNotationName = poolStoreString(&tempPool, enc, s, next); if (!declNotationName) return XML_ERROR_NO_MEMORY; poolFinish(&tempPool); handleDefault = XML_FALSE; } break; case XML_ROLE_NOTATION_PUBLIC_ID: if (!XmlIsPublicId(enc, s, next, eventPP)) return XML_ERROR_SYNTAX; if (declNotationName) { /* means notationDeclHandler != NULL */ XML_Char *tem = poolStoreString(&tempPool, enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar); if (!tem) return XML_ERROR_NO_MEMORY; normalizePublicId(tem); declNotationPublicId = tem; poolFinish(&tempPool); handleDefault = XML_FALSE; } break; case XML_ROLE_NOTATION_SYSTEM_ID: if (declNotationName && notationDeclHandler) { const XML_Char *systemId = poolStoreString(&tempPool, enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar); if (!systemId) return XML_ERROR_NO_MEMORY; *eventEndPP = s; notationDeclHandler(handlerArg, declNotationName, curBase, systemId, declNotationPublicId); handleDefault = XML_FALSE; } poolClear(&tempPool); break; case XML_ROLE_NOTATION_NO_SYSTEM_ID: if (declNotationPublicId && notationDeclHandler) { *eventEndPP = s; notationDeclHandler(handlerArg, declNotationName, curBase, 0, declNotationPublicId); handleDefault = XML_FALSE; } poolClear(&tempPool); break; case XML_ROLE_ERROR: switch (tok) { case XML_TOK_PARAM_ENTITY_REF: return XML_ERROR_PARAM_ENTITY_REF; case XML_TOK_XML_DECL: return XML_ERROR_MISPLACED_XML_PI; default: return XML_ERROR_SYNTAX; } #ifdef XML_DTD case XML_ROLE_IGNORE_SECT: { enum XML_Error result; if (defaultHandler) reportDefault(parser, enc, s, next); handleDefault = XML_FALSE; result = doIgnoreSection(parser, enc, &next, end, nextPtr); if (!next) { processor = ignoreSectionProcessor; return result; } } break; #endif /* XML_DTD */ case XML_ROLE_GROUP_OPEN: if (prologState.level >= groupSize) { if (groupSize) { char *temp = (char *)REALLOC(groupConnector, groupSize *= 2); if (temp == NULL) return XML_ERROR_NO_MEMORY; groupConnector = temp; if (dtd->scaffIndex) { int *temp = (int *)REALLOC(dtd->scaffIndex, groupSize * sizeof(int)); if (temp == NULL) return XML_ERROR_NO_MEMORY; dtd->scaffIndex = temp; } } else { groupConnector = (char *)MALLOC(groupSize = 32); if (!groupConnector) return XML_ERROR_NO_MEMORY; } } groupConnector[prologState.level] = 0; if (dtd->in_eldecl) { int myindex = nextScaffoldPart(parser); if (myindex < 0) return XML_ERROR_NO_MEMORY; dtd->scaffIndex[dtd->scaffLevel] = myindex; dtd->scaffLevel++; dtd->scaffold[myindex].type = XML_CTYPE_SEQ; if (elementDeclHandler) handleDefault = XML_FALSE; } break; case XML_ROLE_GROUP_SEQUENCE: if (groupConnector[prologState.level] == '|') return XML_ERROR_SYNTAX; groupConnector[prologState.level] = ','; if (dtd->in_eldecl && elementDeclHandler) handleDefault = XML_FALSE; break; case XML_ROLE_GROUP_CHOICE: if (groupConnector[prologState.level] == ',') return XML_ERROR_SYNTAX; if (dtd->in_eldecl && !groupConnector[prologState.level] && (dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel - 1]].type != XML_CTYPE_MIXED) ) { dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel - 1]].type = XML_CTYPE_CHOICE; if (elementDeclHandler) handleDefault = XML_FALSE; } groupConnector[prologState.level] = '|'; break; case XML_ROLE_PARAM_ENTITY_REF: #ifdef XML_DTD case XML_ROLE_INNER_PARAM_ENTITY_REF: /* PE references in internal subset are not allowed within declarations */ if (prologState.documentEntity && role == XML_ROLE_INNER_PARAM_ENTITY_REF) return XML_ERROR_PARAM_ENTITY_REF; dtd->hasParamEntityRefs = XML_TRUE; if (!paramEntityParsing) dtd->keepProcessing = dtd->standalone; else { const XML_Char *name; ENTITY *entity; name = poolStoreString(&dtd->pool, enc, s + enc->minBytesPerChar, next - enc->minBytesPerChar); if (!name) return XML_ERROR_NO_MEMORY; entity = (ENTITY *)lookup(&dtd->paramEntities, name, 0); poolDiscard(&dtd->pool); /* first, determine if a check for an existing declaration is needed; if yes, check that the entity exists, and that it is internal, otherwise call the skipped entity handler */ if (prologState.documentEntity && (dtd->standalone ? !openInternalEntities : !dtd->hasParamEntityRefs)) { if (!entity) return XML_ERROR_UNDEFINED_ENTITY; else if (!entity->is_internal) return XML_ERROR_ENTITY_DECLARED_IN_PE; } else if (!entity) { dtd->keepProcessing = dtd->standalone; /* cannot report skipped entities in declarations */ if ((role == XML_ROLE_PARAM_ENTITY_REF) && skippedEntityHandler) { skippedEntityHandler(handlerArg, name, 1); handleDefault = XML_FALSE; } break; } if (entity->open) return XML_ERROR_RECURSIVE_ENTITY_REF; if (entity->textPtr) { enum XML_Error result; result = processInternalParamEntity(parser, entity); if (result != XML_ERROR_NONE) return result; handleDefault = XML_FALSE; break; } if (externalEntityRefHandler) { dtd->paramEntityRead = XML_FALSE; entity->open = XML_TRUE; if (!externalEntityRefHandler(externalEntityRefHandlerArg, 0, entity->base, entity->systemId, entity->publicId)) { entity->open = XML_FALSE; return XML_ERROR_EXTERNAL_ENTITY_HANDLING; } entity->open = XML_FALSE; handleDefault = XML_FALSE; if (!dtd->paramEntityRead) { dtd->keepProcessing = dtd->standalone; break; } } else { dtd->keepProcessing = dtd->standalone; break; } } #endif /* XML_DTD */ if (!dtd->standalone && notStandaloneHandler && !notStandaloneHandler(handlerArg)) return XML_ERROR_NOT_STANDALONE; break; /* Element declaration stuff */ case XML_ROLE_ELEMENT_NAME: if (elementDeclHandler) { declElementType = getElementType(parser, enc, s, next); if (!declElementType) return XML_ERROR_NO_MEMORY; dtd->scaffLevel = 0; dtd->scaffCount = 0; dtd->in_eldecl = XML_TRUE; handleDefault = XML_FALSE; } break; case XML_ROLE_CONTENT_ANY: case XML_ROLE_CONTENT_EMPTY: if (dtd->in_eldecl) { if (elementDeclHandler) { XML_Content * content = (XML_Content *) MALLOC(sizeof(XML_Content)); if (!content) return XML_ERROR_NO_MEMORY; content->quant = XML_CQUANT_NONE; content->name = NULL; content->numchildren = 0; content->children = NULL; content->type = ((role == XML_ROLE_CONTENT_ANY) ? XML_CTYPE_ANY : XML_CTYPE_EMPTY); *eventEndPP = s; elementDeclHandler(handlerArg, declElementType->name, content); handleDefault = XML_FALSE; } dtd->in_eldecl = XML_FALSE; } break; case XML_ROLE_CONTENT_PCDATA: if (dtd->in_eldecl) { dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel - 1]].type = XML_CTYPE_MIXED; if (elementDeclHandler) handleDefault = XML_FALSE; } break; case XML_ROLE_CONTENT_ELEMENT: quant = XML_CQUANT_NONE; goto elementContent; case XML_ROLE_CONTENT_ELEMENT_OPT: quant = XML_CQUANT_OPT; goto elementContent; case XML_ROLE_CONTENT_ELEMENT_REP: quant = XML_CQUANT_REP; goto elementContent; case XML_ROLE_CONTENT_ELEMENT_PLUS: quant = XML_CQUANT_PLUS; elementContent: if (dtd->in_eldecl) { ELEMENT_TYPE *el; const XML_Char *name; int nameLen; const char *nxt = (quant == XML_CQUANT_NONE ? next : next - enc->minBytesPerChar); int myindex = nextScaffoldPart(parser); if (myindex < 0) return XML_ERROR_NO_MEMORY; dtd->scaffold[myindex].type = XML_CTYPE_NAME; dtd->scaffold[myindex].quant = quant; el = getElementType(parser, enc, s, nxt); if (!el) return XML_ERROR_NO_MEMORY; name = el->name; dtd->scaffold[myindex].name = name; nameLen = 0; for (; name[nameLen++]; ); dtd->contentStringLen += nameLen; if (elementDeclHandler) handleDefault = XML_FALSE; } break; case XML_ROLE_GROUP_CLOSE: quant = XML_CQUANT_NONE; goto closeGroup; case XML_ROLE_GROUP_CLOSE_OPT: quant = XML_CQUANT_OPT; goto closeGroup; case XML_ROLE_GROUP_CLOSE_REP: quant = XML_CQUANT_REP; goto closeGroup; case XML_ROLE_GROUP_CLOSE_PLUS: quant = XML_CQUANT_PLUS; closeGroup: if (dtd->in_eldecl) { if (elementDeclHandler) handleDefault = XML_FALSE; dtd->scaffLevel--; dtd->scaffold[dtd->scaffIndex[dtd->scaffLevel]].quant = quant; if (dtd->scaffLevel == 0) { if (!handleDefault) { XML_Content *model = build_model(parser); if (!model) return XML_ERROR_NO_MEMORY; *eventEndPP = s; elementDeclHandler(handlerArg, declElementType->name, model); } dtd->in_eldecl = XML_FALSE; dtd->contentStringLen = 0; } } break; /* End element declaration stuff */ case XML_ROLE_PI: if (!reportProcessingInstruction(parser, enc, s, next)) return XML_ERROR_NO_MEMORY; handleDefault = XML_FALSE; break; case XML_ROLE_COMMENT: if (!reportComment(parser, enc, s, next)) return XML_ERROR_NO_MEMORY; handleDefault = XML_FALSE; break; case XML_ROLE_NONE: switch (tok) { case XML_TOK_BOM: handleDefault = XML_FALSE; break; } break; case XML_ROLE_DOCTYPE_NONE: if (startDoctypeDeclHandler) handleDefault = XML_FALSE; break; case XML_ROLE_ENTITY_NONE: if (dtd->keepProcessing && entityDeclHandler) handleDefault = XML_FALSE; break; case XML_ROLE_NOTATION_NONE: if (notationDeclHandler) handleDefault = XML_FALSE; break; case XML_ROLE_ATTLIST_NONE: if (dtd->keepProcessing && attlistDeclHandler) handleDefault = XML_FALSE; break; case XML_ROLE_ELEMENT_NONE: if (elementDeclHandler) handleDefault = XML_FALSE; break; } /* end of big switch */ if (handleDefault && defaultHandler) reportDefault(parser, enc, s, next); s = next; tok = XmlPrologTok(enc, s, end, &next); } /* not reached */ } static enum XML_Error PTRCALL epilogProcessor(XML_Parser parser, const char *s, const char *end, const char **nextPtr) { processor = epilogProcessor; eventPtr = s; for (;;) { const char *next = NULL; int tok = XmlPrologTok(encoding, s, end, &next); eventEndPtr = next; switch (tok) { /* report partial linebreak - it might be the last token */ case -XML_TOK_PROLOG_S: if (defaultHandler) { eventEndPtr = next; reportDefault(parser, encoding, s, next); } if (nextPtr) *nextPtr = next; return XML_ERROR_NONE; case XML_TOK_NONE: if (nextPtr) *nextPtr = s; return XML_ERROR_NONE; case XML_TOK_PROLOG_S: if (defaultHandler) reportDefault(parser, encoding, s, next); break; case XML_TOK_PI: if (!reportProcessingInstruction(parser, encoding, s, next)) return XML_ERROR_NO_MEMORY; break; case XML_TOK_COMMENT: if (!reportComment(parser, encoding, s, next)) return XML_ERROR_NO_MEMORY; break; case XML_TOK_INVALID: eventPtr = next; return XML_ERROR_INVALID_TOKEN; case XML_TOK_PARTIAL: if (nextPtr) { *nextPtr = s; return XML_ERROR_NONE; } return XML_ERROR_UNCLOSED_TOKEN; case XML_TOK_PARTIAL_CHAR: if (nextPtr) { *nextPtr = s; return XML_ERROR_NONE; } return XML_ERROR_PARTIAL_CHAR; default: return XML_ERROR_JUNK_AFTER_DOC_ELEMENT; } eventPtr = s = next; } } #ifdef XML_DTD static enum XML_Error processInternalParamEntity(XML_Parser parser, ENTITY *entity) { const char *s, *end, *next; int tok; enum XML_Error result; OPEN_INTERNAL_ENTITY openEntity; entity->open = XML_TRUE; openEntity.next = openInternalEntities; openInternalEntities = &openEntity; openEntity.entity = entity; openEntity.internalEventPtr = NULL; openEntity.internalEventEndPtr = NULL; s = (char *)entity->textPtr; end = (char *)(entity->textPtr + entity->textLen); tok = XmlPrologTok(internalEncoding, s, end, &next); result = doProlog(parser, internalEncoding, s, end, tok, next, 0); entity->open = XML_FALSE; openInternalEntities = openEntity.next; return result; } #endif /* XML_DTD */ static enum XML_Error PTRCALL errorProcessor(XML_Parser parser, const char *s, const char *end, const char **nextPtr) { return errorCode; } static enum XML_Error storeAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata, const char *ptr, const char *end, STRING_POOL *pool) { enum XML_Error result = appendAttributeValue(parser, enc, isCdata, ptr, end, pool); if (result) return result; if (!isCdata && poolLength(pool) && poolLastChar(pool) == 0x20) poolChop(pool); if (!poolAppendChar(pool, XML_T('\0'))) return XML_ERROR_NO_MEMORY; return XML_ERROR_NONE; } static enum XML_Error appendAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata, const char *ptr, const char *end, STRING_POOL *pool) { DTD * const dtd = _dtd; /* save one level of indirection */ for (;;) { const char *next; int tok = XmlAttributeValueTok(enc, ptr, end, &next); switch (tok) { case XML_TOK_NONE: return XML_ERROR_NONE; case XML_TOK_INVALID: if (enc == encoding) eventPtr = next; return XML_ERROR_INVALID_TOKEN; case XML_TOK_PARTIAL: if (enc == encoding) eventPtr = ptr; return XML_ERROR_INVALID_TOKEN; case XML_TOK_CHAR_REF: { XML_Char buf[XML_ENCODE_MAX]; int i; int n = XmlCharRefNumber(enc, ptr); if (n < 0) { if (enc == encoding) eventPtr = ptr; return XML_ERROR_BAD_CHAR_REF; } if (!isCdata && n == 0x20 /* space */ && (poolLength(pool) == 0 || poolLastChar(pool) == 0x20)) break; n = XmlEncode(n, (ICHAR *)buf); if (!n) { if (enc == encoding) eventPtr = ptr; return XML_ERROR_BAD_CHAR_REF; } for (i = 0; i < n; i++) { if (!poolAppendChar(pool, buf[i])) return XML_ERROR_NO_MEMORY; } } break; case XML_TOK_DATA_CHARS: if (!poolAppend(pool, enc, ptr, next)) return XML_ERROR_NO_MEMORY; break; case XML_TOK_TRAILING_CR: next = ptr + enc->minBytesPerChar; /* fall through */ case XML_TOK_ATTRIBUTE_VALUE_S: case XML_TOK_DATA_NEWLINE: if (!isCdata && (poolLength(pool) == 0 || poolLastChar(pool) == 0x20)) break; if (!poolAppendChar(pool, 0x20)) return XML_ERROR_NO_MEMORY; break; case XML_TOK_ENTITY_REF: { const XML_Char *name; ENTITY *entity; char checkEntityDecl; XML_Char ch = (XML_Char) XmlPredefinedEntityName(enc, ptr + enc->minBytesPerChar, next - enc->minBytesPerChar); if (ch) { if (!poolAppendChar(pool, ch)) return XML_ERROR_NO_MEMORY; break; } name = poolStoreString(&temp2Pool, enc, ptr + enc->minBytesPerChar, next - enc->minBytesPerChar); if (!name) return XML_ERROR_NO_MEMORY; entity = (ENTITY *)lookup(&dtd->generalEntities, name, 0); poolDiscard(&temp2Pool); /* first, determine if a check for an existing declaration is needed; if yes, check that the entity exists, and that it is internal, otherwise call the default handler (if called from content) */ if (pool == &dtd->pool) /* are we called from prolog? */ checkEntityDecl = #ifdef XML_DTD prologState.documentEntity && #endif /* XML_DTD */ (dtd->standalone ? !openInternalEntities : !dtd->hasParamEntityRefs); else /* if (pool == &tempPool): we are called from content */ checkEntityDecl = !dtd->hasParamEntityRefs || dtd->standalone; if (checkEntityDecl) { if (!entity) return XML_ERROR_UNDEFINED_ENTITY; else if (!entity->is_internal) return XML_ERROR_ENTITY_DECLARED_IN_PE; } else if (!entity) { /* cannot report skipped entity here - see comments on skippedEntityHandler if (skippedEntityHandler) skippedEntityHandler(handlerArg, name, 0); */ if ((pool == &tempPool) && defaultHandler) reportDefault(parser, enc, ptr, next); break; } if (entity->open) { if (enc == encoding) eventPtr = ptr; return XML_ERROR_RECURSIVE_ENTITY_REF; } if (entity->notation) { if (enc == encoding) eventPtr = ptr; return XML_ERROR_BINARY_ENTITY_REF; } if (!entity->textPtr) { if (enc == encoding) eventPtr = ptr; return XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF; } else { enum XML_Error result; const XML_Char *textEnd = entity->textPtr + entity->textLen; entity->open = XML_TRUE; result = appendAttributeValue(parser, internalEncoding, isCdata, (char *)entity->textPtr