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/php5_saxon.cpp
61 61
    obj->std.ce = type;
62 62

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

  
69 69
    return retval;
......
76 76
        WRONG_PARAM_COUNT;
77 77
    }
78 78

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

  
87 87

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

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

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

  
102 102
	obj->saxonProcessor = saxonProc;
103 103
    }
104 104

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

  
......
124 124
	    char cwd[256];
125 125

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

  
......
162 162
    }
163 163

  
164 164
    if (zend_parse_parameters(ZEND_NUM_ARGS() , "s", &libName, &len1) == FAILURE) {
165
        RETURN_NULL();
165
        RETURN_nullptr();
166 166
    }
167 167
//std::cerr<<"checkpoint in registerPHPFunction cp2"<<std::endl;
168 168

  
169 169
    saxonProcessor_object *obj = (saxonProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
170 170

  
171 171
    saxonProcessor = obj->saxonProcessor;
172
    if (saxonProcessor != NULL && libName != NULL) {
172
    if (saxonProcessor != nullptr && libName != nullptr) {
173 173
        saxonProcessor->setConfigurationProperty("extc", libName);
174 174
    }
175 175
    saxonProcessor->registerNativeMethods(SaxonProcessor::sxn_environ->env, "com/saxonica/functions/extfn/cpp/PHPFunctionSet$PHPFunction",
......
184 184
    int len;
185 185
    
186 186
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &dirStr, &len) == FAILURE) {
187
        RETURN_NULL();
187
        RETURN_nullptr();
188 188
    }
189 189
    
190 190
    saxonProcessor_object *obj = (saxonProcessor_object *)zend_object_store_get_object(getThis() TSRMLS_CC);
191 191
    saxonProcessor = obj->saxonProcessor;
192
    if (saxonProcessor != NULL) {
192
    if (saxonProcessor != nullptr) {
193 193
       
194
        if(dirStr != NULL) {
194
        if(dirStr != nullptr) {
195 195
            saxonProcessor->setResourcesDirectory(dirStr);
196 196
        }
197 197
    }
......
205 205
    bool trace = false;
206 206
    
207 207
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC , "sb", &catalogFile, &len, &trace) == FAILURE) {
208
        RETURN_NULL();
208
        RETURN_nullptr();
209 209
    }
210 210
    
211 211
    saxonProcessor_object *obj = (saxonProcessor_object *)zend_object_store_get_object(getThis() TSRMLS_CC);
212 212
    saxonProcessor = obj->saxonProcessor;
213
    if (saxonProcessor != NULL) {
213
    if (saxonProcessor != nullptr) {
214 214
       
215
        if(catalogFile != NULL) {
215
        if(catalogFile != nullptr) {
216 216
            saxonProcessor->setCatalog(catalogFile, trace);
217 217
        }
218 218
    }
......
226 226
    int len;
227 227
    
228 228
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &cwdStr, &len) == FAILURE) {
229
        RETURN_NULL();
229
        RETURN_nullptr();
230 230
    }
231 231
    
232 232
    saxonProcessor_object *obj = (saxonProcessor_object *)zend_object_store_get_object(getThis() TSRMLS_CC);
233 233
    saxonProcessor = obj->saxonProcessor;
234
    if (saxonProcessor != NULL) {
234
    if (saxonProcessor != nullptr) {
235 235
        
236
        if(cwdStr != NULL) {
236
        if(cwdStr != nullptr) {
237 237
            saxonProcessor->setcwd(cwdStr);
238 238
        }
239 239
    }
......
247 247
    int len1;
248 248

  
249 249
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &source, &len1) == FAILURE) {
250
        RETURN_NULL();
250
        RETURN_nullptr();
251 251
    }
252 252
    saxonProcessor_object *obj = (saxonProcessor_object *)zend_object_store_get_object(getThis() TSRMLS_CC);
253
    assert (obj != NULL);
253
    assert (obj != nullptr);
254 254
    saxonProcessor = obj->saxonProcessor;
255
    if (saxonProcessor != NULL) {
255
    if (saxonProcessor != nullptr) {
256 256
        XdmNode* node = saxonProcessor->parseXmlFromString(source);
257
        if(node != NULL) {
257
        if(node != nullptr) {
258 258
            if (object_init_ex(return_value, xdmNode_ce) != SUCCESS) {
259
                RETURN_NULL();
259
                RETURN_nullptr();
260 260
            } else {
261 261
                struct xdmNode_object* vobj = (struct xdmNode_object *)zend_object_store_get_object(return_value TSRMLS_CC);
262
                assert (vobj != NULL);
262
                assert (vobj != nullptr);
263 263
                vobj->xdmNode = node;
264 264
            }
265 265
        } else {
......
268 268
	    }
269 269
        }
270 270
    } else {
271
        RETURN_NULL();
271
        RETURN_nullptr();
272 272
    }
273 273
}
274 274

  
......
279 279
    int len1;
280 280

  
281 281
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &source, &len1) == FAILURE) {
282
        RETURN_NULL();
282
        RETURN_nullptr();
283 283
    }
284 284
    saxonProcessor_object *obj = (saxonProcessor_object *)zend_object_store_get_object(getThis() TSRMLS_CC);
285
    assert (obj != NULL);
285
    assert (obj != nullptr);
286 286
    saxonProcessor = obj->saxonProcessor;
287
    if (saxonProcessor != NULL) {
287
    if (saxonProcessor != nullptr) {
288 288
        XdmValue* node = (XdmValue*)saxonProcessor->parseXmlFromFile(source);//TODO this needs to be XdmNode object
289
        if(node != NULL) {
289
        if(node != nullptr) {
290 290
            if (object_init_ex(return_value, xdmValue_ce) != SUCCESS) {
291
                RETURN_NULL();
291
                RETURN_nullptr();
292 292
            } else {
293 293
                struct xdmValue_object* vobj = (struct xdmValue_object *)zend_object_store_get_object(return_value TSRMLS_CC);
294
                assert (vobj != NULL);
294
                assert (vobj != nullptr);
295 295
                vobj->xdmValue = node;
296 296
            }
297 297
        } else {
298 298
           // obj->xsltProcessor->checkException();//TODO
299 299
        }
300 300
    } else {
301
        RETURN_NULL();
301
        RETURN_nullptr();
302 302
    }
303 303
}
304 304

  
305 305

  
306 306
PHP_METHOD(SaxonProcessor, createAtomicValue)
307 307
{
308
    XdmAtomicValue * xdmValue = NULL;
308
    XdmAtomicValue * xdmValue = nullptr;
309 309
    SaxonProcessor * proc;
310 310
    char * source;
311 311
    int len1;
......
316 316
    long iVal;
317 317
    double dVal;
318 318
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z",&zvalue) == FAILURE) {
319
        RETURN_NULL();
319
        RETURN_nullptr();
320 320
    }
321 321
    saxonProcessor_object *obj = (saxonProcessor_object *)zend_object_store_get_object(getThis() TSRMLS_CC);
322
    assert (obj != NULL);
322
    assert (obj != nullptr);
323 323
    proc = obj->saxonProcessor;
324
    assert (proc != NULL);
325
    if (proc != NULL) {
324
    assert (proc != nullptr);
325
    if (proc != nullptr) {
326 326
	switch (Z_TYPE_P(zvalue)) {
327 327
            case IS_BOOL:
328 328
                bVal = Z_BVAL_P(zvalue);
......
337 337
                len = Z_STRLEN_P(zvalue);
338 338
                xdmValue = proc->makeStringValue((const char*)sVal);
339 339
            break;
340
            case IS_NULL:
340
            case IS_nullptr:
341 341
                xdmValue = new XdmAtomicValue();
342 342
            break;
343 343
            case IS_DOUBLE:
......
351 351
                // TODO: implement this
352 352
                //break;
353 353
            default:
354
                obj = NULL;
354
                obj = nullptr;
355 355
                zend_throw_exception(zend_exception_get_default(TSRMLS_C), "unknown type specified in XdmValue", 0 TSRMLS_CC); 
356
                RETURN_NULL();
356
                RETURN_nullptr();
357 357
        }
358
        if(xdmValue == NULL) {
359
            RETURN_NULL();
358
        if(xdmValue == nullptr) {
359
            RETURN_nullptr();
360 360
        }
361 361
        if (object_init_ex(return_value, xdmAtomicValue_ce) != SUCCESS) {
362
            RETURN_NULL();
362
            RETURN_nullptr();
363 363
        } else {
364 364
            struct xdmAtomicValue_object* vobj = (struct xdmAtomicValue_object *)zend_object_store_get_object(return_value TSRMLS_CC);
365
            assert (vobj != NULL);
365
            assert (vobj != nullptr);
366 366
            vobj->xdmAtomicValue = xdmValue;
367 367
        }
368 368
    } else {
369 369
       
370
        RETURN_NULL();
370
        RETURN_nullptr();
371 371
    }
372 372
}
373 373

  
......
379 379
        WRONG_PARAM_COUNT;
380 380
    }
381 381
    SaxonProcessor * proc;
382
    XPathProcessor * xpathProcessor = NULL;
383
    if((saxonProcessor_object *)zend_object_store_get_object(getThis() TSRMLS_CC) == NULL) {
382
    XPathProcessor * xpathProcessor = nullptr;
383
    if((saxonProcessor_object *)zend_object_store_get_object(getThis() TSRMLS_CC) == nullptr) {
384 384
      
385 385
    }
386 386
    saxonProcessor_object *obj = (saxonProcessor_object *)zend_object_store_get_object(getThis() TSRMLS_CC);
387 387

  
388
    assert (obj != NULL);
388
    assert (obj != nullptr);
389 389
    proc = obj->saxonProcessor;
390
    assert (proc != NULL);
391
    if (proc != NULL) {
390
    assert (proc != nullptr);
391
    if (proc != nullptr) {
392 392
if (object_init_ex(return_value, xpathProcessor_ce) != SUCCESS) {
393
            RETURN_NULL();
393
            RETURN_nullptr();
394 394
        } else {
395 395
	   struct xpathProcessor_object* vobji = (struct xpathProcessor_object *)zend_object_store_get_object(return_value TSRMLS_CC);
396
            assert (vobji != NULL);
396
            assert (vobji != nullptr);
397 397
	    xpathProcessor = proc->newXPathProcessor();
398 398
            vobji->xpathProcessor = xpathProcessor;
399 399
	}
400 400
    } else {
401 401
       
402
        RETURN_NULL();
402
        RETURN_nullptr();
403 403
    }
404 404
}
405 405

  
......
410 410
        WRONG_PARAM_COUNT;
411 411
    }
412 412
    SaxonProcessor * proc;
413
    XsltProcessor * xsltProcessor = NULL;
414
if((saxonProcessor_object *)zend_object_store_get_object(getThis() TSRMLS_CC) == NULL) {
413
    XsltProcessor * xsltProcessor = nullptr;
414
if((saxonProcessor_object *)zend_object_store_get_object(getThis() TSRMLS_CC) == nullptr) {
415 415
   
416 416
}
417 417

  
418 418
    saxonProcessor_object *obj = (saxonProcessor_object *)zend_object_store_get_object(getThis() TSRMLS_CC);
419
    assert (obj != NULL);
419
    assert (obj != nullptr);
420 420
    proc = obj->saxonProcessor;
421
    assert (proc != NULL);
422
    if (proc != NULL) {
421
    assert (proc != nullptr);
422
    if (proc != nullptr) {
423 423
    if (object_init_ex(return_value, xsltProcessor_ce) != SUCCESS) {
424
            RETURN_NULL();
424
            RETURN_nullptr();
425 425
        } else {
426 426
	   struct xsltProcessor_object* vobj = (struct xsltProcessor_object *)zend_object_store_get_object(return_value TSRMLS_CC);
427 427
	
428
            assert (vobj != NULL);
428
            assert (vobj != nullptr);
429 429
	    xsltProcessor = proc->newXsltProcessor();
430 430
            vobj->xsltProcessor = xsltProcessor;
431 431
    }
432 432
    } else {
433 433
       
434
        RETURN_NULL();
434
        RETURN_nullptr();
435 435
    }
436 436
}
437 437

  
......
442 442
        WRONG_PARAM_COUNT;
443 443
    }
444 444
    SaxonProcessor * proc;
445
    Xslt30Processor * xslt30Processor = NULL;
446
if((saxonProcessor_object *)zend_object_store_get_object(getThis() TSRMLS_CC) == NULL) {
445
    Xslt30Processor * xslt30Processor = nullptr;
446
if((saxonProcessor_object *)zend_object_store_get_object(getThis() TSRMLS_CC) == nullptr) {
447 447

  
448 448
}
449 449

  
450 450
    saxonProcessor_object *obj = (saxonProcessor_object *)zend_object_store_get_object(getThis() TSRMLS_CC);
451
    assert (obj != NULL);
451
    assert (obj != nullptr);
452 452
    proc = obj->saxonProcessor;
453
    assert (proc != NULL);
454
    if (proc != NULL) {
453
    assert (proc != nullptr);
454
    if (proc != nullptr) {
455 455
    if (object_init_ex(return_value, xslt30Processor_ce) != SUCCESS) {
456
            RETURN_NULL();
456
            RETURN_nullptr();
457 457
        } else {
458 458
	   struct xslt30Processor_object* vobj = (struct xslt30Processor_object *)zend_object_store_get_object(return_value TSRMLS_CC);
459 459

  
460
            assert (vobj != NULL);
460
            assert (vobj != nullptr);
461 461
	    xslt30Processor = proc->newXslt30Processor();
462 462
            vobj->xslt30Processor = xslt30Processor;
463 463
    }
464 464
    } else {
465 465

  
466
        RETURN_NULL();
466
        RETURN_nullptr();
467 467
    }
468 468
}
469 469

  
......
474 474
        WRONG_PARAM_COUNT;
475 475
    }
476 476
    SaxonProcessor * proc;
477
    XQueryProcessor * xqueryProcessor = NULL;
478
   if((saxonProcessor_object *)zend_object_store_get_object(getThis() TSRMLS_CC) == NULL) {
477
    XQueryProcessor * xqueryProcessor = nullptr;
478
   if((saxonProcessor_object *)zend_object_store_get_object(getThis() TSRMLS_CC) == nullptr) {
479 479
   
480 480
   }
481 481
   
482 482
    saxonProcessor_object *obj = (saxonProcessor_object *)zend_object_store_get_object(getThis() TSRMLS_CC);
483
    assert (obj != NULL);
483
    assert (obj != nullptr);
484 484
    proc = obj->saxonProcessor;
485
    assert (proc != NULL);
486
    if (proc != NULL) {
485
    assert (proc != nullptr);
486
    if (proc != nullptr) {
487 487
	if (object_init_ex(return_value, xqueryProcessor_ce) != SUCCESS) {
488
            RETURN_NULL();
488
            RETURN_nullptr();
489 489
        } else {
490 490
	   struct xqueryProcessor_object* vobj = (struct xqueryProcessor_object *)zend_object_store_get_object(return_value TSRMLS_CC);
491 491

  
492
            assert (vobj != NULL);
492
            assert (vobj != nullptr);
493 493
	    xqueryProcessor = proc->newXQueryProcessor();
494 494
            vobj->xqueryProcessor = xqueryProcessor;
495 495
     }
496 496
    } else {
497 497
       
498
        RETURN_NULL();
498
        RETURN_nullptr();
499 499
    }
500 500
}
501 501

  
......
506 506
        WRONG_PARAM_COUNT;
507 507
    }
508 508
    SaxonProcessor * proc;
509
    SchemaValidator * schemaValidator = NULL;
509
    SchemaValidator * schemaValidator = nullptr;
510 510
   
511 511
    saxonProcessor_object *obj = (saxonProcessor_object *)zend_object_store_get_object(getThis() TSRMLS_CC);
512
    assert (obj != NULL);
512
    assert (obj != nullptr);
513 513
    proc = obj->saxonProcessor;
514
    assert (proc != NULL);
515
    if (proc != NULL) {
514
    assert (proc != nullptr);
515
    if (proc != nullptr) {
516 516
	if (object_init_ex(return_value, schemaValidator_ce) != SUCCESS) {
517
            RETURN_NULL();
517
            RETURN_nullptr();
518 518
        } else {
519 519
	   struct schemaValidator_object* vobj = (struct schemaValidator_object *)zend_object_store_get_object(return_value TSRMLS_CC);
520
            assert (vobj != NULL);
520
            assert (vobj != nullptr);
521 521
	    schemaValidator = proc->newSchemaValidator();
522
	    if(schemaValidator == NULL){
523
		RETURN_NULL();
522
	    if(schemaValidator == nullptr){
523
		RETURN_nullptr();
524 524
	    }
525 525
            vobj->schemaValidator = schemaValidator;
526 526
	}
527 527
    } else {
528 528
       
529
        RETURN_NULL();
529
        RETURN_nullptr();
530 530
    }
531 531
}
532 532

  
......
539 539
        WRONG_PARAM_COUNT;
540 540
    }
541 541
    saxonProcessor = obj->saxonProcessor;
542
    if (saxonProcessor != NULL) {
542
    if (saxonProcessor != nullptr) {
543 543
        return saxonProcessor->isSchemaAwareProcessor();
544 544
        
545 545
    }
......
554 554
        WRONG_PARAM_COUNT;
555 555
    }
556 556
    saxonProcessor = obj->saxonProcessor;
557
    if (saxonProcessor != NULL) {
557
    if (saxonProcessor != nullptr) {
558 558
        char *str = estrdup(saxonProcessor->version());
559 559
        RETURN_STRING(str, 0);
560 560
    }
561
    RETURN_NULL();
561
    RETURN_nullptr();
562 562
}
563 563

  
564 564

  
......
574 574
    }
575 575

  
576 576
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &name, &len1, &value, &len2) == FAILURE) {
577
        RETURN_NULL();
577
        RETURN_nullptr();
578 578
    }
579 579
    saxonProcessor_object *obj = (saxonProcessor_object *)zend_object_store_get_object(getThis() TSRMLS_CC);
580 580

  
581 581
    saxonProcessor = obj->saxonProcessor;
582
    if (saxonProcessor != NULL && name != NULL && value != NULL) {
582
    if (saxonProcessor != nullptr && name != nullptr && value != nullptr) {
583 583
        saxonProcessor->setConfigurationProperty(name, value);
584 584
    }
585 585
    
......
596 596
    }
597 597

  
598 598
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &libName, &len1) == FAILURE) {
599
        RETURN_NULL();
599
        RETURN_nullptr();
600 600
    }
601 601
    saxonProcessor_object *obj = (saxonProcessor_object *)zend_object_store_get_object(getThis() TSRMLS_CC);
602 602

  
603 603
    saxonProcessor = obj->saxonProcessor;
604
    if (saxonProcessor != NULL && libName != NULL) {
604
    if (saxonProcessor != nullptr && libName != nullptr) {
605 605
        saxonProcessor->setConfigurationProperty("extc", libName);
606 606
    }
607 607
saxonProcessor->registerNativeMethods(SaxonProcessor::sxn_environ->env, "com/saxonica/functions/extfn/cpp/PHPFunctionSet$PhpFunction",
......
632 632
    obj->std.ce = type;
633 633

  
634 634
    ALLOC_HASHTABLE(obj->std.properties);
635
    zend_hash_init(obj->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
635
    zend_hash_init(obj->std.properties, 0, nullptr, ZVAL_PTR_DTOR, 0);
636 636
    object_properties_init(&obj->std, type);
637
    retval.handle = zend_objects_store_put(obj, NULL, XsltProcessor_free_storage, NULL TSRMLS_CC);
637
    retval.handle = zend_objects_store_put(obj, nullptr, XsltProcessor_free_storage, nullptr TSRMLS_CC);
638 638
    retval.handlers = &xsltProcessor_object_handlers;
639 639

  
640 640
    return retval;
......
662 662
    int len1, len2, len3;
663 663

  
664 664
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss", &infilename, &len1, &styleFileName, &len2, &outfileName, &len3) == FAILURE) {
665
        RETURN_NULL();
665
        RETURN_nullptr();
666 666
    }
667 667

  
668 668
    xsltProcessor_object *obj = (xsltProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
669 669
    xsltProcessor = obj->xsltProcessor;
670 670
 
671
    if (xsltProcessor != NULL) {
671
    if (xsltProcessor != nullptr) {
672 672

  
673 673
        xsltProcessor->transformFileToFile(infilename, styleFileName, outfileName);
674 674
        if(xsltProcessor->exceptionOccurred()) {
......
685 685
    int len1, len2;
686 686

  
687 687
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &infilename, &len1, &styleFileName, &len2) == FAILURE) {
688
        RETURN_NULL();
688
        RETURN_nullptr();
689 689
    }
690 690

  
691 691
    xsltProcessor_object *obj = (xsltProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
692 692
    xsltProcessor = obj->xsltProcessor;
693 693
    
694
    if (xsltProcessor != NULL) {
694
    if (xsltProcessor != nullptr) {
695 695

  
696 696
        XdmValue * node = xsltProcessor->transformFileToValue(infilename, styleFileName);
697
        if(node != NULL) {
697
        if(node != nullptr) {
698 698
            if (object_init_ex(return_value, xdmValue_ce) != SUCCESS) {
699
                RETURN_NULL();
699
                RETURN_nullptr();
700 700
            } else {
701 701
                struct xdmValue_object* vobj  = (struct xdmValue_object*) zend_object_store_get_object(return_value TSRMLS_CC);
702
                assert (vobj != NULL);
702
                assert (vobj != nullptr);
703 703
                vobj->xdmValue = node;
704 704
            }
705 705
        } else {
......
708 708
	    }
709 709
        }
710 710
    }else {
711
        RETURN_NULL();
711
        RETURN_nullptr();
712 712
    }
713 713
}
714 714

  
......
721 721
    int len1, len2;
722 722

  
723 723
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &infilename, &len1, &styleFileName, &len2) == FAILURE) {
724
        RETURN_NULL();
724
        RETURN_nullptr();
725 725
    }
726 726

  
727 727
    xsltProcessor_object *obj = (xsltProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
728 728
    xsltProcessor = obj->xsltProcessor;
729 729

  
730
    if (xsltProcessor != NULL) {
730
    if (xsltProcessor != nullptr) {
731 731

  
732 732
        const char * result = xsltProcessor->transformFileToString(infilename, styleFileName);
733
	if(result != NULL) {
733
	if(result != nullptr) {
734 734
            char *str = estrdup(result);
735 735
            RETURN_STRING(str, 0);
736 736
        } else if(xsltProcessor->exceptionOccurred()){
737 737
            //TODO: xsltProcessor->checkException();
738 738
            const char * errStr = xsltProcessor->getErrorMessage(0);
739
            if(errStr != NULL) {
739
            if(errStr != nullptr) {
740 740
                const char * errorCode = xsltProcessor->getErrorCode(0);
741
                if(errorCode!=NULL) {
741
                if(errorCode!=nullptr) {
742 742
                    // TODO: throw exception
743 743
                }
744 744
            }
......
761 761
  (JNIEnv *env, jobject object, jstring funcName, jobjectArray arguments, jobjectArray argTypes){
762 762
	JNIEnv *senv = SaxonProcessor::sxn_environ->env;
763 763

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

  
766
	if(nativeString == NULL) {
767
		return NULL;	
766
	if(nativeString == nullptr) {
767
		return nullptr;
768 768
	}
769 769

  
770 770
	zval *function_name;
771 771
	zval *retval;
772 772
	
773 773
	int argLength = 0;
774
	zvalArr * php_argv= NULL;
775
	if(arguments != NULL) {
774
	zvalArr * php_argv= nullptr;
775
	if(arguments != nullptr) {
776 776
		argLength = (int)senv->GetArrayLength(arguments);
777 777
		php_argv = new zvalArr[argLength];
778 778
	}
......
780 780
	if(argLength>0) {
781 781
		(*params) = (zval**)malloc(sizeof(zval*) * argLength);
782 782
	} else {
783
		(*params) = NULL;
783
		(*params) = nullptr;
784 784
	}
785 785
	std::map<std::string, saxonTypeEnum> typeMap;
786 786
	typeMap["node"] = enumNode;
......
800 800
		jstring argType = (jstring)senv->GetObjectArrayElement(argTypes, i);
801 801
		jobject argObj = senv->GetObjectArrayElement(arguments, i);
802 802

  
803
		const char * str = senv->GetStringUTFChars(argType,NULL);
804
		const char *stri = NULL;
803
		const char * str = senv->GetStringUTFChars(argType,nullptr);
804
		const char *stri = nullptr;
805 805
		double dnumber = 0;
806 806
		long lnumber = 0;
807 807
		bool bvalue = false;
......
810 810

  
811 811
         
812 812
		struct xdmNode_object* vobj;
813
		XdmNode * node = NULL;
813
		XdmNode * node = nullptr;
814 814
		std::map<std::string, saxonTypeEnum>::iterator it = typeMap.find(str);
815 815
		if (it != typeMap.end()){
816 816
			switch (it->second)
......
825 825
					MAKE_STD_ZVAL(php_argv[i]._val);
826 826
					object_init_ex(php_argv[i]._val, xdmNode_ce);
827 827
   					vobj = (struct xdmNode_object *)zend_object_store_get_object(php_argv[i]._val TSRMLS_CC);
828
                			assert (vobj != NULL);
828
                			assert (vobj != nullptr);
829 829
                			vobj->xdmNode = node;
830 830
					break;
831 831
				case enumString:
832
					stri = senv->GetStringUTFChars((jstring)argObj, NULL);
832
					stri = senv->GetStringUTFChars((jstring)argObj, nullptr);
833 833
					MAKE_STD_ZVAL(php_argv[i]._val);
834 834
					ZVAL_STRING(php_argv[i]._val, stri, 1);
835 835
					break;
......
878 878
	}
879 879
	//note: no implicit type conversion.
880 880

  
881
	zval *argvv = NULL;//xparams;
881
	zval *argvv = nullptr;//xparams;
882 882
	MAKE_STD_ZVAL(function_name);
883 883
	ZVAL_STRING(function_name, nativeString, 1);
884
	if(call_user_function_ex(CG(function_table), NULL, function_name, &retval, argLength, params, 0, NULL TSRMLS_CC) != SUCCESS)
884
	if(call_user_function_ex(CG(function_table), nullptr, function_name, &retval, argLength, params, 0, nullptr TSRMLS_CC) != SUCCESS)
885 885
	{
886 886
 	   zend_error(E_ERROR, "Function call failed");
887 887
	}
......
889 889

  
890 890

  
891 891
	if(Z_TYPE(*retval) ==0){
892
		zend_error(E_ERROR, "Function returned null");
892
		zend_error(E_ERROR, "Function returned nullptr");
893 893
	}
894 894

  
895
	char * sVal = NULL;
895
	char * sVal = nullptr;
896 896
	int len = 0;
897
	jobject obj = NULL;
897
	jobject obj = nullptr;
898 898
	std::cerr<<" Return type="<<Z_TYPE_P(retval)<<std::endl;
899 899
//TODO handle XdmValue wrapped object
900
const char * objName = NULL;
901
xdmNode_object* ooth = NULL;
900
const char * objName = nullptr;
901
xdmNode_object* ooth = nullptr;
902 902
	switch (Z_TYPE_P(retval)) {
903 903
            case IS_BOOL:
904 904
                obj= booleanValue(SaxonProcessor::sxn_environ, Z_BVAL_P(retval));
......
913 913
		obj = getJavaStringValue(SaxonProcessor::sxn_environ,estrndup(sVal, len));
914 914
                break;
915 915
            break;
916
            case IS_NULL:
916
            case IS_nullptr:
917 917
                
918 918
            	break;
919 919
            case IS_DOUBLE:
......
928 928

  
929 929
      		if(strcmp(objName, "Saxon\\XdmNode")==0) {
930 930
			ooth = (xdmNode_object*)zend_object_store_get_object(retval TSRMLS_CC);
931
        		if(ooth != NULL) {
931
        		if(ooth != nullptr) {
932 932
            			obj = ooth->xdmNode->getUnderlyingValue();
933 933
            	
934 934
        		}
935 935
      		}
936 936
		break;
937 937
            default:
938
                obj = NULL;
938
                obj = nullptr;
939 939
                zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Unknown type specified in extension function", 0 TSRMLS_CC);
940 940
        }
941 941

  
......
969 969

  
970 970
MAKE_STD_ZVAL(function_name);
971 971
ZVAL_STRING(function_name, str, 1);
972
if(call_user_function_ex(CG(function_table), NULL, function_name, &retval, 0, NULL, 0, NULL TSRMLS_CC) != SUCCESS)
972
if(call_user_function_ex(CG(function_table), nullptr, function_name, &retval, 0, nullptr, 0, nullptr TSRMLS_CC) != SUCCESS)
973 973
{
974 974
    zend_error(E_ERROR, "Function call failed");
975 975
}
976 976

  
977 977
if(Z_TYPE(*retval) ==0){
978
zend_error(E_ERROR, "DATAYYY is NULL");
978
zend_error(E_ERROR, "DATAYYY is nullptr");
979 979
}else {
980 980
str = Z_STRVAL_P(retval);
981 981
zend_printf("DATAYYY= %i <br>", str);
......
992 992
    xsltProcessor_object *obj = (xsltProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
993 993
    xsltProcessor = obj->xsltProcessor;
994 994

  
995
    if (xsltProcessor != NULL) {
995
    if (xsltProcessor != nullptr) {
996 996

  
997 997
        const char * result = xsltProcessor->transformToString();
998
        if(result != NULL) {
998
        if(result != nullptr) {
999 999
            char *str = estrdup(result);
1000 1000
            RETURN_STRING(str, 0);
1001 1001
        } else if(xsltProcessor->exceptionOccurred()){
1002 1002
            xsltProcessor->checkException();
1003 1003
            const char * errStr = xsltProcessor->getErrorMessage(0);
1004
            if(errStr != NULL) {
1004
            if(errStr != nullptr) {
1005 1005
                const char * errorCode = xsltProcessor->getErrorCode(0);
1006
                if(errorCode!=NULL) {
1006
                if(errorCode!=nullptr) {
1007 1007
                    // TODO: throw exception
1008 1008
                }
1009 1009
            }
1010 1010
        }
1011 1011
    }
1012
    RETURN_NULL();
1012
    RETURN_nullptr();
1013 1013
}
1014 1014

  
1015 1015
PHP_METHOD(XsltProcessor, transformToValue)
......
1023 1023
    xsltProcessor_object *obj = (xsltProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
1024 1024
    xsltProcessor = obj->xsltProcessor;
1025 1025

  
1026
    if (xsltProcessor != NULL) {
1026
    if (xsltProcessor != nullptr) {
1027 1027

  
1028 1028
	XdmValue * node = xsltProcessor->transformToValue();
1029
        if(node != NULL) {
1029
        if(node != nullptr) {
1030 1030
            if (object_init_ex(return_value, xdmValue_ce) != SUCCESS) {
1031
                RETURN_NULL();
1031
                RETURN_nullptr();
1032 1032
            } else {
1033 1033
                struct xdmValue_object* vobj  = (struct xdmValue_object*) zend_object_store_get_object(return_value TSRMLS_CC);
1034
                assert (vobj != NULL);
1034
                assert (vobj != nullptr);
1035 1035
                vobj->xdmValue = node;
1036 1036
            }
1037 1037
        } else if(xsltProcessor->exceptionOccurred()){
1038 1038
            xsltProcessor->checkException();
1039 1039
        }
1040 1040
    } else {
1041
        RETURN_NULL();
1041
        RETURN_nullptr();
1042 1042
    }
1043 1043
}
1044 1044

  
......
1053 1053
    xsltProcessor_object *obj = (xsltProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
1054 1054
    xsltProcessor = obj->xsltProcessor;
1055 1055

  
1056
    if (xsltProcessor != NULL) {
1056
    if (xsltProcessor != nullptr) {
1057 1057

  
1058 1058
	xsltProcessor->transformToFile();
1059 1059
        if(xsltProcessor->exceptionOccurred()) {
......
1061 1061
            const char * exStr = xsltProcessor->checkException();
1062 1062
        }
1063 1063
    } else {
1064
        RETURN_NULL();
1064
        RETURN_nullptr();
1065 1065
    }
1066 1066
}
1067 1067

  
......
1072 1072
    int len1;
1073 1073

  
1074 1074
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &len1) == FAILURE) {
1075
        RETURN_NULL();
1075
        RETURN_nullptr();
1076 1076
    }
1077 1077
    xsltProcessor_object *obj = (xsltProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
1078 1078
    xsltProcessor = obj->xsltProcessor;
1079
    if (xsltProcessor != NULL) {
1079
    if (xsltProcessor != nullptr) {
1080 1080
        xsltProcessor->setBaseOutputURI(name);
1081 1081
    }
1082 1082
}
......
1088 1088
    int len1;
1089 1089

  
1090 1090
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &len1) == FAILURE) {
1091
        RETURN_NULL();
1091
        RETURN_nullptr();
1092 1092
    }
1093 1093
    xsltProcessor_object *obj = (xsltProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
1094 1094
    xsltProcessor = obj->xsltProcessor;
1095
    if (xsltProcessor != NULL) {
1095
    if (xsltProcessor != nullptr) {
1096 1096
        xsltProcessor->compileFromFile(name);
1097 1097
    }
1098 1098
}
......
1103 1103
    char * stylesheetStr;
1104 1104
    int len1, myint;
1105 1105
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &stylesheetStr, &len1) == FAILURE) {
1106
        RETURN_NULL();
1106
        RETURN_nullptr();
1107 1107
    }
1108 1108
    xsltProcessor_object *obj = (xsltProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
1109 1109
    xsltProcessor = obj->xsltProcessor;
1110
    if (xsltProcessor != NULL) {
1110
    if (xsltProcessor != nullptr) {
1111 1111
        xsltProcessor->compileFromString(stylesheetStr);
1112 1112
    }
1113 1113
}
......
1118 1118
   zval* oth;
1119 1119

  
1120 1120
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O", &oth, xdmValue_ce) == FAILURE) {
1121
        RETURN_NULL();
1121
        RETURN_nullptr();
1122 1122
    }
1123 1123
    xsltProcessor_object *obj = (xsltProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
1124 1124
    xsltProcessor = obj->xsltProcessor;
1125
    if (xsltProcessor != NULL) {
1125
    if (xsltProcessor != nullptr) {
1126 1126
 	xdmValue_object* ooth = (xdmValue_object*)zend_object_store_get_object(oth TSRMLS_CC);
1127
        if(ooth != NULL) {
1127
        if(ooth != nullptr) {
1128 1128
            XdmValue * value = ooth->xdmValue;
1129
            if(value != NULL && value->size() == 1 && (value->getHead())->getType() == 3) {
1129
            if(value != nullptr && value->size() == 1 && (value->getHead())->getType() == 3) {
1130 1130
        	xsltProcessor->compileFromXdmNode((XdmNode*)(value->getHead()));
1131 1131
	    }
1132 1132
	}
......
1142 1142
    char * filename;
1143 1143
    size_t len1, len2, myint;
1144 1144
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &stylesheetStr, filename, &len1, &len2) == FAILURE) {
1145
        RETURN_NULL();
1145
        RETURN_nullptr();
1146 1146
    }
1147 1147

  
1148 1148
    xsltProcessor_object *obj = (xsltProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
1149 1149
        xsltProcessor = obj->xsltProcessor;
1150
        if (xsltProcessor != NULL) {
1150
        if (xsltProcessor != nullptr) {
1151 1151
            xsltProcessor->compileFromStringAndSave(stylesheetStr, filename);
1152 1152
        }
1153 1153

  
......
1161 1161
    char * filename;
1162 1162
    size_t len1, len2, myint;
1163 1163
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &stylesheetFilename, filename, &len1, &len2) == FAILURE) {
1164
        RETURN_NULL();
1164
        RETURN_nullptr();
1165 1165
    }
1166 1166
     xsltProcessor_object *obj = (xsltProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
1167 1167
    xsltProcessor = obj->xsltProcessor;
1168
    if (xsltProcessor != NULL) {
1168
    if (xsltProcessor != nullptr) {
1169 1169
        xsltProcessor->compileFromStringAndSave(stylesheetFilename, filename);
1170 1170
    }
1171 1171
}
......
1176 1176
PHP_METHOD(XsltProcessor, setSourceFromXdmValue)
1177 1177
{
1178 1178
    XsltProcessor *xsltProcessor;
1179
    zval* oth = NULL;
1179
    zval* oth = nullptr;
1180 1180

  
1181 1181
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &oth) == FAILURE) {
1182
        RETURN_NULL();
1182
        RETURN_nullptr();
1183 1183
    }
1184 1184

  
1185 1185
    xsltProcessor_object *obj = (xsltProcessor_object *)zend_object_store_get_object(getThis() TSRMLS_CC);
1186 1186
    xsltProcessor = obj->xsltProcessor;
1187
    if (xsltProcessor != NULL) {
1187
    if (xsltProcessor != nullptr) {
1188 1188

  
1189 1189
    if(!oth) {
1190 1190
	php_error(E_WARNING, "Error setting source value");
......
1196 1196

  
1197 1197
      if(strcmp(objName, "Saxon\\XdmNode")==0) {
1198 1198
	xdmNode_object* ooth = (xdmNode_object*)zend_object_store_get_object(oth TSRMLS_CC);
1199
        if(ooth != NULL) {
1199
        if(ooth != nullptr) {
1200 1200
            XdmNode * value = ooth->xdmNode;
1201
            if(value != NULL) {
1201
            if(value != nullptr) {
1202 1202
	        xsltProcessor->setSourceFromXdmNode(value);
1203 1203

  
1204 1204
            }
1205 1205
        }
1206 1206
      } /*else if(strcmp(objName, "Saxon\\XdmValue")==0) {
1207 1207
	xdmValue_object* ooth = (xdmValue_object*)zend_object_store_get_object(oth TSRMLS_CC);
1208
        if(ooth != NULL) {
1208
        if(ooth != nullptr) {
1209 1209
            XdmValue * value = ooth->xdmValue;
1210
            if(value != NULL) {
1210
            if(value != nullptr) {
1211 1211
	        xsltProcessor->setSourceFromXdmValue((XdmItem*)value);
1212 1212
            }
1213 1213
        }
......
1224 1224
    bool jit = false;
1225 1225

  
1226 1226
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &jit) == FAILURE) {
1227
        RETURN_NULL();
1227
        RETURN_nullptr();
1228 1228
    }
1229 1229

  
1230 1230
    xsltProcessor_object *obj = (xsltProcessor_object *)zend_object_store_get_object(getThis() TSRMLS_CC);
1231 1231
    xsltProcessor = obj->xsltProcessor;
1232
    if (xsltProcessor != NULL) {
1232
    if (xsltProcessor != nullptr) {
1233 1233

  
1234 1234
	 xsltProcessor->setJustInTimeCompilation(jit);
1235 1235

  
......
1244 1244
    int len1;
1245 1245

  
1246 1246
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &outputFilename, &len1, xdmValue_ce) == FAILURE) {
1247
        RETURN_NULL();
1247
        RETURN_nullptr();
1248 1248
    }
1249 1249

  
1250 1250
    xsltProcessor_object *obj = (xsltProcessor_object *)zend_object_store_get_object(getThis() TSRMLS_CC);
1251 1251
    xsltProcessor = obj->xsltProcessor;
1252
    if (xsltProcessor != NULL && outputFilename != NULL) {
1252
    if (xsltProcessor != nullptr && outputFilename != nullptr) {
1253 1253
        
1254 1254
	 xsltProcessor->setOutputFile(outputFilename);
1255 1255
            
......
1264 1264
    int len1;
1265 1265

  
1266 1266
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &inFilename, &len1, xdmValue_ce) == FAILURE) {
1267
        RETURN_NULL();
1267
        RETURN_nullptr();
1268 1268
    }
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 && inFilename != NULL) {
1272
    if (xsltProcessor != nullptr && inFilename != nullptr) {
1273 1273
        
1274 1274
	 xsltProcessor->setSourceFromFile(inFilename);
1275 1275
            
......
1286 1286
    int len1, len2, myint;
1287 1287

  
1288 1288
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &name, &len1, &value, &len2) == FAILURE) {
1289
        RETURN_NULL();
1289
        RETURN_nullptr();
1290 1290
    }
1291 1291
    xsltProcessor_object *obj = (xsltProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
1292 1292
    xsltProcessor = obj->xsltProcessor;
1293
    if (xsltProcessor != NULL) {
1293
    if (xsltProcessor != nullptr) {
1294 1294
        xsltProcessor->setProperty(name, value);
1295 1295
    }
1296 1296
}
......
1303 1303
   zval* oth;
1304 1304
   int len1, len2, myint;	
1305 1305
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz", &name, &len2, &oth) == FAILURE) {
1306
        RETURN_NULL();
1306
        RETURN_nullptr();
1307 1307
    }
1308 1308
    xsltProcessor_object *obj = (xsltProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
1309 1309
    xsltProcessor = obj->xsltProcessor;
1310
    if (xsltProcessor != NULL) {
1310
    if (xsltProcessor != nullptr) {
1311 1311

  
1312
      if(Z_TYPE_P(oth) ==IS_NULL){
1313
      		php_error(E_WARNING, "Error setting source value - value is null");
1312
      if(Z_TYPE_P(oth) ==IS_nullptr){
1313
      		php_error(E_WARNING, "Error setting source value - value is nullptr");
1314 1314
      		return;
1315 1315
      	}
1316 1316
      const char * objName =Z_OBJCE_P(oth)->name;
......
1318 1318

  
1319 1319
      if(strcmp(objName, "Saxon\\XdmNode")==0) {
1320 1320
	xdmNode_object* ooth = (xdmNode_object*)zend_object_store_get_object(oth TSRMLS_CC);
1321
        if(ooth != NULL) {
1321
        if(ooth != nullptr) {
1322 1322
            XdmNode * value = ooth->xdmNode;
1323
            if(value != NULL) {	
1323
            if(value != nullptr) {
1324 1324
	        xsltProcessor->setParameter(name, (XdmValue *)value);
1325 1325

  
1326 1326
            }
1327 1327
        }
1328 1328
      } else if(strcmp(objName, "Saxon\\XdmValue")==0){
1329 1329
	xdmValue_object* ooth = (xdmValue_object*) zend_object_store_get_object(oth TSRMLS_CC);
1330
        if(ooth != NULL) {
1330
        if(ooth != nullptr) {
1331 1331
            XdmValue * value = ooth->xdmValue;
1332
            if(value != NULL) {
1332
            if(value != nullptr) {
1333 1333
		
1334 1334
                xsltProcessor->setParameter(name, value);
1335 1335
            }
......
1339 1339

  
1340 1340
      } else if(strcmp(objName, "Saxon\\XdmAtomicValue")==0){
1341 1341
	xdmAtomicValue_object* ooth = (xdmAtomicValue_object*) zend_object_store_get_object(oth TSRMLS_CC);
1342
        if(ooth != NULL) {
1342
        if(ooth != nullptr) {
1343 1343
            XdmAtomicValue * value = ooth->xdmAtomicValue;
1344
            if(value != NULL) {
1344
            if(value != nullptr) {
1345 1345
		
1346 1346
                xsltProcessor->setParameter(name, (XdmValue *)value);
1347 1347
            }
......
1363 1363

  
1364 1364
    xsltProcessor_object *obj = (xsltProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
1365 1365
    xsltProcessor = obj->xsltProcessor;
1366
    if (xsltProcessor != NULL) {
1366
    if (xsltProcessor != nullptr) {
1367 1367
        xsltProcessor->clearParameters(true);
1368 1368
    }
1369 1369
}
......
1377 1377

  
1378 1378
    xsltProcessor_object *obj = (xsltProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
1379 1379
    xsltProcessor = obj->xsltProcessor;
1380
    if (xsltProcessor != NULL) {
1380
    if (xsltProcessor != nullptr) {
1381 1381
        xsltProcessor->clearProperties();
1382 1382
    }
1383 1383
}
......
1387 1387
{
1388 1388
    XsltProcessor *xsltProcessor;
1389 1389
    bool show = false;
1390
    char * filename = NULL;
1390
    char * filename = nullptr;
1391 1391
    size_t len1;
1392 1392
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "bs", &show, &filename &len1) == FAILURE) {
1393
        RETURN_NULL();
1393
        RETURN_nullptr();
1394 1394
    }
1395 1395

  
1396 1396
    xsltProcessor_object *obj = (xsltProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
1397 1397
    xsltProcessor = obj->xsltProcessor;
1398 1398

  
1399
    if (xsltProcessor != NULL) {
1399
    if (xsltProcessor != nullptr) {
1400 1400

  
1401 1401
	    xsltProcessor->setupXslMessage(show, filename);
1402 1402
	}
......
1413 1413
    }
1414 1414

  
1415 1415
    xsltProcessor = obj->xsltProcessor;
1416
    if (xsltProcessor != NULL) {
1416
    if (xsltProcessor != nullptr) {
1417 1417
        bool result = xsltProcessor->exceptionOccurred();
1418 1418
        RETURN_BOOL(result);
1419 1419
    }
......
1429 1429
    }
1430 1430

  
1431 1431
    xsltProcessor = obj->xsltProcessor;
1432
    if (xsltProcessor != NULL) {
1432
    if (xsltProcessor != nullptr) {
1433 1433
        int count = xsltProcessor->exceptionCount();
1434 1434
        RETURN_LONG(count);
1435 1435
    }
......
1441 1441
    XsltProcessor *xsltProcessor;
1442 1442
    long index;
1443 1443
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &index) == FAILURE) {
1444
        RETURN_NULL();
1444
        RETURN_nullptr();
1445 1445
    }
1446 1446
    xsltProcessor_object *obj = (xsltProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
1447 1447
    xsltProcessor = obj->xsltProcessor;
1448
    if (xsltProcessor != NULL) {
1448
    if (xsltProcessor != nullptr) {
1449 1449
        const char * errCode = xsltProcessor->getErrorCode((int)index);
1450
        if(errCode != NULL) {
1450
        if(errCode != nullptr) {
1451 1451
            char *str = estrdup(errCode);
1452 1452
            RETURN_STRING(str, 0);
1453 1453
        }
1454 1454
    }
1455
    RETURN_NULL();
1455
    RETURN_nullptr();
1456 1456
}
1457 1457

  
1458 1458
PHP_METHOD(XsltProcessor, getErrorMessage)
......
1460 1460
    XsltProcessor *xsltProcessor;
1461 1461
    long index;
1462 1462
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &index) == FAILURE) {
1463
        RETURN_NULL();
1463
        RETURN_nullptr();
1464 1464
    }
1465 1465
    xsltProcessor_object *obj = (xsltProcessor_object *)zend_object_store_get_object(getThis() TSRMLS_CC);
1466 1466
    xsltProcessor = obj->xsltProcessor;
1467
    if (xsltProcessor != NULL) {
1467
    if (xsltProcessor != nullptr) {
1468 1468
        const char * errStr = xsltProcessor->getErrorMessage((int)index);
1469
        if(errStr != NULL) {
1469
        if(errStr != nullptr) {
1470 1470
            char *str = estrdup(errStr);
1471 1471
            RETURN_STRING(str, 0);
1472 1472
        }
1473 1473
    }
1474
    RETURN_NULL();
1474
    RETURN_nullptr();
1475 1475
}
1476 1476
PHP_METHOD(XsltProcessor, exceptionClear)
1477 1477
{
1478 1478
    XsltProcessor *xsltProcessor;
1479 1479
    xsltProcessor_object *obj = (xsltProcessor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
1480 1480
    xsltProcessor = obj->xsltProcessor;
1481
    if (xsltProcessor != NULL) {
1481
    if (xsltProcessor != nullptr) {
1482 1482
        xsltProcessor->exceptionClear();
1483 1483
    }
1484 1484
}
......
1506 1506
    obj->std.ce = type;
1507 1507

  
1508 1508
    ALLOC_HASHTABLE(obj->std.properties);
1509
    zend_hash_init(obj->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
1509
    zend_hash_init(obj->std.properties, 0, nullptr, ZVAL_PTR_DTOR, 0);
1510 1510
    object_properties_init(&obj->std, type);
1511
    retval.handle = zend_objects_store_put(obj, NULL, Xslt30Processor_free_storage, NULL TSRMLS_CC);
1511
    retval.handle = zend_objects_store_put(obj, nullptr, Xslt30Processor_free_storage, nullptr TSRMLS_CC);
1512 1512
    retval.handlers = &xslt30Processor_object_handlers;
1513 1513

  
1514 1514
    return retval;
......
1534 1534
    int len1;
1535 1535

  
1536 1536
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &len1) == FAILURE) {
1537
        RETURN_NULL();
1537
        RETURN_nullptr();
1538 1538
    }
1539 1539
    xslt30Processor_object *obj = (xslt30Processor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
1540 1540
    xslt30Processor = obj->xslt30Processor;
1541
    if (xslt30Processor != NULL) {
1541
    if (xslt30Processor != nullptr) {
1542 1542
        xslt30Processor->setBaseOutputURI(name);
1543 1543
    }
1544 1544
}
......
1571 1571
    size_t len1, len2;
1572 1572

  
1573 1573
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssz", &styleFileName, &len1, &functionName, &len2, &arguments_zval) == FAILURE) {
1574
        RETURN_NULL();
1574
        RETURN_nullptr();
1575 1575
    }
1576 1576

  
1577 1577

  
......
1583 1583
   
1584 1584
    arguments = new XdmValue*[argument_length];
1585 1585

  
1586
    if (xslt30Processor != NULL) {
1586
    if (xslt30Processor != nullptr) {
1587 1587
      for(zend_hash_internal_pointer_reset_ex(arr_hash, &pointer); zend_hash_get_current_data_ex(arr_hash, (void**) &val, &pointer) == SUCCESS; zend_hash_move_forward_ex(arr_hash, &pointer)) {
1588
        //if(Z_TYPE_P(val) != NULL) {
1588
        //if(Z_TYPE_P(val) != nullptr) {
1589 1589

  
1590
        if(Z_TYPE_PP(val) != IS_NULL) {
1590
        if(Z_TYPE_PP(val) != IS_nullptr) {
1591 1591
                     // zend_object* ooth = Z_OBJCE_PP(val);
1592 1592
                    const char * objName = Z_OBJCE_PP(val)->name;
1593
                    char *key = NULL;
1593
                    char *key = nullptr;
1594 1594
                    uint  klen;
1595 1595
                    ulong index;
1596 1596

  
......
1608 1608
	*/
1609 1609
	if(strcmp(objName, "Saxon\\XdmNode")==0) {
1610 1610
        xdmNode_object* nobj = (xdmNode_object*)zend_object_store_get_object((*val) TSRMLS_CC);
1611
        	if(nobj != NULL) {
1611
        	if(nobj != nullptr) {
1612 1612
            		XdmValue * value = (XdmValue *) nobj->xdmNode;
1613 1613
            		arguments[index] = value;
1614 1614
        	}
......
1616 1616
	else if(strcmp(objName, "Saxon\\XdmAtomicValue")==0) {
1617 1617
        xdmAtomicValue_object* nobj = (xdmAtomicValue_object*)zend_object_store_get_object((*val) TSRMLS_CC);
1618 1618
		//xdmAtomicValue_object * nobj = (xdmAtomicValue_object *)((char *)ooth - XtOffsetOf(xdmAtomicValue_object, std));
1619
        	if(nobj != NULL) {
1619
        	if(nobj != nullptr) {
1620 1620
            		XdmValue * value = (XdmValue *) nobj->xdmAtomicValue;
1621 1621
            		arguments[index] = value;
1622 1622
        	}
......
1624 1624
	else if(strcmp(objName, "Saxon\\XdmValue")==0) {
1625 1625
		xdmValue_object* nobj = ( xdmValue_object*)zend_object_store_get_object((*val) TSRMLS_CC);
1626 1626
		//xdmValue_object * nobj = (xdmValue_object *)((char *)ooth - XtOffsetOf(xdmValue_object, std));
1627
        	if(nobj != NULL) {
1627
        	if(nobj != nullptr) {
1628 1628
            		XdmValue * value = nobj->xdmValue;
1629 1629
            		arguments[index] = value;
1630 1630
        	}
......
1637 1637

  
1638 1638
	//php_printf(" argument_length= %d",argument_length);
1639 1639
        XdmValue * result = xslt30Processor->callFunctionReturningValue(styleFileName, functionName, arguments, argument_length);
1640
	if(result != NULL) {
1640
	if(result != nullptr) {
1641 1641
            if (object_init_ex(return_value, xdmValue_ce) != SUCCESS) {
1642
                RETURN_NULL();
1642
                RETURN_nullptr();
1643 1643
            } else {
1644 1644
                struct xdmValue_object* vobj  = (struct xdmValue_object*) zend_object_store_get_object(return_value TSRMLS_CC);
1645 1645
		        //xdmValue_object* vobj  = (xdmValue_object *)((char *)ooth - XtOffsetOf(xdmValue_object, std));
1646
                assert (vobj != NULL);
1646
                assert (vobj != nullptr);
1647 1647
                vobj->xdmValue = result;
1648 1648
            }
1649 1649
        } else {
......
1675 1675
    size_t len1, len2;
1676 1676

  
1677 1677
       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssz", &styleFileName, &len1, &functionName, &len2, &arguments_zval) == FAILURE) {
1678
        RETURN_NULL();
1678
        RETURN_nullptr();
1679 1679
    }
1680 1680

  
1681 1681
  
......
1686 1686
   
1687 1687
    arguments = new XdmValue*[argument_length];
1688 1688

  
1689
    if (xslt30Processor != NULL) {
1689
    if (xslt30Processor != nullptr) {
1690 1690
      for(zend_hash_internal_pointer_reset_ex(arr_hash, &pointer); zend_hash_get_current_data_ex(arr_hash, (void**) &val, &pointer) == SUCCESS; zend_hash_move_forward_ex(arr_hash, &pointer)) {
1691
              if(Z_TYPE_PP(val) != IS_NULL) {
1691
              if(Z_TYPE_PP(val) != IS_nullptr) {
1692 1692
              const char* objName = Z_OBJCE_PP(val)->name;
1693 1693
      	      //const char * objName = ooth->name;
1694 1694

  
1695
      	char *key = NULL;
1695
      	char *key = nullptr;
1696 1696
         uint  klen;
1697 1697
         ulong index;
1698 1698

  
......
1710 1710
	if(strcmp(objName, "Saxon\\XdmNode")==0) {
1711 1711
        xdmNode_object* nobj = (xdmNode_object*)zend_object_store_get_object((*val) TSRMLS_CC);
1712 1712
		//xdmNode_object * nobj = (xdmNode_object *)((char *)ooth - XtOffsetOf(xdmNode_object, std));
1713
        	if(nobj != NULL) {
1713
        	if(nobj != nullptr) {
1714 1714
            		XdmValue * value = (XdmValue *) nobj->xdmNode;
1715 1715
            		arguments[index] = value;
1716 1716
        	}
......
1718 1718
	else if(strcmp(objName, "Saxon\\XdmAtomicValue")==0) {
1719 1719
		//xdmAtomicValue_object * nobj = (xdmAtomicValue_object *)((char *)ooth - XtOffsetOf(xdmAtomicValue_object, std));
1720 1720
		xdmAtomicValue_object* nobj = (xdmAtomicValue_object*)zend_object_store_get_object((*val) TSRMLS_CC);
1721
        	if(nobj != NULL) {
1721
        	if(nobj != nullptr) {
1722 1722
            		XdmValue * value = (XdmValue *) nobj->xdmAtomicValue;
1723 1723
            		arguments[index] = value;
1724 1724
        	}
......
1726 1726
	else if(strcmp(objName, "Saxon\\XdmValue")==0) {
1727 1727
		//xdmValue_object * nobj = (xdmValue_object *)((char *)ooth - XtOffsetOf(xdmValue_object, std));
1728 1728
		xdmValue_object* nobj = (xdmValue_object*)zend_object_store_get_object((*val) TSRMLS_CC);
1729
        	if(nobj != NULL) {
1729
        	if(nobj != nullptr) {
1730 1730
            		XdmValue * value = nobj->xdmValue;
1731 1731
            		arguments[index] = value;
1732 1732
        	}
......
1738 1738
      }
1739 1739

  
1740 1740
        const char * result = xslt30Processor->callFunctionReturningString(styleFileName, functionName, arguments, argument_length);
1741
	if(result != NULL) {
1741
	if(result != nullptr) {
1742 1742
            //char *str = estrdup(result);
1743 1743
            RETURN_STRING(result, 0);
1744 1744
        } else if(xslt30Processor->exceptionOccurred()){
1745 1745
            //TODO: xslt30Processor->checkException();
1746 1746
            const char * errStr = xslt30Processor->getErrorMessage(0);
1747
            if(errStr != NULL) {
1747
            if(errStr != nullptr) {
1748 1748
                const char * errorCode = xslt30Processor->getErrorCode(0);
1749
                if(errorCode!=NULL) {
1749
                if(errorCode!=nullptr) {
1750 1750
                    // TODO: throw exception
1751 1751
                }
1752 1752
            }
......
1779 1779
    size_t len1, len2, len3;
1780 1780

  
1781 1781
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sszs", &styleFileName, &len1, &functionName, &len2, &arguments_zval, &outfilename, &len3) == FAILURE) {
1782
        RETURN_NULL();
1782
        RETURN_nullptr();
1783 1783
    }
1784 1784

  
1785 1785
    xslt30Processor_object *obj = (xslt30Processor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
......
1789 1789
   
1790 1790
    arguments = new XdmValue*[argument_length];
1791 1791

  
1792
    if (xslt30Processor != NULL) {
1792
    if (xslt30Processor != nullptr) {
1793 1793
    for(zend_hash_internal_pointer_reset_ex(arr_hash, &pointer); zend_hash_get_current_data_ex(arr_hash, (void**) &val, &pointer) == SUCCESS; zend_hash_move_forward_ex(arr_hash, &pointer)) {
1794
            if(Z_TYPE_PP(val) != IS_NULL) {
1794
            if(Z_TYPE_PP(val) != IS_nullptr) {
1795 1795
            const char * objName = Z_OBJCE_PP(val)->name;
1796 1796
          	//const char * objName = ooth->name;
1797
            char *key = NULL;
1797
            char *key = nullptr;
1798 1798
            uint  klen;
1799 1799
            ulong index;
1800 1800

  
......
1809 1809
	*/
1810 1810
	if(strcmp(objName, "Saxon\\XdmNode")==0) {
1811 1811
		xdmNode_object* nobj = (xdmNode_object*)zend_object_store_get_object((*val) TSRMLS_CC);
1812
        	if(nobj != NULL) {
1812
        	if(nobj != nullptr) {
1813 1813
            		XdmValue * value = (XdmValue *) nobj->xdmNode;
1814 1814
            		arguments[index] = value;
1815 1815
        	}
......
1818 1818
		//zend_object* ooth = Z_OBJCE_P(val);
1819 1819
		//xdmAtomicValue_object * nobj = (xdmAtomicValue_object *)((char *)ooth - XtOffsetOf(xdmAtomicValue_object, std));
1820 1820
		xdmAtomicValue_object* nobj = (xdmAtomicValue_object*)zend_object_store_get_object((*val) TSRMLS_CC);
1821
        	if(nobj != NULL) {
1821
        	if(nobj != nullptr) {
1822 1822
            		XdmValue * value = (XdmValue *) nobj->xdmAtomicValue;
1823 1823
            		arguments[index] = value;
1824 1824
        	}
......
1826 1826
	else if(strcmp(objName, "Saxon\\XdmValue")==0) {
1827 1827
		//zend_object* ooth = Z_OBJCE_P(val);
1828 1828
		xdmValue_object* nobj = (xdmValue_object*)zend_object_store_get_object((*val) TSRMLS_CC);
1829
        	if(nobj != NULL) {
1829
        	if(nobj != nullptr) {
1830 1830
            		XdmValue * value = nobj->xdmValue;
1831 1831
            		arguments[index] = value;
1832 1832
        	}
......
1842 1842
	if(xslt30Processor->exceptionOccurred()){
1843 1843
            //TODO: xslt30Processor->checkException();
1844 1844
            const char * errStr = xslt30Processor->getErrorMessage(0);
1845
            if(errStr != NULL) {
1845
            if(errStr != nullptr) {
1846 1846
                const char * errorCode = xslt30Processor->getErrorCode(0);
1847 1847
            }
1848 1848
        }
......
1859 1859
    size_t len1, len2;
1860 1860

  
1861 1861
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &styleFileName, &len1, &templateName, &len2) == FAILURE) {
1862
        RETURN_NULL();
1862
        RETURN_nullptr();
1863 1863
    }
1864 1864

  
1865 1865
    
1866 1866
    xslt30Processor_object *obj = (xslt30Processor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
1867 1867
    xslt30Processor = obj->xslt30Processor;
1868 1868
      
1869
    if (xslt30Processor != NULL) {
1869
    if (xslt30Processor != nullptr) {
1870 1870
   
1871 1871

  
1872 1872
	//php_printf(" argument_length= %d",argument_length);
1873 1873
        XdmValue * result = xslt30Processor->callTemplateReturningValue(styleFileName, templateName);
1874
	if(result != NULL) {
1874
	if(result != nullptr) {
1875 1875
            if (object_init_ex(return_value, xdmValue_ce) != SUCCESS) {
1876
                RETURN_NULL();
1876
                RETURN_nullptr();
1877 1877
            } else {
1878 1878
                struct xdmValue_object* vobj  = (struct xdmValue_object*) zend_object_store_get_object(return_value TSRMLS_CC);
1879 1879
		        //xdmValue_object* vobj  = (xdmValue_object *)((char *)ooth - XtOffsetOf(xdmValue_object, std));
1880
                assert (vobj != NULL);
1880
                assert (vobj != nullptr);
1881 1881
                vobj->xdmValue = result;
1882 1882
            }
1883 1883
        } else {
......
1898 1898
    size_t len1, len2;
1899 1899

  
1900 1900
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &styleFileName, &len1, &templateName, &len2) == FAILURE) {
1901
        RETURN_NULL();
1901
        RETURN_nullptr();
1902 1902
    }
1903 1903

  
1904 1904
    
1905 1905
    xslt30Processor_object *obj = (xslt30Processor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
1906 1906
    xslt30Processor = obj->xslt30Processor;
1907 1907
      
1908
    if (xslt30Processor != NULL) {
1908
    if (xslt30Processor != nullptr) {
1909 1909
   
1910 1910

  
1911 1911
	//php_printf(" argument_length= %d",argument_length);
1912 1912
        const char * result = xslt30Processor->callTemplateReturningString(styleFileName, templateName);
1913
	if(result != NULL) {
1913
	if(result != nullptr) {
1914 1914
            RETURN_STRING(result, 0);
1915 1915
        } else {
1916 1916
            if(xslt30Processor->exceptionOccurred()){
1917 1917
            xslt30Processor->checkException();
1918 1918
            const char * errStr = xslt30Processor->getErrorMessage(0);
1919
            if(errStr != NULL) {
1919
            if(errStr != nullptr) {
1920 1920
                const char * errorCode = xslt30Processor->getErrorCode(0);
1921
                if(errorCode!=NULL) {
1921
                if(errorCode!=nullptr) {
1922 1922
                    // TODO: throw exception
1923 1923
                }
1924 1924
            }
......
1926 1926
        }
1927 1927
    }
1928 1928

  
1929
     RETURN_NULL();
1929
     RETURN_nullptr();
1930 1930
    }
1931 1931

  
1932 1932
    PHP_METHOD(Xslt30Processor, callTemplateReturningFile){
......
1937 1937
    size_t len1, len2, len3;
1938 1938

  
1939 1939
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &styleFileName, &len1, &templateName, &len2, &filename, &len3) == FAILURE) {
1940
        RETURN_NULL();
1940
        RETURN_nullptr();
1941 1941
    }
1942 1942

  
1943 1943
    
1944 1944
    xslt30Processor_object *obj = (xslt30Processor_object *) zend_object_store_get_object(getThis() TSRMLS_CC);
1945 1945
    xslt30Processor = obj->xslt30Processor;
1946 1946
      
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff