Embed binary IPTC data into a JPEG image. */
PHP_FUNCTION(iptcembed)
{
- pval *iptcdata, *jpeg_file, *spool_flag;
+ zval **iptcdata, **jpeg_file, **spool_flag;
FILE *fp;
unsigned int marker;
unsigned int spool = 0, done = 0, inx, len;
switch(ARG_COUNT(ht)){
case 3:
- if (getParameters(ht, 3, &iptcdata, &jpeg_file, &spool_flag) == FAILURE) {
+ if (getParametersEx(3, &iptcdata, &jpeg_file, &spool_flag) == FAILURE) {
WRONG_PARAM_COUNT;
}
- convert_to_string(iptcdata);
- convert_to_string(jpeg_file);
- convert_to_long(spool_flag);
- spool = spool_flag->value.lval;
+ convert_to_string_ex(iptcdata);
+ convert_to_string_ex(jpeg_file);
+ convert_to_long_ex(spool_flag);
+ spool = (*spool_flag)->value.lval;
break;
case 2:
- if (getParameters(ht, 2, &iptcdata, &jpeg_file) == FAILURE) {
+ if (getParametersEx(2, &iptcdata, &jpeg_file) == FAILURE) {
WRONG_PARAM_COUNT;
}
- convert_to_string(iptcdata);
- convert_to_string(jpeg_file);
+ convert_to_string_ex(iptcdata);
+ convert_to_string_ex(jpeg_file);
break;
default:
break;
}
- if (_php3_check_open_basedir(jpeg_file->value.str.val))
+ if (_php3_check_open_basedir((*jpeg_file)->value.str.val))
RETURN_FALSE;
- if ((fp = fopen(jpeg_file->value.str.val,"rb")) == 0) {
- php_error(E_WARNING, "Unable to open %s", jpeg_file->value.str.val);
+ if ((fp = fopen((*jpeg_file)->value.str.val,"rb")) == 0) {
+ php_error(E_WARNING, "Unable to open %s", (*jpeg_file)->value.str.val);
RETURN_FALSE;
}
}
}
- len = iptcdata->value.str.len;
+ len = (*iptcdata)->value.str.len;
if (spool < 2) {
fstat(fileno(fp),&sb);
php3_iptc_put1(fp,spool,(unsigned char)(len&0xff),poi?&poi:0);
for (inx = 0; inx < len; inx++)
- php3_iptc_put1(fp,spool,iptcdata->value.str.val[inx],poi?&poi:0);
+ php3_iptc_put1(fp,spool,(*iptcdata)->value.str.val[inx],poi?&poi:0);
break;
case M_SOS:
unsigned char *buffer;
unsigned char recnum, dataset;
unsigned char key[ 16 ];
- pval *values, *str, **element;
+ zval *values, **str, **element;
- if (ARG_COUNT(ht) != 1 || getParameters(ht, 1, &str) == FAILURE) {
+ if (ARG_COUNT(ht) != 1 || getParametersEx(1, &str) == FAILURE) {
WRONG_PARAM_COUNT;
}
- convert_to_string(str);
+ convert_to_string_ex(str);
inx = 0;
- length = str->value.str.len;
- buffer = str->value.str.val;
+ length = (*str)->value.str.len;
+ buffer = (*str)->value.str.val;
inheader = 0; /* have we already found the IPTC-Header??? */
tagsfound = 0; /* number of tags already found */
/* metaphone -- Breaks english phrases down into their phonemes. */
PHP_FUNCTION(metaphone)
{
- pval *pstr, *pphones;
+ pval **pstr, **pphones;
char *result = 0;
int phones = 0;
- if (getParameters(ht, 2, &pstr, &pphones) == SUCCESS) {
- convert_to_long(pphones);
- phones = pphones->value.lval;
- } else if (getParameters(ht, 1, &pstr) == FAILURE) {
+ if (getParametersEx(2, &pstr, &pphones) == SUCCESS) {
+ convert_to_long_ex(pphones);
+ phones = (*pphones)->value.lval;
+ } else if (getParametersEx(1, &pstr) == FAILURE) {
WRONG_PARAM_COUNT;
}
- convert_to_string(pstr);
+ convert_to_string_ex(pstr);
- if (metaphone(pstr->value.str.val, phones, &result, 1) == 0) {
+ if (metaphone((*pstr)->value.str.val, phones, &result, 1) == 0) {
RETVAL_STRING(result, 0);
} else {
if (result) {