Project

Profile

Help

Revision 6304fb8b

Added by O'Neil Delpratt 5 months ago

Saxon/C bug fixes and development work

View differences:

latest10/hec/Saxon.C.API/php_saxon.cpp
59 59
    obj->std.ce = type;
60 60

  
61 61
    ALLOC_HASHTABLE(obj->std.properties);
62
    zend_hash_init(obj->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
62
    zend_hash_init(obj->std.properties, 0, nullptr, ZVAL_PTR_DTOR, 0);
63 63
    object_properties_init(&obj->std, type);
64
    retval.handle = zend_objects_store_put(obj, NULL, SaxonProcessor_free_storage, NULL TSRMLS_CC);
64
    retval.handle = zend_objects_store_put(obj, nullptr, SaxonProcessor_free_storage, nullptr TSRMLS_CC);
65 65
    retval.handlers = &saxonProcessor_object_handlers;
66 66

  
67 67
    return retval;
......
74 74
        WRONG_PARAM_COUNT;
75 75
    }
76 76

  
77
    char * cwdi = NULL;
77
    char * cwdi = nullptr;
78 78
   bool license = false;
79 79
    int len1;
80 80
    if (ZEND_NUM_ARGS()==1 && zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &license) == FAILURE) {
81 81
        php_error(E_WARNING,"Wrong SaxonProcessor argument");
82
        RETURN_NULL();
82
        RETURN_nullptr();
83 83
    } 
84 84

  
85 85

  
86 86
    if (ZEND_NUM_ARGS()>1 && zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "bs", &license, &cwdi, &len1) == FAILURE) {
87 87
        php_error(E_WARNING,"Wrong SaxonProcessor arguments");
88
        RETURN_NULL();
88
        RETURN_nullptr();
89 89
    }
90 90
 
91 91

  
......
93 93
    SaxonProcessor * saxonProc;
94 94
    saxonProcessor_object * obj = (saxonProcessor_object *)zend_object_store_get_object(object TSRMLS_CC);
95 95
    saxonProc =  obj->saxonProcessor;
96
    if(saxonProc == NULL) {
96
    if(saxonProc == nullptr) {
97 97

  
98 98
	saxonProc = new SaxonProcessor(license); //TODO: add license flag to PHP function argument
99 99

  
100 100
	obj->saxonProcessor = saxonProc;
101 101
    }
102 102

  
103
    if(cwdi==NULL) {
103
    if(cwdi==nullptr) {
104 104
#if !(defined (__linux__) || (defined (__APPLE__) && defined(__MACH__)))
105 105
	    TCHAR s[256];
106 106

  
......
122 122
	    char cwd[256];
123 123

  
124 124
	    VCWD_GETCWD(cwd, sizeof(cwd));
125
	    if(cwd == NULL) {
126
	     //php_error(E_WARNING,"cwd is null");
125
	    if(cwd == nullptr) {
126
	     //php_error(E_WARNING,"cwd is nullptr");
127 127
	   }else {
128 128
             //php_error(E_WARNING,cwd);
129 129

  
......
154 154
    int len;
155 155
    
156 156
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &dirStr, &len) == FAILURE) {
157
        RETURN_NULL();
157
        RETURN_nullptr();
158 158
    }
159 159
    
160 160
    saxonProcessor_object *obj = (saxonProcessor_object *)zend_object_store_get_object(getThis() TSRMLS_CC);
161 161
    saxonProcessor = obj->saxonProcessor;
162
    if (saxonProcessor != NULL) {
162
    if (saxonProcessor != nullptr) {
163 163
       
164
        if(dirStr != NULL) {
164
        if(dirStr != nullptr) {
165 165
            saxonProcessor->setResourcesDirectory(dirStr);
166 166
        }
167 167
    }
......
174 174
    int len;
175 175
    
176 176
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &cwdStr, &len) == FAILURE) {
177
        RETURN_NULL();
177
        RETURN_nullptr();
178 178
    }
179 179
    
180 180
    saxonProcessor_object *obj = (saxonProcessor_object *)zend_object_store_get_object(getThis() TSRMLS_CC);
181 181
    saxonProcessor = obj->saxonProcessor;
182
    if (saxonProcessor != NULL) {
182
    if (saxonProcessor != nullptr) {
183 183
        
184
        if(cwdStr != NULL) {
184
        if(cwdStr != nullptr) {
185 185
            saxonProcessor->setcwd(cwdStr);
186 186
        }
187 187
    }
......
195 195
    int len1;
196 196

  
197 197
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &source, &len1) == FAILURE) {
198
        RETURN_NULL();
198
        RETURN_nullptr();
199 199
    }
200 200
    saxonProcessor_object *obj = (saxonProcessor_object *)zend_object_store_get_object(getThis() TSRMLS_CC);
201
    assert (obj != NULL);
201
    assert (obj != nullptr);
202 202
    saxonProcessor = obj->saxonProcessor;
203
    if (saxonProcessor != NULL) {
203
    if (saxonProcessor != nullptr) {
204 204
        XdmNode* node = saxonProcessor->parseXmlFromString(source);
205
        if(node != NULL) {
205
        if(node != nullptr) {
206 206
            if (object_init_ex(return_value, xdmNode_ce) != SUCCESS) {
207
                RETURN_NULL();
207
                RETURN_nullptr();
208 208
            } else {
209 209
                struct xdmNode_object* vobj = (struct xdmNode_object *)zend_object_store_get_object(return_value TSRMLS_CC);
210
                assert (vobj != NULL);
210
                assert (vobj != nullptr);
211 211
                vobj->xdmNode = node;
212 212
            }
213 213
        } else {
......
216 216
	    }
217 217
        }
218 218
    } else {
219
        RETURN_NULL();
219
        RETURN_nullptr();
220 220
    }
221 221
}
222 222

  
......
227 227
    int len1;
228 228

  
229 229
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &source, &len1) == FAILURE) {
230
        RETURN_NULL();
230
        RETURN_nullptr();
231 231
    }
232 232
    saxonProcessor_object *obj = (saxonProcessor_object *)zend_object_store_get_object(getThis() TSRMLS_CC);
233
    assert (obj != NULL);
233
    assert (obj != nullptr);
234 234
    saxonProcessor = obj->saxonProcessor;
235
    if (saxonProcessor != NULL) {
235
    if (saxonProcessor != nullptr) {
236 236
        XdmValue* node = (XdmValue*)saxonProcessor->parseXmlFromFile(source);//TODO this needs to be XdmNode object
237
        if(node != NULL) {
237
        if(node != nullptr) {
238 238
            if (object_init_ex(return_value, xdmValue_ce) != SUCCESS) {
239
                RETURN_NULL();
239
                RETURN_nullptr();
240 240
            } else {
241 241
                struct xdmValue_object* vobj = (struct xdmValue_object *)zend_object_store_get_object(return_value TSRMLS_CC);
242
                assert (vobj != NULL);
242
                assert (vobj != nullptr);
243 243
                vobj->xdmValue = node;
244 244
            }
245 245
        } else {
246 246
           // obj->xsltProcessor->checkException();//TODO
247 247
        }
248 248
    } else {
249
        RETURN_NULL();
249
        RETURN_nullptr();
250 250
    }
251 251
}
252 252

  
253 253

  
254 254
PHP_METHOD(SaxonProcessor, createAtomicValue)
255 255
{
256
    XdmAtomicValue * xdmValue = NULL;
256
    XdmAtomicValue * xdmValue = nullptr;
257 257
    SaxonProcessor * proc;
258 258
    char * source;
259 259
    int len1;
......
264 264
    long iVal;
265 265
    double dVal;
266 266
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z",&zvalue) == FAILURE) {
267
        RETURN_NULL();
267
        RETURN_nullptr();
268 268
    }
269 269
    saxonProcessor_object *obj = (saxonProcessor_object *)zend_object_store_get_object(getThis() TSRMLS_CC);
270
    assert (obj != NULL);
270
    assert (obj != nullptr);
271 271
    proc = obj->saxonProcessor;
272
    assert (proc != NULL);
273
    if (proc != NULL) {
272
    assert (proc != nullptr);
273
    if (proc != nullptr) {
274 274
	switch (Z_TYPE_P(zvalue)) {
275 275
            case IS_BOOL:
276 276
                bVal = Z_BVAL_P(zvalue);
......
285 285
                len = Z_STRLEN_P(zvalue);
286 286
                xdmValue = proc->makeStringValue((const char*)sVal);
287 287
            break;
288
            case IS_NULL:
288
            case IS_nullptr:
289 289
                xdmValue = new XdmAtomicValue();
290 290
            break;
291 291
            case IS_DOUBLE:
......
299 299
                // TODO: implement this
300 300
                //break;
301 301
            default:
302
                obj = NULL;
302
                obj = nullptr;
303 303
                zend_throw_exception(zend_exception_get_default(TSRMLS_C), "unknown type specified in XdmValue", 0 TSRMLS_CC); 
304
                RETURN_NULL();
304
                RETURN_nullptr();
305 305
        }
306
        if(xdmValue == NULL) {
307
            RETURN_NULL();
306
        if(xdmValue == nullptr) {
307
            RETURN_nullptr();
308 308
        }
309 309
        if (object_init_ex(return_value, xdmAtomicValue_ce) != SUCCESS) {
310
            RETURN_NULL();
310
            RETURN_nullptr();
311 311
        } else {
312 312
            struct xdmAtomicValue_object* vobj = (struct xdmAtomicValue_object *)zend_object_store_get_object(return_value TSRMLS_CC);
313
            assert (vobj != NULL);
313
            assert (vobj != nullptr);
314 314
            vobj->xdmAtomicValue = xdmValue;
315 315
        }
316 316
    } else {
317 317
       
318
        RETURN_NULL();
318
        RETURN_nullptr();
319 319
    }
320 320
}
321 321

  
......
327 327
        WRONG_PARAM_COUNT;
328 328
    }
329 329
    SaxonProcessor * proc;
330
    XPathProcessor * xpathProcessor = NULL;
331
    if((saxonProcessor_object *)zend_object_store_get_object(getThis() TSRMLS_CC) == NULL) {
330
    XPathProcessor * xpathProcessor = nullptr;
331
    if((saxonProcessor_object *)zend_object_store_get_object(getThis() TSRMLS_CC) == nullptr) {
332 332
      
333 333
    }
334 334
    saxonProcessor_object *obj = (saxonProcessor_object *)zend_object_store_get_object(getThis() TSRMLS_CC);
335 335

  
336
    assert (obj != NULL);
336
    assert (obj != nullptr);
337 337
    proc = obj->saxonProcessor;
338
    assert (proc != NULL);
339
    if (proc != NULL) {
338
    assert (proc != nullptr);
339
    if (proc != nullptr) {
340 340
if (object_init_ex(return_value, xpathProcessor_ce) != SUCCESS) {
341
            RETURN_NULL();
341
            RETURN_nullptr();
342 342
        } else {
343 343
	   struct xpathProcessor_object* vobji = (struct xpathProcessor_object *)zend_object_store_get_object(return_value TSRMLS_CC);
344
            assert (vobji != NULL);
344
            assert (vobji != nullptr);
345 345
	    xpathProcessor = proc->newXPathProcessor();
346 346
            vobji->xpathProcessor = xpathProcessor;
347 347
	}
348 348
    } else {
349 349
       
350
        RETURN_NULL();
350
        RETURN_nullptr();
351 351
    }
352 352
}
353 353

  
......
358 358
        WRONG_PARAM_COUNT;
359 359
    }
360 360
    SaxonProcessor * proc;
361
    XsltProcessor * xsltProcessor = NULL;
362
if((saxonProcessor_object *)zend_object_store_get_object(getThis() TSRMLS_CC) == NULL) {
361
    XsltProcessor * xsltProcessor = nullptr;
362
if((saxonProcessor_object *)zend_object_store_get_object(getThis() TSRMLS_CC) == nullptr) {
363 363
   
364 364
}
365 365

  
366 366
    saxonProcessor_object *obj = (saxonProcessor_object *)zend_object_store_get_object(getThis() TSRMLS_CC);
367
    assert (obj != NULL);
367
    assert (obj != nullptr);
368 368
    proc = obj->saxonProcessor;
369
    assert (proc != NULL);
370
    if (proc != NULL) {
369
    assert (proc != nullptr);
370
    if (proc != nullptr) {
371 371
    if (object_init_ex(return_value, xsltProcessor_ce) != SUCCESS) {
372
            RETURN_NULL();
372
            RETURN_nullptr();
373 373
        } else {
374 374
	   struct xsltProcessor_object* vobj = (struct xsltProcessor_object *)zend_object_store_get_object(return_value TSRMLS_CC);
375 375
	
376
            assert (vobj != NULL);
376
            assert (vobj != nullptr);
377 377
	    xsltProcessor = proc->newXsltProcessor();
378 378
            vobj->xsltProcessor = xsltProcessor;
379 379
    }
380 380
    } else {
381 381
       
382
        RETURN_NULL();
382
        RETURN_nullptr();
383 383
    }
384 384
}
385 385

  
......
390 390
        WRONG_PARAM_COUNT;
391 391
    }
392 392
    SaxonProcessor * proc;
393
    XQueryProcessor * xqueryProcessor = NULL;
394
   if((saxonProcessor_object *)zend_object_store_get_object(getThis() TSRMLS_CC) == NULL) {
393
    XQueryProcessor * xqueryProcessor = nullptr;
394
   if((saxonProcessor_object *)zend_object_store_get_object(getThis() TSRMLS_CC) == nullptr) {
395 395
   
396 396
   }
397 397
   
398 398
    saxonProcessor_object *obj = (saxonProcessor_object *)zend_object_store_get_object(getThis() TSRMLS_CC);
399
    assert (obj != NULL);
399
    assert (obj != nullptr);
400 400
    proc = obj->saxonProcessor;
401
    assert (proc != NULL);
402
    if (proc != NULL) {
401
    assert (proc != nullptr);
402
    if (proc != nullptr) {
403 403
	if (object_init_ex(return_value, xqueryProcessor_ce) != SUCCESS) {
404
            RETURN_NULL();
404
            RETURN_nullptr();
405 405
        } else {
406 406
	   struct xqueryProcessor_object* vobj = (struct xqueryProcessor_object *)zend_object_store_get_object(return_value TSRMLS_CC);
407 407

  
408
            assert (vobj != NULL);
408
            assert (vobj != nullptr);
409 409
	    xqueryProcessor = proc->newXQueryProcessor();
410 410
            vobj->xqueryProcessor = xqueryProcessor;
411 411
     }
412 412
    } else {
413 413
       
414
        RETURN_NULL();
414
        RETURN_nullptr();
415 415
    }
416 416
}
417 417

  
......
422 422
        WRONG_PARAM_COUNT;
423 423
    }
424 424
    SaxonProcessor * proc;
425
    SchemaValidator * schemaValidator = NULL;
425
    SchemaValidator * schemaValidator = nullptr;
426 426
   
427 427
    saxonProcessor_object *obj = (saxonProcessor_object *)zend_object_store_get_object(getThis() TSRMLS_CC);
428
    assert (obj != NULL);
428
    assert (obj != nullptr);
429 429
    proc = obj->saxonProcessor;
430
    assert (proc != NULL);
431
    if (proc != NULL) {
430
    assert (proc != nullptr);
431
    if (proc != nullptr) {
432 432
	if (object_init_ex(return_value, schemaValidator_ce) != SUCCESS) {
433
            RETURN_NULL();
433
            RETURN_nullptr();
434 434
        } else {
435 435
	   struct schemaValidator_object* vobj = (struct schemaValidator_object *)zend_object_store_get_object(return_value TSRMLS_CC);
436
            assert (vobj != NULL);
436
            assert (vobj != nullptr);
437 437
	    schemaValidator = proc->newSchemaValidator();
438
	    if(schemaValidator == NULL){
439
		RETURN_NULL();
438
	    if(schemaValidator == nullptr){
439
		RETURN_nullptr();
440 440
	    }
441 441
            vobj->schemaValidator = schemaValidator;
442 442
	}
443 443
    } else {
444 444
       
445
        RETURN_NULL();
445
        RETURN_nullptr();
446 446
    }
447 447
}
448 448

  
......
455 455
        WRONG_PARAM_COUNT;
456 456
    }
457 457
    saxonProcessor = obj->saxonProcessor;
458
    if (saxonProcessor != NULL) {
458
    if (saxonProcessor != nullptr) {
459 459
        char *str = estrdup(saxonProcessor->version());
460 460
        RETURN_STRING(str, 0);
461 461
    }
462
    RETURN_NULL();
462
    RETURN_nullptr();
463 463
}
464 464

  
465 465

  
......
475 475
    }
476 476

  
477 477
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &name, &len1, &value, &len2) == FAILURE) {
478
        RETURN_NULL();
478
        RETURN_nullptr();
479 479
    }
480 480
    saxonProcessor_object *obj = (saxonProcessor_object *)zend_object_store_get_object(getThis() TSRMLS_CC);
481 481

  
482 482
    saxonProcessor = obj->saxonProcessor;
483
    if (saxonProcessor != NULL && name != NULL && value != NULL) {
483
    if (saxonProcessor != nullptr && name != nullptr && value != nullptr) {
484 484
        saxonProcessor->setConfigurationProperty(name, value);
485 485
    }
486 486
    
......
497 497
    }
498 498

  
499 499
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &libName, &len1) == FAILURE) {
500
        RETURN_NULL();
500
        RETURN_nullptr();
501 501
    }
502 502
    saxonProcessor_object *obj = (saxonProcessor_object *)zend_object_store_get_object(getThis() TSRMLS_CC);
503 503

  
504 504
    saxonProcessor = obj->saxonProcessor;
505
    if (saxonProcessor != NULL && libName != NULL) {
505
    if (saxonProcessor != nullptr && libName != nullptr) {
506 506
        saxonProcessor->setConfigurationProperty("extc", libName);
507 507
    }
508 508
saxonProcessor->registerNativeMethods(SaxonProcessor::sxn_environ->env, "com/saxonica/functions/extfn/cpp/PHPFunctionSet$PhpFunction",
......
533 533
    obj->std.ce = type;
534 534

  
535 535
    ALLOC_HASHTABLE(obj->std.properties);
536
    zend_hash_init(obj->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
536
    zend_hash_init(obj->std.properties, 0, nullptr, ZVAL_PTR_DTOR, 0);
537 537
    object_properties_init(&obj->std, type);
538
    retval.handle = zend_objects_store_put(obj, NULL, XsltProcessor_free_storage, NULL TSRMLS_CC);
538
    retval.handle = zend_objects_store_put(obj, nullptr, XsltProcessor_free_storage, nullptr TSRMLS_CC);
539 539
    retval.handlers = &xsltProcessor_object_handlers;
540 540

  
541 541
    return retval;
......
563 563
    int len1, len2, len3;
564 564

  
565 565
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss", &infilename, &len1, &styleFileName, &len2, &outfileName, &len3) == FAILURE) {
566
        RETURN_NULL();
566
        RETURN_nullptr();
567 567
    }
568 568

  
569 569
    xsltProcessor_object *obj = (xsltProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
570 570
    xsltProcessor = obj->xsltProcessor;
571 571
 
572
    if (xsltProcessor != NULL) {
572
    if (xsltProcessor != nullptr) {
573 573

  
574 574
        xsltProcessor->transformFileToFile(infilename, styleFileName, outfileName);
575 575
        if(xsltProcessor->exceptionOccurred()) {
......
586 586
    int len1, len2;
587 587

  
588 588
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &infilename, &len1, &styleFileName, &len2) == FAILURE) {
589
        RETURN_NULL();
589
        RETURN_nullptr();
590 590
    }
591 591

  
592 592
    xsltProcessor_object *obj = (xsltProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
593 593
    xsltProcessor = obj->xsltProcessor;
594 594
    
595
    if (xsltProcessor != NULL) {
595
    if (xsltProcessor != nullptr) {
596 596

  
597 597
        XdmValue * node = xsltProcessor->transformFileToValue(infilename, styleFileName);
598
        if(node != NULL) {
598
        if(node != nullptr) {
599 599
            if (object_init_ex(return_value, xdmValue_ce) != SUCCESS) {
600
                RETURN_NULL();
600
                RETURN_nullptr();
601 601
            } else {
602 602
                struct xdmValue_object* vobj = (struct xdmValue_object *)zend_object_store_get_object(return_value TSRMLS_CC);
603
                assert (vobj != NULL);
603
                assert (vobj != nullptr);
604 604
                vobj->xdmValue = node;
605 605
            }
606 606
        } else {
......
609 609
	    }
610 610
        }
611 611
    }else {
612
        RETURN_NULL();
612
        RETURN_nullptr();
613 613
    }
614 614
}
615 615

  
......
622 622
    int len1, len2;
623 623

  
624 624
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &infilename, &len1, &styleFileName, &len2) == FAILURE) {
625
        RETURN_NULL();
625
        RETURN_nullptr();
626 626
    }
627 627

  
628 628
    xsltProcessor_object *obj = (xsltProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
629 629
    xsltProcessor = obj->xsltProcessor;
630 630

  
631
    if (xsltProcessor != NULL) {
631
    if (xsltProcessor != nullptr) {
632 632

  
633 633
        const char * result = xsltProcessor->transformFileToString(infilename, styleFileName);
634
	if(result != NULL) {
634
	if(result != nullptr) {
635 635
            char *str = estrdup(result);
636 636
            RETURN_STRING(str, 0);
637 637
        } else if(xsltProcessor->exceptionOccurred()){
638 638
            //TODO: xsltProcessor->checkException();
639 639
            const char * errStr = xsltProcessor->getErrorMessage(0);
640
            if(errStr != NULL) {
640
            if(errStr != nullptr) {
641 641
                const char * errorCode = xsltProcessor->getErrorCode(0);
642
                if(errorCode!=NULL) {
642
                if(errorCode!=nullptr) {
643 643
                    // TODO: throw exception
644 644
                }
645 645
            }
......
662 662
  (JNIEnv *env, jobject object, jstring funcName, jobjectArray arguments, jobjectArray argTypes){
663 663
	JNIEnv *senv = SaxonProcessor::sxn_environ->env;
664 664

  
665
	const char *nativeString = senv->GetStringUTFChars(funcName, NULL);
665
	const char *nativeString = senv->GetStringUTFChars(funcName, nullptr);
666 666

  
667
	if(nativeString == NULL) {
668
		return NULL;	
667
	if(nativeString == nullptr) {
668
		return nullptr;
669 669
	}
670 670

  
671 671
	zval *function_name;
672 672
	zval *retval;
673 673
	
674 674
	int argLength = 0;
675
	zvalArr * php_argv= NULL;
676
	if(arguments != NULL) {
675
	zvalArr * php_argv= nullptr;
676
	if(arguments != nullptr) {
677 677
		argLength = (int)senv->GetArrayLength(arguments);
678 678
		php_argv = new zvalArr[argLength];
679 679
	}
......
681 681
	if(argLength>0) {
682 682
		(*params) = (zval**)malloc(sizeof(zval*) * argLength);
683 683
	} else {
684
		(*params) = NULL;
684
		(*params) = nullptr;
685 685
	}
686 686
	std::map<std::string, saxonTypeEnum> typeMap;
687 687
	typeMap["node"] = enumNode;
......
701 701
		jstring argType = (jstring)senv->GetObjectArrayElement(argTypes, i);
702 702
		jobject argObj = senv->GetObjectArrayElement(arguments, i);
703 703

  
704
		const char * str = senv->GetStringUTFChars(argType,NULL);
705
		const char *stri = NULL;
704
		const char * str = senv->GetStringUTFChars(argType,nullptr);
705
		const char *stri = nullptr;
706 706
		double dnumber = 0;
707 707
		long lnumber = 0;
708 708
		bool bvalue = false;
......
711 711

  
712 712
         
713 713
		struct xdmNode_object* vobj;
714
		XdmNode * node = NULL;
714
		XdmNode * node = nullptr;
715 715
		std::map<std::string, saxonTypeEnum>::iterator it = typeMap.find(str);
716 716
		if (it != typeMap.end()){
717 717
			switch (it->second)
......
726 726
					MAKE_STD_ZVAL(php_argv[i]._val);
727 727
					object_init_ex(php_argv[i]._val, xdmNode_ce);
728 728
   					vobj = (struct xdmNode_object *)zend_object_store_get_object(php_argv[i]._val TSRMLS_CC);
729
                			assert (vobj != NULL);
729
                			assert (vobj != nullptr);
730 730
                			vobj->xdmNode = node;
731 731
					break;
732 732
				case enumString:
733
					stri = senv->GetStringUTFChars((jstring)argObj, NULL);
733
					stri = senv->GetStringUTFChars((jstring)argObj, nullptr);
734 734
					MAKE_STD_ZVAL(php_argv[i]._val);
735 735
					ZVAL_STRING(php_argv[i]._val, stri, 1);
736 736
					break;
......
779 779
	}
780 780
	//note: no implicit type conversion.
781 781

  
782
	zval *argvv = NULL;//xparams;
782
	zval *argvv = nullptr;//xparams;
783 783
	MAKE_STD_ZVAL(function_name);
784 784
	ZVAL_STRING(function_name, nativeString, 1);
785
	if(call_user_function_ex(CG(function_table), NULL, function_name, &retval, argLength, params, 0, NULL TSRMLS_CC) != SUCCESS)
785
	if(call_user_function_ex(CG(function_table), nullptr, function_name, &retval, argLength, params, 0, nullptr TSRMLS_CC) != SUCCESS)
786 786
	{
787 787
 	   zend_error(E_ERROR, "Function call failed");
788 788
	}
......
790 790

  
791 791

  
792 792
	if(Z_TYPE(*retval) ==0){
793
		zend_error(E_ERROR, "Function returned null");
793
		zend_error(E_ERROR, "Function returned nullptr");
794 794
	}
795 795

  
796
	char * sVal = NULL;
796
	char * sVal = nullptr;
797 797
	int len = 0;
798
	jobject obj = NULL;
798
	jobject obj = nullptr;
799 799
	std::cerr<<" Return type="<<Z_TYPE_P(retval)<<std::endl;
800 800
//TODO handle XdmValue wrapped object
801
const char * objName = NULL;
802
xdmNode_object* ooth = NULL;
801
const char * objName = nullptr;
802
xdmNode_object* ooth = nullptr;
803 803
	switch (Z_TYPE_P(retval)) {
804 804
            case IS_BOOL:
805 805
                obj= booleanValue(*SaxonProcessor::sxn_environ, Z_BVAL_P(retval));
......
814 814
		obj = getJavaStringValue(*SaxonProcessor::sxn_environ,estrndup(sVal, len)); 
815 815
                break;
816 816
            break;
817
            case IS_NULL:
817
            case IS_nullptr:
818 818
                
819 819
            	break;
820 820
            case IS_DOUBLE:
......
829 829

  
830 830
      		if(strcmp(objName, "Saxon\\XdmNode")==0) {
831 831
			ooth = (xdmNode_object*)zend_object_store_get_object(retval TSRMLS_CC);
832
        		if(ooth != NULL) {
833
            			obj = ooth->xdmNode->getUnderlyingValue(NULL);
832
        		if(ooth != nullptr) {
833
            			obj = ooth->xdmNode->getUnderlyingValue(nullptr);
834 834
            	
835 835
        		}
836 836
      		}
837 837
		break;
838 838
            default:
839
                obj = NULL;
839
                obj = nullptr;
840 840
                zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Unknown type specified in extension function", 0 TSRMLS_CC);
841 841
        }
842 842

  
......
870 870

  
871 871
MAKE_STD_ZVAL(function_name);
872 872
ZVAL_STRING(function_name, str, 1);
873
if(call_user_function_ex(CG(function_table), NULL, function_name, &retval, 0, NULL, 0, NULL TSRMLS_CC) != SUCCESS)
873
if(call_user_function_ex(CG(function_table), nullptr, function_name, &retval, 0, nullptr, 0, nullptr TSRMLS_CC) != SUCCESS)
874 874
{
875 875
    zend_error(E_ERROR, "Function call failed");
876 876
}
877 877

  
878 878
if(Z_TYPE(*retval) ==0){
879
zend_error(E_ERROR, "DATAYYY is NULL");
879
zend_error(E_ERROR, "DATAYYY is nullptr");
880 880
}else {
881 881
str = Z_STRVAL_P(retval);
882 882
zend_printf("DATAYYY= %i <br>", str);
......
893 893
    xsltProcessor_object *obj = (xsltProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
894 894
    xsltProcessor = obj->xsltProcessor;
895 895

  
896
    if (xsltProcessor != NULL) {
896
    if (xsltProcessor != nullptr) {
897 897

  
898 898
        const char * result = xsltProcessor->transformToString();
899
        if(result != NULL) {
899
        if(result != nullptr) {
900 900
            char *str = estrdup(result);
901 901
            RETURN_STRING(str, 0);
902 902
        } else if(xsltProcessor->exceptionOccurred()){
903 903
            xsltProcessor->checkException();
904 904
            const char * errStr = xsltProcessor->getErrorMessage(0);
905
            if(errStr != NULL) {
905
            if(errStr != nullptr) {
906 906
                const char * errorCode = xsltProcessor->getErrorCode(0);
907
                if(errorCode!=NULL) {
907
                if(errorCode!=nullptr) {
908 908
                    // TODO: throw exception
909 909
                }
910 910
            }
911 911
        }
912 912
    }
913
    RETURN_NULL();
913
    RETURN_nullptr();
914 914
}
915 915

  
916 916
PHP_METHOD(XsltProcessor, transformToValue)
......
924 924
    xsltProcessor_object *obj = (xsltProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
925 925
    xsltProcessor = obj->xsltProcessor;
926 926

  
927
    if (xsltProcessor != NULL) {
927
    if (xsltProcessor != nullptr) {
928 928

  
929 929
	XdmValue * node = xsltProcessor->transformToValue();
930
        if(node != NULL) {
930
        if(node != nullptr) {
931 931
            if (object_init_ex(return_value, xdmValue_ce) != SUCCESS) {
932
                RETURN_NULL();
932
                RETURN_nullptr();
933 933
            } else {
934 934
                struct xdmValue_object* vobj = (struct xdmValue_object *)zend_object_store_get_object(return_value TSRMLS_CC);
935
                assert (vobj != NULL);
935
                assert (vobj != nullptr);
936 936
                vobj->xdmValue = node;
937 937
            }
938 938
        } else if(xsltProcessor->exceptionOccurred()){
939 939
            xsltProcessor->checkException();
940 940
        }
941 941
    } else {
942
        RETURN_NULL();
942
        RETURN_nullptr();
943 943
    }
944 944
}
945 945

  
......
954 954
    xsltProcessor_object *obj = (xsltProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
955 955
    xsltProcessor = obj->xsltProcessor;
956 956

  
957
    if (xsltProcessor != NULL) {
957
    if (xsltProcessor != nullptr) {
958 958

  
959 959
	xsltProcessor->transformToFile();
960 960
        if(xsltProcessor->exceptionOccurred()) {
......
962 962
            const char * exStr = xsltProcessor->checkException();
963 963
        }
964 964
    } else {
965
        RETURN_NULL();
965
        RETURN_nullptr();
966 966
    }
967 967
}
968 968

  
......
973 973
    int len1;
974 974

  
975 975
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &len1) == FAILURE) {
976
        RETURN_NULL();
976
        RETURN_nullptr();
977 977
    }
978 978
    xsltProcessor_object *obj = (xsltProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
979 979
    xsltProcessor = obj->xsltProcessor;
980
    if (xsltProcessor != NULL) {
980
    if (xsltProcessor != nullptr) {
981 981
        xsltProcessor->compileFromFile(name);
982 982
    }
983 983
}
......
988 988
    char * stylesheetStr;
989 989
    int len1, myint;
990 990
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &stylesheetStr, &len1) == FAILURE) {
991
        RETURN_NULL();
991
        RETURN_nullptr();
992 992
    }
993 993
    xsltProcessor_object *obj = (xsltProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
994 994
    xsltProcessor = obj->xsltProcessor;
995
    if (xsltProcessor != NULL) {
995
    if (xsltProcessor != nullptr) {
996 996
        xsltProcessor->compileFromString(stylesheetStr);
997 997
    }
998 998
}
......
1003 1003
   zval* oth;
1004 1004

  
1005 1005
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &oth, xdmValue_ce) == FAILURE) {
1006
        RETURN_NULL();
1006
        RETURN_nullptr();
1007 1007
    }
1008 1008
    xsltProcessor_object *obj = (xsltProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
1009 1009
    xsltProcessor = obj->xsltProcessor;
1010
    if (xsltProcessor != NULL) {
1010
    if (xsltProcessor != nullptr) {
1011 1011
 	xdmValue_object* ooth = (xdmValue_object*)zend_object_store_get_object(oth TSRMLS_CC);
1012
        if(ooth != NULL) {
1012
        if(ooth != nullptr) {
1013 1013
            XdmValue * value = ooth->xdmValue;
1014
            if(value != NULL && value->size() == 1 && (value->getHead())->getType() == 3) {
1014
            if(value != nullptr && value->size() == 1 && (value->getHead())->getType() == 3) {
1015 1015
        	xsltProcessor->compileFromXdmNode((XdmNode*)(value->getHead()));
1016 1016
	    }
1017 1017
	}
......
1024 1024
PHP_METHOD(XsltProcessor, setSourceFromXdmValue)
1025 1025
{
1026 1026
    XsltProcessor *xsltProcessor;
1027
    zval* oth = NULL;
1027
    zval* oth = nullptr;
1028 1028

  
1029 1029
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &oth) == FAILURE) {
1030
        RETURN_NULL();
1030
        RETURN_nullptr();
1031 1031
    }
1032 1032

  
1033 1033
    xsltProcessor_object *obj = (xsltProcessor_object *)zend_object_store_get_object(getThis() TSRMLS_CC);
1034 1034
    xsltProcessor = obj->xsltProcessor;
1035
    if (xsltProcessor != NULL) {
1035
    if (xsltProcessor != nullptr) {
1036 1036

  
1037 1037
    if(!oth) {
1038 1038
	php_error(E_WARNING, "Error setting source value");
......
1044 1044

  
1045 1045
      if(strcmp(objName, "Saxon\\XdmNode")==0) {
1046 1046
	xdmNode_object* ooth = (xdmNode_object*)zend_object_store_get_object(oth TSRMLS_CC);
1047
        if(ooth != NULL) {
1047
        if(ooth != nullptr) {
1048 1048
            XdmNode * value = ooth->xdmNode;
1049
            if(value != NULL) {	
1049
            if(value != nullptr) {
1050 1050
		XdmItem  *valueX = (XdmItem*)value;
1051 1051
	        xsltProcessor->setSourceFromXdmValue(valueX);
1052 1052

  
......
1054 1054
        }
1055 1055
      } else if(strcmp(objName, "Saxon\\XdmValue")==0) {
1056 1056
	xdmValue_object* ooth = (xdmValue_object*)zend_object_store_get_object(oth TSRMLS_CC);
1057
        if(ooth != NULL) {
1057
        if(ooth != nullptr) {
1058 1058
            XdmValue * value = ooth->xdmValue;
1059
            if(value != NULL) {
1059
            if(value != nullptr) {
1060 1060
	        xsltProcessor->setSourceFromXdmValue((XdmItem*)value);
1061 1061
            }
1062 1062
        }
......
1074 1074
    int len1;
1075 1075

  
1076 1076
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &outputFilename, &len1, xdmValue_ce) == FAILURE) {
1077
        RETURN_NULL();
1077
        RETURN_nullptr();
1078 1078
    }
1079 1079

  
1080 1080
    xsltProcessor_object *obj = (xsltProcessor_object *)zend_object_store_get_object(getThis() TSRMLS_CC);
1081 1081
    xsltProcessor = obj->xsltProcessor;
1082
    if (xsltProcessor != NULL && outputFilename != NULL) {
1082
    if (xsltProcessor != nullptr && outputFilename != nullptr) {
1083 1083
        
1084 1084
	 xsltProcessor->setOutputFile(outputFilename);
1085 1085
            
......
1094 1094
    int len1;
1095 1095

  
1096 1096
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &inFilename, &len1, xdmValue_ce) == FAILURE) {
1097
        RETURN_NULL();
1097
        RETURN_nullptr();
1098 1098
    }
1099 1099

  
1100 1100
    xsltProcessor_object *obj = (xsltProcessor_object *)zend_object_store_get_object(getThis() TSRMLS_CC);
1101 1101
    xsltProcessor = obj->xsltProcessor;
1102
    if (xsltProcessor != NULL && inFilename != NULL) {
1102
    if (xsltProcessor != nullptr && inFilename != nullptr) {
1103 1103
        
1104 1104
	 xsltProcessor->setSourceFromFile(inFilename);
1105 1105
            
......
1116 1116
    int len1, len2, myint;
1117 1117

  
1118 1118
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &name, &len1, &value, &len2) == FAILURE) {
1119
        RETURN_NULL();
1119
        RETURN_nullptr();
1120 1120
    }
1121 1121
    xsltProcessor_object *obj = (xsltProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
1122 1122
    xsltProcessor = obj->xsltProcessor;
1123
    if (xsltProcessor != NULL) {
1123
    if (xsltProcessor != nullptr) {
1124 1124
        xsltProcessor->setProperty(name, value);
1125 1125
    }
1126 1126
}
......
1133 1133
   zval* oth;
1134 1134
   int len1, len2, myint;	
1135 1135
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz", &name, &len2, &oth) == FAILURE) {
1136
        RETURN_NULL();
1136
        RETURN_nullptr();
1137 1137
    }
1138 1138
    xsltProcessor_object *obj = (xsltProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
1139 1139
    xsltProcessor = obj->xsltProcessor;
1140
    if (xsltProcessor != NULL) {
1140
    if (xsltProcessor != nullptr) {
1141 1141

  
1142 1142

  
1143 1143
      const char * objName =Z_OBJCE_P(oth)->name;
......
1145 1145

  
1146 1146
      if(strcmp(objName, "Saxon\\XdmNode")==0) {
1147 1147
	xdmNode_object* ooth = (xdmNode_object*)zend_object_store_get_object(oth TSRMLS_CC);
1148
        if(ooth != NULL) {
1148
        if(ooth != nullptr) {
1149 1149
            XdmNode * value = ooth->xdmNode;
1150
            if(value != NULL) {	
1150
            if(value != nullptr) {
1151 1151
	        xsltProcessor->setParameter(name, (XdmValue *)value);
1152 1152

  
1153 1153
            }
1154 1154
        }
1155 1155
      } else if(strcmp(objName, "Saxon\\XdmValue")==0){
1156 1156
	xdmValue_object* ooth = (xdmValue_object*) zend_object_store_get_object(oth TSRMLS_CC);
1157
        if(ooth != NULL) {
1157
        if(ooth != nullptr) {
1158 1158
            XdmValue * value = ooth->xdmValue;
1159
            if(value != NULL) {
1159
            if(value != nullptr) {
1160 1160
		
1161 1161
                xsltProcessor->setParameter(name, value);
1162 1162
            }
......
1166 1166

  
1167 1167
      } else if(strcmp(objName, "Saxon\\XdmAtomicValue")==0){
1168 1168
	xdmAtomicValue_object* ooth = (xdmAtomicValue_object*) zend_object_store_get_object(oth TSRMLS_CC);
1169
        if(ooth != NULL) {
1169
        if(ooth != nullptr) {
1170 1170
            XdmAtomicValue * value = ooth->xdmAtomicValue;
1171
            if(value != NULL) {
1171
            if(value != nullptr) {
1172 1172
		
1173 1173
                xsltProcessor->setParameter(name, (XdmValue *)value);
1174 1174
            }
......
1190 1190

  
1191 1191
    xsltProcessor_object *obj = (xsltProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
1192 1192
    xsltProcessor = obj->xsltProcessor;
1193
    if (xsltProcessor != NULL) {
1193
    if (xsltProcessor != nullptr) {
1194 1194
        xsltProcessor->clearParameters(true);
1195 1195
    }
1196 1196
}
......
1204 1204

  
1205 1205
    xsltProcessor_object *obj = (xsltProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
1206 1206
    xsltProcessor = obj->xsltProcessor;
1207
    if (xsltProcessor != NULL) {
1207
    if (xsltProcessor != nullptr) {
1208 1208
        xsltProcessor->clearProperties();
1209 1209
    }
1210 1210
}
......
1218 1218
    }
1219 1219

  
1220 1220
    xsltProcessor = obj->xsltProcessor;
1221
    if (xsltProcessor != NULL) {
1221
    if (xsltProcessor != nullptr) {
1222 1222
        bool result = xsltProcessor->exceptionOccurred();
1223 1223
        RETURN_BOOL(result);
1224 1224
    }
......
1234 1234
    }
1235 1235

  
1236 1236
    xsltProcessor = obj->xsltProcessor;
1237
    if (xsltProcessor != NULL) {
1237
    if (xsltProcessor != nullptr) {
1238 1238
        int count = xsltProcessor->exceptionCount();
1239 1239
        RETURN_LONG(count);
1240 1240
    }
......
1246 1246
    XsltProcessor *xsltProcessor;
1247 1247
    long index;
1248 1248
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &index) == FAILURE) {
1249
        RETURN_NULL();
1249
        RETURN_nullptr();
1250 1250
    }
1251 1251
    xsltProcessor_object *obj = (xsltProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
1252 1252
    xsltProcessor = obj->xsltProcessor;
1253
    if (xsltProcessor != NULL) {
1253
    if (xsltProcessor != nullptr) {
1254 1254
        const char * errCode = xsltProcessor->getErrorCode((int)index);
1255
        if(errCode != NULL) {
1255
        if(errCode != nullptr) {
1256 1256
            char *str = estrdup(errCode);
1257 1257
            RETURN_STRING(str, 0);
1258 1258
        }
1259 1259
    }
1260
    RETURN_NULL();
1260
    RETURN_nullptr();
1261 1261
}
1262 1262

  
1263 1263
PHP_METHOD(XsltProcessor, getErrorMessage)
......
1265 1265
    XsltProcessor *xsltProcessor;
1266 1266
    long index;
1267 1267
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &index) == FAILURE) {
1268
        RETURN_NULL();
1268
        RETURN_nullptr();
1269 1269
    }
1270 1270
    xsltProcessor_object *obj = (xsltProcessor_object *)zend_object_store_get_object(getThis() TSRMLS_CC);
1271 1271
    xsltProcessor = obj->xsltProcessor;
1272
    if (xsltProcessor != NULL) {
1272
    if (xsltProcessor != nullptr) {
1273 1273
        const char * errStr = xsltProcessor->getErrorMessage((int)index);
1274
        if(errStr != NULL) {
1274
        if(errStr != nullptr) {
1275 1275
            char *str = estrdup(errStr);
1276 1276
            RETURN_STRING(str, 0);
1277 1277
        }
1278 1278
    }
1279
    RETURN_NULL();
1279
    RETURN_nullptr();
1280 1280
}
1281 1281
PHP_METHOD(XsltProcessor, exceptionClear)
1282 1282
{
1283 1283
    XsltProcessor *xsltProcessor;
1284 1284
    xsltProcessor_object *obj = (xsltProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
1285 1285
    xsltProcessor = obj->xsltProcessor;
1286
    if (xsltProcessor != NULL) {
1286
    if (xsltProcessor != nullptr) {
1287 1287
        xsltProcessor->exceptionClear();
1288 1288
    }
1289 1289
}
......
1312 1312
    obj->std.ce = type;
1313 1313

  
1314 1314
    ALLOC_HASHTABLE(obj->std.properties);
1315
    zend_hash_init(obj->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
1315
    zend_hash_init(obj->std.properties, 0, nullptr, ZVAL_PTR_DTOR, 0);
1316 1316
    object_properties_init(&obj->std, type);
1317
    retval.handle = zend_objects_store_put(obj, NULL, xqueryProcessor_free_storage, NULL TSRMLS_CC);
1317
    retval.handle = zend_objects_store_put(obj, nullptr, xqueryProcessor_free_storage, nullptr TSRMLS_CC);
1318 1318
    retval.handlers = &xqueryProcessor_object_handlers;
1319 1319

  
1320 1320
    return retval;
......
1343 1343

  
1344 1344
    xqueryProcessor = obj->xqueryProcessor;
1345 1345

  
1346
    if (xqueryProcessor != NULL) {
1346
    if (xqueryProcessor != nullptr) {
1347 1347
        XdmValue * node = xqueryProcessor->runQueryToValue();
1348
        if(node != NULL) {
1348
        if(node != nullptr) {
1349 1349
            if (object_init_ex(return_value, xdmValue_ce) != SUCCESS) {
1350
                RETURN_NULL();
1350
                RETURN_nullptr();
1351 1351
                return;
1352 1352
            } else {
1353 1353
                struct xdmValue_object* vobj = (struct xdmValue_object *)zend_object_store_get_object(return_value TSRMLS_CC);
1354
                assert (vobj != NULL);
1354
                assert (vobj != nullptr);
1355 1355
                vobj->xdmValue = node;
1356 1356
                return;
1357 1357
            }
1358 1358
        }
1359 1359
        xqueryProcessor->checkException();//TODO
1360 1360
    } else {
1361
        RETURN_NULL();
1361
        RETURN_nullptr();
1362 1362
    }
1363 1363
}
1364 1364

  
......
1373 1373

  
1374 1374
    xqueryProcessor = obj->xqueryProcessor;
1375 1375

  
1376
    if (xqueryProcessor != NULL) {
1376
    if (xqueryProcessor != nullptr) {
1377 1377
        const char * result = xqueryProcessor->runQueryToString();
1378
        if(result != NULL) {
1378
        if(result != nullptr) {
1379 1379
            char *str = estrdup(result);
1380 1380
            RETURN_STRING(str, 0);
1381 1381
	    return;
......
1383 1383
          xqueryProcessor->checkException(); //TODO
1384 1384
	}
1385 1385
    }
1386
   RETURN_NULL();
1386
   RETURN_nullptr();
1387 1387
}
1388 1388

  
1389 1389
PHP_METHOD(XQueryProcessor, runQueryToFile)
......
1395 1395
        WRONG_PARAM_COUNT;
1396 1396
    }
1397 1397
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &ofilename, &len1) == FAILURE) {
1398
        RETURN_NULL();
1398
        RETURN_nullptr();
1399 1399
    }
1400 1400
    XQueryProcessor *xqueryProcessor;
1401 1401
    xqueryProcessor_object *obj = (xqueryProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
......
1404 1404

  
1405 1405
    xqueryProcessor = obj->xqueryProcessor;
1406 1406

  
1407
    if (xqueryProcessor != NULL) {
1408
	if(ofilename != NULL) {
1407
    if (xqueryProcessor != nullptr) {
1408
	if(ofilename != nullptr) {
1409 1409
		xqueryProcessor->setOutputFile(ofilename);	
1410 1410
	}
1411 1411
        xqueryProcessor->runQueryToFile(); 
......
1419 1419
    int len1;
1420 1420

  
1421 1421
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &queryStr, &len1) == FAILURE) {
1422
        RETURN_NULL();
1422
        RETURN_nullptr();
1423 1423
    }
1424 1424
    xqueryProcessor_object *obj = (xqueryProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC); 
1425
    if(queryStr != NULL) { 
1425
    if(queryStr != nullptr) {
1426 1426
      obj->xqueryProcessor->setProperty("qs", queryStr);
1427 1427
   }
1428 1428
}
......
1434 1434
    XQueryProcessor *xqueryProcessor;
1435 1435

  
1436 1436
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &fileName, &len1) == FAILURE) {
1437
        RETURN_NULL();
1437
        RETURN_nullptr();
1438 1438
    }
1439
    if(fileName != NULL) {
1439
    if(fileName != nullptr) {
1440 1440
    	xqueryProcessor_object *obj = (xqueryProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
1441 1441
    	xqueryProcessor = obj->xqueryProcessor;
1442 1442
    	xqueryProcessor->setQueryFile(fileName);
......
1451 1451
    XQueryProcessor *xqueryProcessor;
1452 1452

  
1453 1453
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &base, &len1) == FAILURE) {
1454
        RETURN_NULL();
1454
        RETURN_nullptr();
1455 1455
    }
1456
    if(base != NULL) {
1456
    if(base != nullptr) {
1457 1457
    	xqueryProcessor_object *obj = (xqueryProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
1458 1458
    	xqueryProcessor = obj->xqueryProcessor;
1459 1459
    	xqueryProcessor->setQueryBaseURI(base);
......
1469 1469
    XQueryProcessor *xqueryProcessor;
1470 1470

  
1471 1471
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &prefix, &len1, &ns, &len2) == FAILURE) {
1472
        RETURN_NULL();
1472
        RETURN_nullptr();
1473 1473
    }
1474
    if(prefix != NULL && ns != NULL) {
1474
    if(prefix != nullptr && ns != nullptr) {
1475 1475
    	xqueryProcessor_object *obj = (xqueryProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
1476 1476
    	xqueryProcessor = obj->xqueryProcessor;
1477 1477
    	xqueryProcessor->declareNamespace(prefix, ns);
......
1489 1489
    XQueryProcessor *xqueryProcessor;
1490 1490

  
1491 1491
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &oth) == FAILURE) {
1492
        RETURN_NULL();
1492
        RETURN_nullptr();
1493 1493
    }
1494
    if(oth != NULL) {
1494
    if(oth != nullptr) {
1495 1495
    	xqueryProcessor_object *obj = (xqueryProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
1496 1496
    	xqueryProcessor = obj->xqueryProcessor;
1497 1497
    const char * objName =Z_OBJCE_P(oth)->name;
......
1499 1499

  
1500 1500
      if(strcmp(objName, "Saxon\\XdmNode")==0) {
1501 1501
	xdmNode_object* ooth = (xdmNode_object*)zend_object_store_get_object(oth TSRMLS_CC);
1502
        if(ooth != NULL) {
1502
        if(ooth != nullptr) {
1503 1503
            XdmNode * value = ooth->xdmNode;
1504
            if(value != NULL) {	
1504
            if(value != nullptr) {
1505 1505
	        xqueryProcessor->setContextItem((XdmItem *)value);
1506 1506
	        return;
1507 1507
            }
1508 1508
        }
1509 1509
      } else if(strcmp(objName, "Saxon\\XdmItem")==0){
1510 1510
	xdmItem_object* ooth = (xdmItem_object*) zend_object_store_get_object(oth TSRMLS_CC);
1511
        if(ooth != NULL) {
1511
        if(ooth != nullptr) {
1512 1512
            XdmItem * value = ooth->xdmItem;
1513
	    if(value != NULL) {	
1513
	    if(value != nullptr) {
1514 1514
                xqueryProcessor->setContextItem(value);
1515 1515
		return;
1516 1516
	    }
......
1521 1521

  
1522 1522
      } else if(strcmp(objName, "Saxon\\XdmAtomicValue")==0){
1523 1523
	xdmAtomicValue_object* ooth = (xdmAtomicValue_object*) zend_object_store_get_object(oth TSRMLS_CC);
1524
        if(ooth != NULL) {
1524
        if(ooth != nullptr) {
1525 1525
            XdmAtomicValue * value = ooth->xdmAtomicValue;
1526
            if(value != NULL) {
1526
            if(value != nullptr) {
1527 1527
		
1528 1528
                xqueryProcessor->setContextItem((XdmItem *)value);
1529 1529
		return;
......
1538 1538

  
1539 1539

  
1540 1540
	/*xdmItem_object* ooth = (xdmItem_object*) zend_object_store_get_object(oth TSRMLS_CC);
1541
        if(ooth != NULL) {
1541
        if(ooth != nullptr) {
1542 1542
            XdmItem * value = ooth->xdmItem;
1543
            if(value != NULL) {
1543
            if(value != nullptr) {
1544 1544
    		xqueryProcessor->setContextItem(value);
1545 1545
	    }
1546 1546
	}*/
......
1558 1558
    XQueryProcessor *xqueryProcessor;
1559 1559

  
1560 1560
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &cfilename, &len1) == FAILURE) {
1561
        RETURN_NULL();
1561
        RETURN_nullptr();
1562 1562
    }
1563
    if(cfilename != NULL) {
1563
    if(cfilename != nullptr) {
1564 1564
    	xqueryProcessor_object *obj = (xqueryProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
1565 1565
    	xqueryProcessor = obj->xqueryProcessor;
1566 1566
    	xqueryProcessor->setContextItemFromFile(cfilename);
......
1577 1577
    int len1, len2, myint;
1578 1578

  
1579 1579
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &name, &len1, &value, &len2) == FAILURE) {
1580
        RETURN_NULL();
1580
        RETURN_nullptr();
1581 1581
    }
1582 1582
    xqueryProcessor_object *obj = (xqueryProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
1583 1583
    xqueryProcessor = obj->xqueryProcessor;
1584
    if (xqueryProcessor != NULL) {
1584
    if (xqueryProcessor != nullptr) {
1585 1585
        xqueryProcessor->setProperty(name, value);
1586 1586
    }
1587 1587
}
......
1594 1594
   zval* oth;
1595 1595
   int len1, len2, myint;	
1596 1596
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz", &name, &len2, &oth) == FAILURE) {
1597
        RETURN_NULL();
1597
        RETURN_nullptr();
1598 1598
    }
1599 1599
    xqueryProcessor_object *obj = (xqueryProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
1600 1600
    xqueryProcessor = obj->xqueryProcessor;
1601
    if (xqueryProcessor != NULL) {
1601
    if (xqueryProcessor != nullptr) {
1602 1602
             const char * objName =Z_OBJCE_P(oth)->name;
1603 1603
      //std::cout<<"test type:"<<(Z_OBJCE_P(oth)->name)<<std::endl;
1604 1604

  
1605 1605
      if(strcmp(objName, "Saxon\\XdmNode")==0) {
1606 1606
	xdmNode_object* ooth = (xdmNode_object*)zend_object_store_get_object(oth TSRMLS_CC);
1607
        if(ooth != NULL) {
1607
        if(ooth != nullptr) {
1608 1608
            XdmNode * value = ooth->xdmNode;
1609
            if(value != NULL) {	
1609
            if(value != nullptr) {
1610 1610
	        xqueryProcessor->setParameter(name, (XdmValue *)value);
1611 1611

  
1612 1612
            }
1613 1613
        }
1614 1614
      } else if(strcmp(objName, "Saxon\\XdmValue")==0){
1615 1615
	xdmValue_object* ooth = (xdmValue_object*) zend_object_store_get_object(oth TSRMLS_CC);
1616
        if(ooth != NULL) {
1616
        if(ooth != nullptr) {
1617 1617
            XdmValue * value = ooth->xdmValue;
1618
            if(value != NULL) {
1618
            if(value != nullptr) {
1619 1619
		
1620 1620
                xqueryProcessor->setParameter(name, value);
1621 1621
            }
......
1625 1625

  
1626 1626
      } else if(strcmp(objName, "Saxon\\XdmAtomicValue")==0){
1627 1627
	xdmAtomicValue_object* ooth = (xdmAtomicValue_object*) zend_object_store_get_object(oth TSRMLS_CC);
1628
        if(ooth != NULL) {
1628
        if(ooth != nullptr) {
1629 1629
            XdmAtomicValue * value = ooth->xdmAtomicValue;
1630
            if(value != NULL) {
1630
            if(value != nullptr) {
1631 1631
		
1632 1632
                xqueryProcessor->setParameter(name, (XdmValue *)value);
1633 1633
            } 
......
1652 1652

  
1653 1653
    xqueryProcessor_object *obj = (xqueryProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
1654 1654
    xqueryProcessor = obj->xqueryProcessor;
1655
    if (xqueryProcessor != NULL) {
1655
    if (xqueryProcessor != nullptr) {
1656 1656
        xqueryProcessor->clearParameters(true);
1657 1657
    }
1658 1658
}
......
1667 1667

  
1668 1668
    xqueryProcessor_object *obj = (xqueryProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
1669 1669
    xqueryProcessor = obj->xqueryProcessor;
1670
    if (xqueryProcessor != NULL) {
1670
    if (xqueryProcessor != nullptr) {
1671 1671
        xqueryProcessor->clearProperties();
1672 1672
    }
1673 1673
}
......
1681 1681
    }
1682 1682

  
1683 1683
    xqueryProcessor = obj->xqueryProcessor;
1684
    if (xqueryProcessor != NULL) {
1684
    if (xqueryProcessor != nullptr) {
1685 1685
        bool result = xqueryProcessor->exceptionOccurred();
1686 1686
        RETURN_BOOL(result);
1687 1687
    }
......
1697 1697
    }
1698 1698

  
1699 1699
    xqueryProcessor = obj->xqueryProcessor;
1700
    if (xqueryProcessor != NULL) {
1700
    if (xqueryProcessor != nullptr) {
1701 1701
        int count = xqueryProcessor->exceptionCount();
1702 1702
        RETURN_LONG(count);
1703 1703
    }
......
1709 1709
    XQueryProcessor *xqueryProcessor;
1710 1710
    long index;
1711 1711
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &index) == FAILURE) {
1712
        RETURN_NULL();
1712
        RETURN_nullptr();
1713 1713
    }
1714 1714
    xqueryProcessor_object *obj = (xqueryProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
1715 1715
    xqueryProcessor = obj->xqueryProcessor;
1716
    if (xqueryProcessor != NULL) {
1716
    if (xqueryProcessor != nullptr) {
1717 1717
        const char * errCode = xqueryProcessor->getErrorCode((int)index);
1718
        if(errCode != NULL) {
1718
        if(errCode != nullptr) {
1719 1719
            char *str = estrdup(errCode);
1720 1720
            RETURN_STRING(str, 0);
1721 1721
        }
1722 1722
    }
1723
    RETURN_NULL();
1723
    RETURN_nullptr();
1724 1724
}
1725 1725

  
1726 1726
PHP_METHOD(XQueryProcessor, getErrorMessage)
......
1728 1728
    XQueryProcessor *xqueryProcessor;
1729 1729
    long index;
1730 1730
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &index) == FAILURE) {
1731
        RETURN_NULL();
1731
        RETURN_nullptr();
1732 1732
    }
1733 1733
    xqueryProcessor_object *obj = (xqueryProcessor_object *)zend_object_store_get_object(getThis() TSRMLS_CC);
1734 1734
    xqueryProcessor = obj->xqueryProcessor;
1735
    if (xqueryProcessor != NULL) {
1735
    if (xqueryProcessor != nullptr) {
1736 1736
        const char * errStr = xqueryProcessor->getErrorMessage((int)index);
1737
        if(errStr != NULL) {
1737
        if(errStr != nullptr) {
1738 1738
            char *str = estrdup(errStr);
1739 1739
            RETURN_STRING(str, 0);
1740 1740
        }
1741 1741
    }
1742
    RETURN_NULL();
1742
    RETURN_nullptr();
1743 1743
}
1744 1744
PHP_METHOD(XQueryProcessor, exceptionClear)
1745 1745
{
1746 1746
    XQueryProcessor *xqueryProcessor;
1747 1747
    xqueryProcessor_object *obj = (xqueryProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
1748 1748
    xqueryProcessor = obj->xqueryProcessor;
1749
    if (xqueryProcessor != NULL) {
1749
    if (xqueryProcessor != nullptr) {
1750 1750
        xqueryProcessor->exceptionClear();
1751 1751
    }
1752 1752
}
......
1781 1781
    obj->std.ce = type;
1782 1782

  
1783 1783
    ALLOC_HASHTABLE(obj->std.properties);
1784
    zend_hash_init(obj->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
1784
    zend_hash_init(obj->std.properties, 0, nullptr, ZVAL_PTR_DTOR, 0);
1785 1785
    object_properties_init(&obj->std, type);
1786 1786

  
1787
    retval.handle = zend_objects_store_put(obj, NULL, xpathProcessor_free_storage, NULL TSRMLS_CC);
1787
    retval.handle = zend_objects_store_put(obj, nullptr, xpathProcessor_free_storage, nullptr TSRMLS_CC);
1788 1788
    retval.handlers = &xpathProcessor_object_handlers;
1789 1789

  
1790 1790
    return retval;
......
1800 1800
    int len1, len2;
1801 1801

  
1802 1802
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &name, &len1, &value, &len2) == FAILURE) {
1803
        RETURN_NULL();
1803
        RETURN_nullptr();
1804 1804
    }
1805 1805
    xpathProcessor_object *obj = (xpathProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
1806 1806
    xpathProcessor = obj->xpathProcessor;
1807
    if (xpathProcessor != NULL) {
1807
    if (xpathProcessor != nullptr) {
1808 1808
        xpathProcessor->setProperty(name, value);
1809 1809
    }
1810 1810
}
......
1817 1817
   zval* oth;
1818 1818
   int len1, len2;	
1819 1819
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz", &name, &len2, &oth) == FAILURE) {
1820
        RETURN_NULL();
1820
        RETURN_nullptr();
1821 1821
    }
1822 1822
    xpathProcessor_object *obj = (xpathProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
1823 1823
    xpathProcessor = obj->xpathProcessor;
1824
    if (xpathProcessor != NULL) {
1824
    if (xpathProcessor != nullptr) {
1825 1825
            const char * objName =Z_OBJCE_P(oth)->name;
1826 1826
      //std::cout<<"test type:"<<(Z_OBJCE_P(oth)->name)<<std::endl;
1827 1827

  
1828 1828
      if(strcmp(objName, "Saxon\\XdmNode")==0) {
1829 1829
	xdmNode_object* ooth = (xdmNode_object*)zend_object_store_get_object(oth TSRMLS_CC);
1830
        if(ooth != NULL) {
1830
        if(ooth != nullptr) {
1831 1831
            XdmNode * value = ooth->xdmNode;
1832
            if(value != NULL) {	
1832
            if(value != nullptr) {
1833 1833
	        xpathProcessor->setParameter(name, (XdmValue *)value);
1834 1834

  
1835 1835
            }
1836 1836
        }
1837 1837
      } else if(strcmp(objName, "Saxon\\XdmValue")==0){
1838 1838
	xdmValue_object* ooth = (xdmValue_object*) zend_object_store_get_object(oth TSRMLS_CC);
1839
        if(ooth != NULL) {
1839
        if(ooth != nullptr) {
1840 1840
            XdmValue * value = ooth->xdmValue;
1841
            if(value != NULL) {
1841
            if(value != nullptr) {
1842 1842
		
1843 1843
                xpathProcessor->setParameter(name, value);
1844 1844
            }
......
1848 1848

  
1849 1849
      } else if(strcmp(objName, "Saxon\\XdmAtomicValue")==0){
1850 1850
	xdmAtomicValue_object* ooth = (xdmAtomicValue_object*) zend_object_store_get_object(oth TSRMLS_CC);
1851
        if(ooth != NULL) {
1851
        if(ooth != nullptr) {
1852 1852
            XdmAtomicValue * value = ooth->xdmAtomicValue;
1853
            if(value != NULL) {
1853
            if(value != nullptr) {
1854 1854
		
1855 1855
                xpathProcessor->setParameter(name, (XdmValue *)value);
1856 1856
            }
......
1871 1871
   XPathProcessor *xpathProcessor;
1872 1872

  
1873 1873
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &prefix, &len1, &ns, &len2) == FAILURE) {
1874
        RETURN_NULL();
1874
        RETURN_nullptr();
1875 1875
    }
1876
    if(prefix != NULL && ns != NULL) {
1876
    if(prefix != nullptr && ns != nullptr) {
1877 1877
    	xpathProcessor_object *obj = (xpathProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
1878 1878
    	xpathProcessor = obj->xpathProcessor;
1879 1879
    	xpathProcessor->declareNamespace(prefix, ns);
......
1889 1889
    size_t len1;
1890 1890

  
1891 1891
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &allow) == FAILURE) {
1892
        RETURN_NULL();
1892
        RETURN_nullptr();
1893 1893
    }
1894 1894

  
1895 1895
     xpathProcessor_object *obj = (xpathProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
1896 1896
     xpathProcessor = obj->xpathProcessor;
1897
     if (xpathProcessor != NULL ) {
1897
     if (xpathProcessor != nullptr ) {
1898 1898
	    xpathProcessor->setBackwardsCompatible(allow);
1899 1899
	 }
1900 1900
}
......
1905 1905
    size_t len1;
1906 1906

  
1907 1907
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &isCaching) == FAILURE) {
1908
        RETURN_NULL();
1908
        RETURN_nullptr();
1909 1909
    }
1910 1910

  
1911 1911
     xpathProcessor_object *obj = (xpathProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
1912 1912
     xpathProcessor = obj->xpathProcessor;
1913
     if (xpathProcessor != NULL) {
1913
     if (xpathProcessor != nullptr) {
1914 1914
	    xpathProcessor->setCaching(isCaching);
1915 1915
	 }
1916 1916
}
......
1921 1921
      XPathProcessor *xpathProcessor;
1922 1922

  
1923 1923
       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &len1) == FAILURE) {
1924
           RETURN_NULL();
1924
           RETURN_nullptr();
1925 1925
       }
1926 1926
       xpathProcessor_object *obj = (xpathProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
1927 1927
       xpathProcessor = obj->xpathProcessor;
1928
       if (xpathProcessor != NULL && name != NULL) {
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff