@@ -2358,6 +2358,28 @@ void delete_model(void *handle)
2358
2358
efree (tmp );
2359
2359
}
2360
2360
2361
+ void delete_model_persistent (void * handle )
2362
+ {
2363
+ sdlContentModelPtr tmp = * ((sdlContentModelPtr * )handle );
2364
+ switch (tmp -> kind ) {
2365
+ case XSD_CONTENT_ELEMENT :
2366
+ case XSD_CONTENT_GROUP :
2367
+ break ;
2368
+ case XSD_CONTENT_SEQUENCE :
2369
+ case XSD_CONTENT_ALL :
2370
+ case XSD_CONTENT_CHOICE :
2371
+ zend_hash_destroy (tmp -> u .content );
2372
+ free (tmp -> u .content );
2373
+ break ;
2374
+ case XSD_CONTENT_GROUP_REF :
2375
+ free (tmp -> u .group_ref );
2376
+ break ;
2377
+ default :
2378
+ break ;
2379
+ }
2380
+ free (tmp );
2381
+ }
2382
+
2361
2383
void delete_type (void * data )
2362
2384
{
2363
2385
sdlTypePtr type = * ((sdlTypePtr * )data );
@@ -2405,6 +2427,53 @@ void delete_type(void *data)
2405
2427
efree (type );
2406
2428
}
2407
2429
2430
+ void delete_type_persistent (void * data )
2431
+ {
2432
+ sdlTypePtr type = * ((sdlTypePtr * )data );
2433
+ if (type -> name ) {
2434
+ free (type -> name );
2435
+ }
2436
+ if (type -> namens ) {
2437
+ free (type -> namens );
2438
+ }
2439
+ if (type -> def ) {
2440
+ free (type -> def );
2441
+ }
2442
+ if (type -> fixed ) {
2443
+ free (type -> fixed );
2444
+ }
2445
+ if (type -> elements ) {
2446
+ zend_hash_destroy (type -> elements );
2447
+ free (type -> elements );
2448
+ }
2449
+ if (type -> attributes ) {
2450
+ zend_hash_destroy (type -> attributes );
2451
+ free (type -> attributes );
2452
+ }
2453
+ if (type -> model ) {
2454
+ delete_model_persistent ((void * * )& type -> model );
2455
+ }
2456
+ if (type -> restrictions ) {
2457
+ delete_restriction_var_int_persistent (& type -> restrictions -> minExclusive );
2458
+ delete_restriction_var_int_persistent (& type -> restrictions -> minInclusive );
2459
+ delete_restriction_var_int_persistent (& type -> restrictions -> maxExclusive );
2460
+ delete_restriction_var_int_persistent (& type -> restrictions -> maxInclusive );
2461
+ delete_restriction_var_int_persistent (& type -> restrictions -> totalDigits );
2462
+ delete_restriction_var_int_persistent (& type -> restrictions -> fractionDigits );
2463
+ delete_restriction_var_int_persistent (& type -> restrictions -> length );
2464
+ delete_restriction_var_int_persistent (& type -> restrictions -> minLength );
2465
+ delete_restriction_var_int_persistent (& type -> restrictions -> maxLength );
2466
+ delete_restriction_var_char_persistent (& type -> restrictions -> whiteSpace );
2467
+ delete_restriction_var_char_persistent (& type -> restrictions -> pattern );
2468
+ if (type -> restrictions -> enumeration ) {
2469
+ zend_hash_destroy (type -> restrictions -> enumeration );
2470
+ free (type -> restrictions -> enumeration );
2471
+ }
2472
+ free (type -> restrictions );
2473
+ }
2474
+ free (type );
2475
+ }
2476
+
2408
2477
void delete_extra_attribute (void * attribute )
2409
2478
{
2410
2479
sdlExtraAttributePtr attr = * ((sdlExtraAttributePtr * )attribute );
@@ -2418,6 +2487,19 @@ void delete_extra_attribute(void *attribute)
2418
2487
efree (attr );
2419
2488
}
2420
2489
2490
+ void delete_extra_attribute_persistent (void * attribute )
2491
+ {
2492
+ sdlExtraAttributePtr attr = * ((sdlExtraAttributePtr * )attribute );
2493
+
2494
+ if (attr -> ns ) {
2495
+ free (attr -> ns );
2496
+ }
2497
+ if (attr -> val ) {
2498
+ free (attr -> val );
2499
+ }
2500
+ free (attr );
2501
+ }
2502
+
2421
2503
void delete_attribute (void * attribute )
2422
2504
{
2423
2505
sdlAttributePtr attr = * ((sdlAttributePtr * )attribute );
@@ -2444,6 +2526,32 @@ void delete_attribute(void *attribute)
2444
2526
efree (attr );
2445
2527
}
2446
2528
2529
+ void delete_attribute_persistent (void * attribute )
2530
+ {
2531
+ sdlAttributePtr attr = * ((sdlAttributePtr * )attribute );
2532
+
2533
+ if (attr -> def ) {
2534
+ free (attr -> def );
2535
+ }
2536
+ if (attr -> fixed ) {
2537
+ free (attr -> fixed );
2538
+ }
2539
+ if (attr -> name ) {
2540
+ free (attr -> name );
2541
+ }
2542
+ if (attr -> namens ) {
2543
+ free (attr -> namens );
2544
+ }
2545
+ if (attr -> ref ) {
2546
+ free (attr -> ref );
2547
+ }
2548
+ if (attr -> extraAttributes ) {
2549
+ zend_hash_destroy (attr -> extraAttributes );
2550
+ free (attr -> extraAttributes );
2551
+ }
2552
+ free (attr );
2553
+ }
2554
+
2447
2555
void delete_restriction_var_int (void * rvi )
2448
2556
{
2449
2557
sdlRestrictionIntPtr ptr = * ((sdlRestrictionIntPtr * )rvi );
@@ -2452,6 +2560,14 @@ void delete_restriction_var_int(void *rvi)
2452
2560
}
2453
2561
}
2454
2562
2563
+ void delete_restriction_var_int_persistent (void * rvi )
2564
+ {
2565
+ sdlRestrictionIntPtr ptr = * ((sdlRestrictionIntPtr * )rvi );
2566
+ if (ptr ) {
2567
+ free (ptr );
2568
+ }
2569
+ }
2570
+
2455
2571
void delete_restriction_var_char (void * srvc )
2456
2572
{
2457
2573
sdlRestrictionCharPtr ptr = * ((sdlRestrictionCharPtr * )srvc );
@@ -2462,3 +2578,14 @@ void delete_restriction_var_char(void *srvc)
2462
2578
efree (ptr );
2463
2579
}
2464
2580
}
2581
+
2582
+ void delete_restriction_var_char_persistent (void * srvc )
2583
+ {
2584
+ sdlRestrictionCharPtr ptr = * ((sdlRestrictionCharPtr * )srvc );
2585
+ if (ptr ) {
2586
+ if (ptr -> value ) {
2587
+ free (ptr -> value );
2588
+ }
2589
+ free (ptr );
2590
+ }
2591
+ }
0 commit comments