Changeset 268
- Timestamp:
- 11/24/10 12:53:38 (13 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/CHANGES
r266 r268 1 =========== 4.X.X 2 * New generated files for pbs_wrap.c and pbs.py to support python 3.X versions 3 1 4 =========== 4.3.0 2 5 * new_rack_pbsmon.py: For backward compatibility added -a/--all option. -
trunk/src/pbs_2.1.py
r253 r268 1 1 # This file was automatically generated by SWIG (http://www.swig.org). 2 # Version 1.3. 362 # Version 1.3.40 3 3 # 4 # Don't modify this file, modify the SWIG interface instead. 4 # Do not make changes to this file unless you know what you are doing--modify 5 # the SWIG interface file instead. 5 6 # This file is compatible with both classic and new-style classes. 6 7 7 import _pbs 8 import new 9 new_instancemethod = new.instancemethod 8 from sys import version_info 9 if version_info >= (2,6,0): 10 def swig_import_helper(): 11 from os.path import dirname 12 import imp 13 fp = None 14 try: 15 fp, pathname, description = imp.find_module('_pbs', [dirname(__file__)]) 16 except ImportError: 17 import _pbs 18 return _pbs 19 if fp is not None: 20 try: 21 _mod = imp.load_module('_pbs', fp, pathname, description) 22 finally: 23 fp.close() 24 return _mod 25 _pbs = swig_import_helper() 26 del swig_import_helper 27 else: 28 import _pbs 29 del version_info 10 30 try: 11 31 _swig_property = property … … 15 35 if (name == "thisown"): return self.this.own(value) 16 36 if (name == "this"): 17 if type(value).__name__ == ' PySwigObject':37 if type(value).__name__ == 'SwigPyObject': 18 38 self.__dict__[name] = value 19 39 return … … 32 52 method = class_type.__swig_getmethods__.get(name,None) 33 53 if method: return method(self) 34 raise AttributeError ,name54 raise AttributeError(name) 35 55 36 56 def _swig_repr(self): … … 39 59 return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) 40 60 41 import types42 61 try: 43 _object = types.ObjectType62 _object = object 44 63 _newclass = 1 45 64 except AttributeError: 46 65 class _object : pass 47 66 _newclass = 0 48 del types 49 50 67 68 69 70 def new_attrl(*args): 71 return _pbs.new_attrl(*args) 51 72 new_attrl = _pbs.new_attrl 73 74 def new_attropl(*args): 75 return _pbs.new_attropl(*args) 52 76 new_attropl = _pbs.new_attropl 77 78 def new_batch_status(): 79 return _pbs.new_batch_status() 53 80 new_batch_status = _pbs.new_batch_status 81 82 def get_error(): 83 return _pbs.get_error() 54 84 get_error = _pbs.get_error 55 85 ATTR_a = _pbs.ATTR_a … … 327 357 __swig_getmethods__ = {} 328 358 __getattr__ = lambda self, name: _swig_getattr(self, attrl, name) 329 def __init__(self, *args, **kwargs): raise AttributeError , "No constructor defined"359 def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined") 330 360 __repr__ = _swig_repr 331 361 __swig_setmethods__["next"] = _pbs.attrl_next_set … … 344 374 __swig_getmethods__["op"] = _pbs.attrl_op_get 345 375 if _newclass:op = _swig_property(_pbs.attrl_op_get, _pbs.attrl_op_set) 346 def __str__( *args): return _pbs.attrl___str__(*args)376 def __str__(self): return _pbs.attrl___str__(self) 347 377 __swig_destroy__ = _pbs.delete_attrl 348 378 __del__ = lambda self : None; … … 355 385 __swig_getmethods__ = {} 356 386 __getattr__ = lambda self, name: _swig_getattr(self, attropl, name) 357 def __init__(self, *args, **kwargs): raise AttributeError , "No constructor defined"387 def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined") 358 388 __repr__ = _swig_repr 359 389 __swig_setmethods__["next"] = _pbs.attropl_next_set … … 372 402 __swig_getmethods__["op"] = _pbs.attropl_op_get 373 403 if _newclass:op = _swig_property(_pbs.attropl_op_get, _pbs.attropl_op_set) 374 def __str__( *args): return _pbs.attropl___str__(*args)404 def __str__(self): return _pbs.attropl___str__(self) 375 405 __swig_destroy__ = _pbs.delete_attropl 376 406 __del__ = lambda self : None; … … 383 413 __swig_getmethods__ = {} 384 414 __getattr__ = lambda self, name: _swig_getattr(self, batch_status, name) 385 def __init__(self, *args, **kwargs): raise AttributeError , "No constructor defined"415 def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined") 386 416 __repr__ = _swig_repr 387 417 __swig_setmethods__["next"] = _pbs.batch_status_next_set … … 400 430 batch_status_swigregister(batch_status) 401 431 432 433 def avail(*args): 434 return _pbs.avail(*args) 402 435 avail = _pbs.avail 436 437 def pbs_asyrunjob(*args): 438 return _pbs.pbs_asyrunjob(*args) 403 439 pbs_asyrunjob = _pbs.pbs_asyrunjob 440 441 def pbs_alterjob(*args): 442 return _pbs.pbs_alterjob(*args) 404 443 pbs_alterjob = _pbs.pbs_alterjob 444 445 def pbs_connect(*args): 446 return _pbs.pbs_connect(*args) 405 447 pbs_connect = _pbs.pbs_connect 448 449 def pbs_query_max_connections(): 450 return _pbs.pbs_query_max_connections() 406 451 pbs_query_max_connections = _pbs.pbs_query_max_connections 452 453 def pbs_default(): 454 return _pbs.pbs_default() 407 455 pbs_default = _pbs.pbs_default 456 457 def pbs_deljob(*args): 458 return _pbs.pbs_deljob(*args) 408 459 pbs_deljob = _pbs.pbs_deljob 460 461 def pbs_disconnect(*args): 462 return _pbs.pbs_disconnect(*args) 409 463 pbs_disconnect = _pbs.pbs_disconnect 464 465 def pbs_geterrmsg(*args): 466 return _pbs.pbs_geterrmsg(*args) 410 467 pbs_geterrmsg = _pbs.pbs_geterrmsg 468 469 def pbs_holdjob(*args): 470 return _pbs.pbs_holdjob(*args) 411 471 pbs_holdjob = _pbs.pbs_holdjob 472 473 def pbs_locjob(*args): 474 return _pbs.pbs_locjob(*args) 412 475 pbs_locjob = _pbs.pbs_locjob 476 477 def pbs_manager(*args): 478 return _pbs.pbs_manager(*args) 413 479 pbs_manager = _pbs.pbs_manager 480 481 def pbs_movejob(*args): 482 return _pbs.pbs_movejob(*args) 414 483 pbs_movejob = _pbs.pbs_movejob 484 485 def pbs_msgjob(*args): 486 return _pbs.pbs_msgjob(*args) 415 487 pbs_msgjob = _pbs.pbs_msgjob 488 489 def pbs_orderjob(*args): 490 return _pbs.pbs_orderjob(*args) 416 491 pbs_orderjob = _pbs.pbs_orderjob 492 493 def pbs_rescquery(*args): 494 return _pbs.pbs_rescquery(*args) 417 495 pbs_rescquery = _pbs.pbs_rescquery 496 497 def pbs_rescreserve(*args): 498 return _pbs.pbs_rescreserve(*args) 418 499 pbs_rescreserve = _pbs.pbs_rescreserve 500 501 def pbs_rescrelease(*args): 502 return _pbs.pbs_rescrelease(*args) 419 503 pbs_rescrelease = _pbs.pbs_rescrelease 504 505 def pbs_rerunjob(*args): 506 return _pbs.pbs_rerunjob(*args) 420 507 pbs_rerunjob = _pbs.pbs_rerunjob 508 509 def pbs_rlsjob(*args): 510 return _pbs.pbs_rlsjob(*args) 421 511 pbs_rlsjob = _pbs.pbs_rlsjob 512 513 def pbs_runjob(*args): 514 return _pbs.pbs_runjob(*args) 422 515 pbs_runjob = _pbs.pbs_runjob 516 517 def pbs_selectjob(*args): 518 return _pbs.pbs_selectjob(*args) 423 519 pbs_selectjob = _pbs.pbs_selectjob 520 521 def pbs_sigjob(*args): 522 return _pbs.pbs_sigjob(*args) 424 523 pbs_sigjob = _pbs.pbs_sigjob 524 525 def pbs_statfree(*args): 526 return _pbs.pbs_statfree(*args) 425 527 pbs_statfree = _pbs.pbs_statfree 528 529 def pbs_statjob(*args): 530 return _pbs.pbs_statjob(*args) 426 531 pbs_statjob = _pbs.pbs_statjob 532 533 def pbs_selstat(*args): 534 return _pbs.pbs_selstat(*args) 427 535 pbs_selstat = _pbs.pbs_selstat 536 537 def pbs_statque(*args): 538 return _pbs.pbs_statque(*args) 428 539 pbs_statque = _pbs.pbs_statque 540 541 def pbs_statserver(*args): 542 return _pbs.pbs_statserver(*args) 429 543 pbs_statserver = _pbs.pbs_statserver 544 545 def pbs_statnode(*args): 546 return _pbs.pbs_statnode(*args) 430 547 pbs_statnode = _pbs.pbs_statnode 548 549 def pbs_submit(*args): 550 return _pbs.pbs_submit(*args) 431 551 pbs_submit = _pbs.pbs_submit 552 553 def pbs_terminate(*args): 554 return _pbs.pbs_terminate(*args) 432 555 pbs_terminate = _pbs.pbs_terminate 556 557 def totpool(*args): 558 return _pbs.totpool(*args) 433 559 totpool = _pbs.totpool 560 561 def usepool(*args): 562 return _pbs.usepool(*args) 434 563 usepool = _pbs.usepool 564 565 def openrm(*args): 566 return _pbs.openrm(*args) 435 567 openrm = _pbs.openrm 568 569 def closerm(*args): 570 return _pbs.closerm(*args) 436 571 closerm = _pbs.closerm 572 573 def downrm(*args): 574 return _pbs.downrm(*args) 437 575 downrm = _pbs.downrm 576 577 def configrm(*args): 578 return _pbs.configrm(*args) 438 579 configrm = _pbs.configrm 580 581 def addreq(*args): 582 return _pbs.addreq(*args) 439 583 addreq = _pbs.addreq 584 585 def allreq(*args): 586 return _pbs.allreq(*args) 440 587 allreq = _pbs.allreq 588 589 def getreq(*args): 590 return _pbs.getreq(*args) 441 591 getreq = _pbs.getreq 592 593 def flushreq(): 594 return _pbs.flushreq() 442 595 flushreq = _pbs.flushreq 596 597 def activereq(): 598 return _pbs.activereq() 443 599 activereq = _pbs.activereq 600 601 def fullresp(*args): 602 return _pbs.fullresp(*args) 444 603 fullresp = _pbs.fullresp 445 604 LOG_BUF_SIZE = _pbs.LOG_BUF_SIZE … … 452 611 LOG_INFO = _pbs.LOG_INFO 453 612 LOG_DEBUG = _pbs.LOG_DEBUG 613 614 def log_close(*args): 615 return _pbs.log_close(*args) 454 616 log_close = _pbs.log_close 617 618 def log_err(*args): 619 return _pbs.log_err(*args) 455 620 log_err = _pbs.log_err 621 622 def log_event(*args): 623 return _pbs.log_event(*args) 456 624 log_event = _pbs.log_event 625 626 def log_open(*args): 627 return _pbs.log_open(*args) 457 628 log_open = _pbs.log_open 629 630 def log_record(*args): 631 return _pbs.log_record(*args) 458 632 log_record = _pbs.log_record 633 634 def log_roll(*args): 635 return _pbs.log_roll(*args) 459 636 log_roll = _pbs.log_roll 637 638 def log_size(): 639 return _pbs.log_size() 460 640 log_size = _pbs.log_size 641 642 def chk_file_sec(*args): 643 return _pbs.chk_file_sec(*args) 461 644 chk_file_sec = _pbs.chk_file_sec 645 646 def setup_env(*args): 647 return _pbs.setup_env(*args) 462 648 setup_env = _pbs.setup_env 463 649 PBSEVENT_ERROR = _pbs.PBSEVENT_ERROR … … 618 804 619 805 version_info = ( 4, 2, 0 ) 620 version = 'SARA pbs_python version 4. 2.0'806 version = 'SARA pbs_python version 4.1.0' 621 807 622 808 # A useful dict with error codes to text -
trunk/src/pbs_2.4.py
r253 r268 1 1 # This file was automatically generated by SWIG (http://www.swig.org). 2 # Version 1.3. 362 # Version 1.3.40 3 3 # 4 # Don't modify this file, modify the SWIG interface instead. 4 # Do not make changes to this file unless you know what you are doing--modify 5 # the SWIG interface file instead. 5 6 # This file is compatible with both classic and new-style classes. 6 7 7 import _pbs 8 import new 9 new_instancemethod = new.instancemethod 8 from sys import version_info 9 if version_info >= (2,6,0): 10 def swig_import_helper(): 11 from os.path import dirname 12 import imp 13 fp = None 14 try: 15 fp, pathname, description = imp.find_module('_pbs', [dirname(__file__)]) 16 except ImportError: 17 import _pbs 18 return _pbs 19 if fp is not None: 20 try: 21 _mod = imp.load_module('_pbs', fp, pathname, description) 22 finally: 23 fp.close() 24 return _mod 25 _pbs = swig_import_helper() 26 del swig_import_helper 27 else: 28 import _pbs 29 del version_info 10 30 try: 11 31 _swig_property = property … … 15 35 if (name == "thisown"): return self.this.own(value) 16 36 if (name == "this"): 17 if type(value).__name__ == ' PySwigObject':37 if type(value).__name__ == 'SwigPyObject': 18 38 self.__dict__[name] = value 19 39 return … … 32 52 method = class_type.__swig_getmethods__.get(name,None) 33 53 if method: return method(self) 34 raise AttributeError ,name54 raise AttributeError(name) 35 55 36 56 def _swig_repr(self): … … 39 59 return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) 40 60 41 import types42 61 try: 43 _object = types.ObjectType62 _object = object 44 63 _newclass = 1 45 64 except AttributeError: 46 65 class _object : pass 47 66 _newclass = 0 48 del types 49 50 67 68 69 70 def new_attrl(*args): 71 return _pbs.new_attrl(*args) 51 72 new_attrl = _pbs.new_attrl 73 74 def new_attropl(*args): 75 return _pbs.new_attropl(*args) 52 76 new_attropl = _pbs.new_attropl 77 78 def new_batch_status(): 79 return _pbs.new_batch_status() 53 80 new_batch_status = _pbs.new_batch_status 81 82 def get_error(): 83 return _pbs.get_error() 54 84 get_error = _pbs.get_error 55 85 ATTR_a = _pbs.ATTR_a … … 327 357 __swig_getmethods__ = {} 328 358 __getattr__ = lambda self, name: _swig_getattr(self, attrl, name) 329 def __init__(self, *args, **kwargs): raise AttributeError , "No constructor defined"359 def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined") 330 360 __repr__ = _swig_repr 331 361 __swig_setmethods__["next"] = _pbs.attrl_next_set … … 344 374 __swig_getmethods__["op"] = _pbs.attrl_op_get 345 375 if _newclass:op = _swig_property(_pbs.attrl_op_get, _pbs.attrl_op_set) 346 def __str__( *args): return _pbs.attrl___str__(*args)376 def __str__(self): return _pbs.attrl___str__(self) 347 377 __swig_destroy__ = _pbs.delete_attrl 348 378 __del__ = lambda self : None; … … 355 385 __swig_getmethods__ = {} 356 386 __getattr__ = lambda self, name: _swig_getattr(self, attropl, name) 357 def __init__(self, *args, **kwargs): raise AttributeError , "No constructor defined"387 def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined") 358 388 __repr__ = _swig_repr 359 389 __swig_setmethods__["next"] = _pbs.attropl_next_set … … 372 402 __swig_getmethods__["op"] = _pbs.attropl_op_get 373 403 if _newclass:op = _swig_property(_pbs.attropl_op_get, _pbs.attropl_op_set) 374 def __str__( *args): return _pbs.attropl___str__(*args)404 def __str__(self): return _pbs.attropl___str__(self) 375 405 __swig_destroy__ = _pbs.delete_attropl 376 406 __del__ = lambda self : None; … … 383 413 __swig_getmethods__ = {} 384 414 __getattr__ = lambda self, name: _swig_getattr(self, batch_status, name) 385 def __init__(self, *args, **kwargs): raise AttributeError , "No constructor defined"415 def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined") 386 416 __repr__ = _swig_repr 387 417 __swig_setmethods__["next"] = _pbs.batch_status_next_set … … 400 430 batch_status_swigregister(batch_status) 401 431 432 433 def avail(*args): 434 return _pbs.avail(*args) 402 435 avail = _pbs.avail 436 437 def pbs_asyrunjob(*args): 438 return _pbs.pbs_asyrunjob(*args) 403 439 pbs_asyrunjob = _pbs.pbs_asyrunjob 440 441 def pbs_alterjob(*args): 442 return _pbs.pbs_alterjob(*args) 404 443 pbs_alterjob = _pbs.pbs_alterjob 444 445 def pbs_connect(*args): 446 return _pbs.pbs_connect(*args) 405 447 pbs_connect = _pbs.pbs_connect 448 449 def pbs_query_max_connections(): 450 return _pbs.pbs_query_max_connections() 406 451 pbs_query_max_connections = _pbs.pbs_query_max_connections 452 453 def pbs_default(): 454 return _pbs.pbs_default() 407 455 pbs_default = _pbs.pbs_default 456 457 def pbs_deljob(*args): 458 return _pbs.pbs_deljob(*args) 408 459 pbs_deljob = _pbs.pbs_deljob 460 461 def pbs_disconnect(*args): 462 return _pbs.pbs_disconnect(*args) 409 463 pbs_disconnect = _pbs.pbs_disconnect 464 465 def pbs_geterrmsg(*args): 466 return _pbs.pbs_geterrmsg(*args) 410 467 pbs_geterrmsg = _pbs.pbs_geterrmsg 468 469 def pbs_holdjob(*args): 470 return _pbs.pbs_holdjob(*args) 411 471 pbs_holdjob = _pbs.pbs_holdjob 472 473 def pbs_locjob(*args): 474 return _pbs.pbs_locjob(*args) 412 475 pbs_locjob = _pbs.pbs_locjob 476 477 def pbs_manager(*args): 478 return _pbs.pbs_manager(*args) 413 479 pbs_manager = _pbs.pbs_manager 480 481 def pbs_movejob(*args): 482 return _pbs.pbs_movejob(*args) 414 483 pbs_movejob = _pbs.pbs_movejob 484 485 def pbs_msgjob(*args): 486 return _pbs.pbs_msgjob(*args) 415 487 pbs_msgjob = _pbs.pbs_msgjob 488 489 def pbs_orderjob(*args): 490 return _pbs.pbs_orderjob(*args) 416 491 pbs_orderjob = _pbs.pbs_orderjob 492 493 def pbs_rescquery(*args): 494 return _pbs.pbs_rescquery(*args) 417 495 pbs_rescquery = _pbs.pbs_rescquery 496 497 def pbs_rescreserve(*args): 498 return _pbs.pbs_rescreserve(*args) 418 499 pbs_rescreserve = _pbs.pbs_rescreserve 500 501 def pbs_rescrelease(*args): 502 return _pbs.pbs_rescrelease(*args) 419 503 pbs_rescrelease = _pbs.pbs_rescrelease 504 505 def pbs_rerunjob(*args): 506 return _pbs.pbs_rerunjob(*args) 420 507 pbs_rerunjob = _pbs.pbs_rerunjob 508 509 def pbs_rlsjob(*args): 510 return _pbs.pbs_rlsjob(*args) 421 511 pbs_rlsjob = _pbs.pbs_rlsjob 512 513 def pbs_runjob(*args): 514 return _pbs.pbs_runjob(*args) 422 515 pbs_runjob = _pbs.pbs_runjob 516 517 def pbs_selectjob(*args): 518 return _pbs.pbs_selectjob(*args) 423 519 pbs_selectjob = _pbs.pbs_selectjob 520 521 def pbs_sigjob(*args): 522 return _pbs.pbs_sigjob(*args) 424 523 pbs_sigjob = _pbs.pbs_sigjob 524 525 def pbs_statfree(*args): 526 return _pbs.pbs_statfree(*args) 425 527 pbs_statfree = _pbs.pbs_statfree 528 529 def pbs_statjob(*args): 530 return _pbs.pbs_statjob(*args) 426 531 pbs_statjob = _pbs.pbs_statjob 532 533 def pbs_selstat(*args): 534 return _pbs.pbs_selstat(*args) 427 535 pbs_selstat = _pbs.pbs_selstat 536 537 def pbs_statque(*args): 538 return _pbs.pbs_statque(*args) 428 539 pbs_statque = _pbs.pbs_statque 540 541 def pbs_statserver(*args): 542 return _pbs.pbs_statserver(*args) 429 543 pbs_statserver = _pbs.pbs_statserver 544 545 def pbs_statnode(*args): 546 return _pbs.pbs_statnode(*args) 430 547 pbs_statnode = _pbs.pbs_statnode 548 549 def pbs_submit(*args): 550 return _pbs.pbs_submit(*args) 431 551 pbs_submit = _pbs.pbs_submit 552 553 def pbs_terminate(*args): 554 return _pbs.pbs_terminate(*args) 432 555 pbs_terminate = _pbs.pbs_terminate 556 557 def totpool(*args): 558 return _pbs.totpool(*args) 433 559 totpool = _pbs.totpool 560 561 def usepool(*args): 562 return _pbs.usepool(*args) 434 563 usepool = _pbs.usepool 564 565 def pbs_fbserver(): 566 return _pbs.pbs_fbserver() 435 567 pbs_fbserver = _pbs.pbs_fbserver 568 569 def pbs_get_server_list(): 570 return _pbs.pbs_get_server_list() 436 571 pbs_get_server_list = _pbs.pbs_get_server_list 572 573 def pbs_sigjobasync(*args): 574 return _pbs.pbs_sigjobasync(*args) 437 575 pbs_sigjobasync = _pbs.pbs_sigjobasync 576 577 def pbs_alterjob_async(*args): 578 return _pbs.pbs_alterjob_async(*args) 438 579 pbs_alterjob_async = _pbs.pbs_alterjob_async 580 581 def pbs_checkpointjob(*args): 582 return _pbs.pbs_checkpointjob(*args) 439 583 pbs_checkpointjob = _pbs.pbs_checkpointjob 584 585 def openrm(*args): 586 return _pbs.openrm(*args) 440 587 openrm = _pbs.openrm 588 589 def closerm(*args): 590 return _pbs.closerm(*args) 441 591 closerm = _pbs.closerm 592 593 def downrm(*args): 594 return _pbs.downrm(*args) 442 595 downrm = _pbs.downrm 596 597 def configrm(*args): 598 return _pbs.configrm(*args) 443 599 configrm = _pbs.configrm 600 601 def addreq(*args): 602 return _pbs.addreq(*args) 444 603 addreq = _pbs.addreq 604 605 def allreq(*args): 606 return _pbs.allreq(*args) 445 607 allreq = _pbs.allreq 608 609 def getreq(*args): 610 return _pbs.getreq(*args) 446 611 getreq = _pbs.getreq 612 613 def flushreq(): 614 return _pbs.flushreq() 447 615 flushreq = _pbs.flushreq 616 617 def activereq(): 618 return _pbs.activereq() 448 619 activereq = _pbs.activereq 620 621 def fullresp(*args): 622 return _pbs.fullresp(*args) 449 623 fullresp = _pbs.fullresp 450 624 LOG_BUF_SIZE = _pbs.LOG_BUF_SIZE … … 457 631 LOG_INFO = _pbs.LOG_INFO 458 632 LOG_DEBUG = _pbs.LOG_DEBUG 633 634 def log_close(*args): 635 return _pbs.log_close(*args) 459 636 log_close = _pbs.log_close 637 638 def log_err(*args): 639 return _pbs.log_err(*args) 460 640 log_err = _pbs.log_err 641 642 def log_event(*args): 643 return _pbs.log_event(*args) 461 644 log_event = _pbs.log_event 645 646 def log_open(*args): 647 return _pbs.log_open(*args) 462 648 log_open = _pbs.log_open 649 650 def log_record(*args): 651 return _pbs.log_record(*args) 463 652 log_record = _pbs.log_record 653 654 def log_roll(*args): 655 return _pbs.log_roll(*args) 464 656 log_roll = _pbs.log_roll 657 658 def log_size(): 659 return _pbs.log_size() 465 660 log_size = _pbs.log_size 661 662 def chk_file_sec(*args): 663 return _pbs.chk_file_sec(*args) 466 664 chk_file_sec = _pbs.chk_file_sec 665 666 def setup_env(*args): 667 return _pbs.setup_env(*args) 467 668 setup_env = _pbs.setup_env 669 670 def log_ext(*args): 671 return _pbs.log_ext(*args) 468 672 log_ext = _pbs.log_ext 673 674 def log_init(*args): 675 return _pbs.log_init(*args) 469 676 log_init = _pbs.log_init 677 678 def log_remove_old(*args): 679 return _pbs.log_remove_old(*args) 470 680 log_remove_old = _pbs.log_remove_old 471 681 PBSEVENT_ERROR = _pbs.PBSEVENT_ERROR … … 626 836 627 837 version_info = ( 4, 2, 0 ) 628 version = 'SARA pbs_python version 4. 2.0'838 version = 'SARA pbs_python version 4.1.0' 629 839 630 840 # A useful dict with error codes to text -
trunk/src/pbs_wrap_2.1.c
r215 r268 1 1 /* ---------------------------------------------------------------------------- 2 2 * This file was automatically generated by SWIG (http://www.swig.org). 3 * Version 1.3. 363 * Version 1.3.40 4 4 * 5 5 * This file is not intended to be easily readable and contains a number of … … 11 11 #define SWIGPYTHON 12 12 #define SWIG_PYTHON_DIRECTOR_NO_VTABLE 13 13 14 /* ----------------------------------------------------------------------------- 14 15 * This section contains generic SWIG labels for method/variable … … 127 128 * swigrun.swg 128 129 * 129 * This file contains generic C API SWIG runtime support for pointer130 * This file contains generic C API SWIG runtime support for pointer 130 131 * type checking. 131 132 * ----------------------------------------------------------------------------- */ … … 146 147 /* 147 148 You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for 148 creating a static or dynamic library from the swigruntime code.149 In 99.9% of the cases, swigjust needs to declare them as 'static'.150 151 But only do this if isstrictly necessary, ie, if you have problems152 with your compiler or s o.149 creating a static or dynamic library from the SWIG runtime code. 150 In 99.9% of the cases, SWIG just needs to declare them as 'static'. 151 152 But only do this if strictly necessary, ie, if you have problems 153 with your compiler or suchlike. 153 154 */ 154 155 … … 177 178 Flags/methods for returning states. 178 179 179 The swigconversion methods, as ConvertPtr, return and integer180 The SWIG conversion methods, as ConvertPtr, return and integer 180 181 that tells if the conversion was successful or not. And if not, 181 182 an error code can be returned (see swigerrors.swg for the codes). … … 184 185 states. 185 186 186 In old swig versions, you usually write code as:187 In old versions of SWIG, code such as the following was usually written: 187 188 188 189 if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) { … … 192 193 } 193 194 194 Now you can be more explicit as:195 Now you can be more explicit: 195 196 196 197 int res = SWIG_ConvertPtr(obj,vptr,ty.flags); … … 201 202 } 202 203 203 that seems to be the same, but now you can also do204 which is the same really, but now you can also do 204 205 205 206 Type *ptr; … … 219 220 I.e., now SWIG_ConvertPtr can return new objects and you can 220 221 identify the case and take care of the deallocation. Of course that 221 requires also to SWIG_ConvertPtr to return new result values,as222 also requires SWIG_ConvertPtr to return new result values, such as 222 223 223 224 int SWIG_ConvertPtr(obj, ptr,...) { … … 237 238 Of course, returning the plain '0(success)/-1(fail)' still works, but you can be 238 239 more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the 239 swigerrors code.240 SWIG errors code. 240 241 241 242 Finally, if the SWIG_CASTRANK_MODE is enabled, the result code … … 251 252 252 253 just use the SWIG_AddCast()/SWIG_CheckState() 253 254 255 */ 254 */ 255 256 256 #define SWIG_OK (0) 257 257 #define SWIG_ERROR (-1) … … 278 278 #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK)) 279 279 280 281 280 /* Cast-Rank Mode */ 282 281 #if defined(SWIG_CASTRANK_MODE) … … 301 300 302 301 303 304 305 302 #include <string.h> 306 303 … … 399 396 400 397 401 /* think of this as a c++ template<> or a scheme macro */402 #define SWIG_TypeCheck_Template(comparison, ty) \403 if (ty) { \404 swig_cast_info *iter = ty->cast; \405 while (iter) { \406 if (comparison) { \407 if (iter == ty->cast) return iter; \408 /* Move iter to the top of the linked list */ \409 iter->prev->next = iter->next; \410 if (iter->next) \411 iter->next->prev = iter->prev; \412 iter->next = ty->cast; \413 iter->prev = 0; \414 if (ty->cast) ty->cast->prev = iter; \415 ty->cast = iter; \416 return iter; \417 } \418 iter = iter->next; \419 } \420 } \421 return 0422 423 398 /* 424 399 Check the typename … … 426 401 SWIGRUNTIME swig_cast_info * 427 402 SWIG_TypeCheck(const char *c, swig_type_info *ty) { 428 SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty); 429 } 430 431 /* Same as previous function, except strcmp is replaced with a pointer comparison */ 403 if (ty) { 404 swig_cast_info *iter = ty->cast; 405 while (iter) { 406 if (strcmp(iter->type->name, c) == 0) { 407 if (iter == ty->cast) 408 return iter; 409 /* Move iter to the top of the linked list */ 410 iter->prev->next = iter->next; 411 if (iter->next) 412 iter->next->prev = iter->prev; 413 iter->next = ty->cast; 414 iter->prev = 0; 415 if (ty->cast) ty->cast->prev = iter; 416 ty->cast = iter; 417 return iter; 418 } 419 iter = iter->next; 420 } 421 } 422 return 0; 423 } 424 425 /* 426 Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison 427 */ 432 428 SWIGRUNTIME swig_cast_info * 433 SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) { 434 SWIG_TypeCheck_Template(iter->type == from, into); 429 SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) { 430 if (ty) { 431 swig_cast_info *iter = ty->cast; 432 while (iter) { 433 if (iter->type == from) { 434 if (iter == ty->cast) 435 return iter; 436 /* Move iter to the top of the linked list */ 437 iter->prev->next = iter->next; 438 if (iter->next) 439 iter->next->prev = iter->prev; 440 iter->next = ty->cast; 441 iter->prev = 0; 442 if (ty->cast) ty->cast->prev = iter; 443 ty->cast = iter; 444 return iter; 445 } 446 iter = iter->next; 447 } 448 } 449 return 0; 435 450 } 436 451 … … 711 726 712 727 728 /* Compatibility macros for Python 3 */ 729 #if PY_VERSION_HEX >= 0x03000000 730 731 #define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type) 732 #define PyInt_Check(x) PyLong_Check(x) 733 #define PyInt_AsLong(x) PyLong_AsLong(x) 734 #define PyInt_FromLong(x) PyLong_FromLong(x) 735 #define PyString_Format(fmt, args) PyUnicode_Format(fmt, args) 736 737 #endif 738 739 #ifndef Py_TYPE 740 # define Py_TYPE(op) ((op)->ob_type) 741 #endif 742 743 /* SWIG APIs for compatibility of both Python 2 & 3 */ 744 745 #if PY_VERSION_HEX >= 0x03000000 746 # define SWIG_Python_str_FromFormat PyUnicode_FromFormat 747 #else 748 # define SWIG_Python_str_FromFormat PyString_FromFormat 749 #endif 750 751 752 /* Warning: This function will allocate a new string in Python 3, 753 * so please call SWIG_Python_str_DelForPy3(x) to free the space. 754 */ 755 SWIGINTERN char* 756 SWIG_Python_str_AsChar(PyObject *str) 757 { 758 #if PY_VERSION_HEX >= 0x03000000 759 char *cstr; 760 char *newstr; 761 Py_ssize_t len; 762 str = PyUnicode_AsUTF8String(str); 763 PyBytes_AsStringAndSize(str, &cstr, &len); 764 newstr = (char *) malloc(len+1); 765 memcpy(newstr, cstr, len+1); 766 Py_XDECREF(str); 767 return newstr; 768 #else 769 return PyString_AsString(str); 770 #endif 771 } 772 773 #if PY_VERSION_HEX >= 0x03000000 774 # define SWIG_Python_str_DelForPy3(x) free( (void*) (x) ) 775 #else 776 # define SWIG_Python_str_DelForPy3(x) 777 #endif 778 779 780 SWIGINTERN PyObject* 781 SWIG_Python_str_FromChar(const char *c) 782 { 783 #if PY_VERSION_HEX >= 0x03000000 784 return PyUnicode_FromString(c); 785 #else 786 return PyString_FromString(c); 787 #endif 788 } 713 789 714 790 /* Add PyOS_snprintf for old Pythons */ … … 757 833 # endif 758 834 #endif 835 759 836 /* Py_NotImplemented is defined in 2.1 and up. */ 760 837 #if PY_VERSION_HEX < 0x02010000 … … 764 841 #endif 765 842 766 767 843 /* A crude PyString_AsStringAndSize implementation for old Pythons */ 768 844 #if PY_VERSION_HEX < 0x02010000 … … 778 854 # endif 779 855 #endif 780 781 856 782 857 /* PyBool_FromLong for old Pythons */ … … 857 932 if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback); 858 933 if (value) { 934 char *tmp; 859 935 PyObject *old_str = PyObject_Str(value); 860 936 PyErr_Clear(); 861 937 Py_XINCREF(type); 862 PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg); 938 939 PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); 940 SWIG_Python_str_DelForPy3(tmp); 863 941 Py_DECREF(old_str); 864 942 Py_DECREF(value); … … 867 945 } 868 946 } 869 870 871 947 872 948 #if defined(SWIG_PYTHON_NO_THREADS) … … 966 1042 } swig_const_info; 967 1043 1044 1045 /* ----------------------------------------------------------------------------- 1046 * Wrapper of PyInstanceMethod_New() used in Python 3 1047 * It is exported to the generated module, used for -fastproxy 1048 * ----------------------------------------------------------------------------- */ 1049 SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *self, PyObject *func) 1050 { 1051 #if PY_VERSION_HEX >= 0x03000000 1052 return PyInstanceMethod_New(func); 1053 #else 1054 return NULL; 1055 #endif 1056 } 1057 968 1058 #ifdef __cplusplus 969 1059 #if 0 … … 1018 1108 #define SWIG_GetModule(clientdata) SWIG_Python_GetModule() 1019 1109 #define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer) 1020 #define SWIG_NewClientData(obj) PySwigClientData_New(obj)1110 #define SWIG_NewClientData(obj) SwigPyClientData_New(obj) 1021 1111 1022 1112 #define SWIG_SetErrorObj SWIG_Python_SetErrorObj … … 1214 1304 } 1215 1305 1216 /* PySwigClientData */1306 /* SwigPyClientData */ 1217 1307 1218 1308 typedef struct { … … 1223 1313 int delargs; 1224 1314 int implicitconv; 1225 } PySwigClientData;1315 } SwigPyClientData; 1226 1316 1227 1317 SWIGRUNTIMEINLINE int 1228 1318 SWIG_Python_CheckImplicit(swig_type_info *ty) 1229 1319 { 1230 PySwigClientData *data = (PySwigClientData *)ty->clientdata;1320 SwigPyClientData *data = (SwigPyClientData *)ty->clientdata; 1231 1321 return data ? data->implicitconv : 0; 1232 1322 } … … 1234 1324 SWIGRUNTIMEINLINE PyObject * 1235 1325 SWIG_Python_ExceptionType(swig_type_info *desc) { 1236 PySwigClientData *data = desc ? (PySwigClientData *) desc->clientdata : 0;1326 SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0; 1237 1327 PyObject *klass = data ? data->klass : 0; 1238 1328 return (klass ? klass : PyExc_RuntimeError); … … 1240 1330 1241 1331 1242 SWIGRUNTIME PySwigClientData *1243 PySwigClientData_New(PyObject* obj)1332 SWIGRUNTIME SwigPyClientData * 1333 SwigPyClientData_New(PyObject* obj) 1244 1334 { 1245 1335 if (!obj) { 1246 1336 return 0; 1247 1337 } else { 1248 PySwigClientData *data = (PySwigClientData *)malloc(sizeof(PySwigClientData));1338 SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData)); 1249 1339 /* the klass element */ 1250 1340 data->klass = obj; … … 1294 1384 1295 1385 SWIGRUNTIME void 1296 PySwigClientData_Del(PySwigClientData* data)1386 SwigPyClientData_Del(SwigPyClientData* data) 1297 1387 { 1298 1388 Py_XDECREF(data->newraw); … … 1301 1391 } 1302 1392 1303 /* =============== PySwigObject =====================*/1393 /* =============== SwigPyObject =====================*/ 1304 1394 1305 1395 typedef struct { … … 1309 1399 int own; 1310 1400 PyObject *next; 1311 } PySwigObject;1401 } SwigPyObject; 1312 1402 1313 1403 SWIGRUNTIME PyObject * 1314 PySwigObject_long(PySwigObject *v)1404 SwigPyObject_long(SwigPyObject *v) 1315 1405 { 1316 1406 return PyLong_FromVoidPtr(v->ptr); … … 1318 1408 1319 1409 SWIGRUNTIME PyObject * 1320 PySwigObject_format(const char* fmt, PySwigObject *v)1410 SwigPyObject_format(const char* fmt, SwigPyObject *v) 1321 1411 { 1322 1412 PyObject *res = NULL; 1323 1413 PyObject *args = PyTuple_New(1); 1324 1414 if (args) { 1325 if (PyTuple_SetItem(args, 0, PySwigObject_long(v)) == 0) {1326 PyObject *ofmt = PyString_FromString(fmt);1415 if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) { 1416 PyObject *ofmt = SWIG_Python_str_FromChar(fmt); 1327 1417 if (ofmt) { 1418 #if PY_VERSION_HEX >= 0x03000000 1419 res = PyUnicode_Format(ofmt,args); 1420 #else 1328 1421 res = PyString_Format(ofmt,args); 1422 #endif 1329 1423 Py_DECREF(ofmt); 1330 1424 } … … 1336 1430 1337 1431 SWIGRUNTIME PyObject * 1338 PySwigObject_oct(PySwigObject *v)1432 SwigPyObject_oct(SwigPyObject *v) 1339 1433 { 1340 return PySwigObject_format("%o",v);1434 return SwigPyObject_format("%o",v); 1341 1435 } 1342 1436 1343 1437 SWIGRUNTIME PyObject * 1344 PySwigObject_hex(PySwigObject *v)1438 SwigPyObject_hex(SwigPyObject *v) 1345 1439 { 1346 return PySwigObject_format("%x",v);1440 return SwigPyObject_format("%x",v); 1347 1441 } 1348 1442 1349 1443 SWIGRUNTIME PyObject * 1350 1444 #ifdef METH_NOARGS 1351 PySwigObject_repr(PySwigObject *v)1445 SwigPyObject_repr(SwigPyObject *v) 1352 1446 #else 1353 PySwigObject_repr(PySwigObject *v, PyObject *args)1447 SwigPyObject_repr(SwigPyObject *v, PyObject *args) 1354 1448 #endif 1355 1449 { 1356 1450 const char *name = SWIG_TypePrettyName(v->ty); 1357 PyObject *hex = PySwigObject_hex(v); 1358 PyObject *repr = PyString_FromFormat("<Swig Object of type '%s' at 0x%s>", name, PyString_AsString(hex)); 1359 Py_DECREF(hex); 1451 PyObject *repr = SWIG_Python_str_FromFormat("<Swig Object of type '%s' at %p>", name, v); 1360 1452 if (v->next) { 1361 1453 #ifdef METH_NOARGS 1362 PyObject *nrep = PySwigObject_repr((PySwigObject *)v->next);1454 PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next); 1363 1455 #else 1364 PyObject *nrep = PySwigObject_repr((PySwigObject *)v->next, args); 1365 #endif 1456 PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next, args); 1457 #endif 1458 #if PY_VERSION_HEX >= 0x03000000 1459 PyObject *joined = PyUnicode_Concat(repr, nrep); 1460 Py_DecRef(repr); 1461 Py_DecRef(nrep); 1462 repr = joined; 1463 #else 1366 1464 PyString_ConcatAndDel(&repr,nrep); 1465 #endif 1367 1466 } 1368 1467 return repr; … … 1370 1469 1371 1470 SWIGRUNTIME int 1372 PySwigObject_print(PySwigObject *v, FILE *fp, int SWIGUNUSEDPARM(flags))1471 SwigPyObject_print(SwigPyObject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) 1373 1472 { 1473 char *str; 1374 1474 #ifdef METH_NOARGS 1375 PyObject *repr = PySwigObject_repr(v);1475 PyObject *repr = SwigPyObject_repr(v); 1376 1476 #else 1377 PyObject *repr = PySwigObject_repr(v, NULL);1477 PyObject *repr = SwigPyObject_repr(v, NULL); 1378 1478 #endif 1379 1479 if (repr) { 1380 fputs(PyString_AsString(repr), fp); 1480 str = SWIG_Python_str_AsChar(repr); 1481 fputs(str, fp); 1482 SWIG_Python_str_DelForPy3(str); 1381 1483 Py_DECREF(repr); 1382 1484 return 0; … … 1387 1489 1388 1490 SWIGRUNTIME PyObject * 1389 PySwigObject_str(PySwigObject *v)1491 SwigPyObject_str(SwigPyObject *v) 1390 1492 { 1391 1493 char result[SWIG_BUFFER_SIZE]; 1392 1494 return SWIG_PackVoidPtr(result, v->ptr, v->ty->name, sizeof(result)) ? 1393 PyString_FromString(result) : 0;1495 SWIG_Python_str_FromChar(result) : 0; 1394 1496 } 1395 1497 1396 1498 SWIGRUNTIME int 1397 PySwigObject_compare(PySwigObject *v, PySwigObject *w)1499 SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w) 1398 1500 { 1399 1501 void *i = v->ptr; … … 1402 1504 } 1403 1505 1506 /* Added for Python 3.x, would it also be useful for Python 2.x? */ 1507 SWIGRUNTIME PyObject* 1508 SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op) 1509 { 1510 PyObject* res; 1511 if( op != Py_EQ && op != Py_NE ) { 1512 Py_INCREF(Py_NotImplemented); 1513 return Py_NotImplemented; 1514 } 1515 if( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ) 1516 res = Py_True; 1517 else 1518 res = Py_False; 1519 Py_INCREF(res); 1520 return res; 1521 } 1522 1523 1404 1524 SWIGRUNTIME PyTypeObject* _PySwigObject_type(void); 1405 1525 1406 1526 SWIGRUNTIME PyTypeObject* 1407 PySwigObject_type(void) {1527 SwigPyObject_type(void) { 1408 1528 static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigObject_type(); 1409 1529 return type; … … 1411 1531 1412 1532 SWIGRUNTIMEINLINE int 1413 PySwigObject_Check(PyObject *op) {1414 return ( (op)->ob_type == PySwigObject_type())1415 || (strcmp( (op)->ob_type->tp_name,"PySwigObject") == 0);1533 SwigPyObject_Check(PyObject *op) { 1534 return (Py_TYPE(op) == SwigPyObject_type()) 1535 || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0); 1416 1536 } 1417 1537 1418 1538 SWIGRUNTIME PyObject * 1419 PySwigObject_New(void *ptr, swig_type_info *ty, int own);1539 SwigPyObject_New(void *ptr, swig_type_info *ty, int own); 1420 1540 1421 1541 SWIGRUNTIME void 1422 PySwigObject_dealloc(PyObject *v)1542 SwigPyObject_dealloc(PyObject *v) 1423 1543 { 1424 PySwigObject *sobj = (PySwigObject *) v;1544 SwigPyObject *sobj = (SwigPyObject *) v; 1425 1545 PyObject *next = sobj->next; 1426 1546 if (sobj->own == SWIG_POINTER_OWN) { 1427 1547 swig_type_info *ty = sobj->ty; 1428 PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0;1548 SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; 1429 1549 PyObject *destroy = data ? data->destroy : 0; 1430 1550 if (destroy) { … … 1432 1552 PyObject *res; 1433 1553 if (data->delargs) { 1434 /* we need to create a tempora lobject to carry the destroy operation */1435 PyObject *tmp = PySwigObject_New(sobj->ptr, ty, 0);1554 /* we need to create a temporary object to carry the destroy operation */ 1555 PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0); 1436 1556 res = SWIG_Python_CallFunctor(destroy, tmp); 1437 1557 Py_DECREF(tmp); … … 1455 1575 1456 1576 SWIGRUNTIME PyObject* 1457 PySwigObject_append(PyObject* v, PyObject* next)1577 SwigPyObject_append(PyObject* v, PyObject* next) 1458 1578 { 1459 PySwigObject *sobj = (PySwigObject *) v;1579 SwigPyObject *sobj = (SwigPyObject *) v; 1460 1580 #ifndef METH_O 1461 1581 PyObject *tmp = 0; … … 1463 1583 next = tmp; 1464 1584 #endif 1465 if (! PySwigObject_Check(next)) {1585 if (!SwigPyObject_Check(next)) { 1466 1586 return NULL; 1467 1587 } … … 1473 1593 SWIGRUNTIME PyObject* 1474 1594 #ifdef METH_NOARGS 1475 PySwigObject_next(PyObject* v)1595 SwigPyObject_next(PyObject* v) 1476 1596 #else 1477 PySwigObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args))1597 SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) 1478 1598 #endif 1479 1599 { 1480 PySwigObject *sobj = (PySwigObject *) v;1600 SwigPyObject *sobj = (SwigPyObject *) v; 1481 1601 if (sobj->next) { 1482 1602 Py_INCREF(sobj->next); … … 1489 1609 SWIGINTERN PyObject* 1490 1610 #ifdef METH_NOARGS 1491 PySwigObject_disown(PyObject *v)1611 SwigPyObject_disown(PyObject *v) 1492 1612 #else 1493 PySwigObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args))1613 SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) 1494 1614 #endif 1495 1615 { 1496 PySwigObject *sobj = (PySwigObject *)v;1616 SwigPyObject *sobj = (SwigPyObject *)v; 1497 1617 sobj->own = 0; 1498 1618 return SWIG_Py_Void(); … … 1501 1621 SWIGINTERN PyObject* 1502 1622 #ifdef METH_NOARGS 1503 PySwigObject_acquire(PyObject *v)1623 SwigPyObject_acquire(PyObject *v) 1504 1624 #else 1505 PySwigObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args))1625 SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) 1506 1626 #endif 1507 1627 { 1508 PySwigObject *sobj = (PySwigObject *)v;1628 SwigPyObject *sobj = (SwigPyObject *)v; 1509 1629 sobj->own = SWIG_POINTER_OWN; 1510 1630 return SWIG_Py_Void(); … … 1512 1632 1513 1633 SWIGINTERN PyObject* 1514 PySwigObject_own(PyObject *v, PyObject *args)1634 SwigPyObject_own(PyObject *v, PyObject *args) 1515 1635 { 1516 1636 PyObject *val = 0; … … 1525 1645 else 1526 1646 { 1527 PySwigObject *sobj = (PySwigObject *)v;1647 SwigPyObject *sobj = (SwigPyObject *)v; 1528 1648 PyObject *obj = PyBool_FromLong(sobj->own); 1529 1649 if (val) { 1530 1650 #ifdef METH_NOARGS 1531 1651 if (PyObject_IsTrue(val)) { 1532 PySwigObject_acquire(v);1652 SwigPyObject_acquire(v); 1533 1653 } else { 1534 PySwigObject_disown(v);1654 SwigPyObject_disown(v); 1535 1655 } 1536 1656 #else 1537 1657 if (PyObject_IsTrue(val)) { 1538 PySwigObject_acquire(v,args);1658 SwigPyObject_acquire(v,args); 1539 1659 } else { 1540 PySwigObject_disown(v,args);1660 SwigPyObject_disown(v,args); 1541 1661 } 1542 1662 #endif … … 1549 1669 static PyMethodDef 1550 1670 swigobject_methods[] = { 1551 {(char *)"disown", (PyCFunction) PySwigObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"},1552 {(char *)"acquire", (PyCFunction) PySwigObject_acquire, METH_NOARGS, (char *)"aquires ownership of the pointer"},1553 {(char *)"own", (PyCFunction) PySwigObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"},1554 {(char *)"append", (PyCFunction) PySwigObject_append, METH_O, (char *)"appends another 'this' object"},1555 {(char *)"next", (PyCFunction) PySwigObject_next, METH_NOARGS, (char *)"returns the next 'this' object"},1556 {(char *)"__repr__",(PyCFunction) PySwigObject_repr, METH_NOARGS, (char *)"returns object representation"},1671 {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"}, 1672 {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS, (char *)"aquires ownership of the pointer"}, 1673 {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, 1674 {(char *)"append", (PyCFunction)SwigPyObject_append, METH_O, (char *)"appends another 'this' object"}, 1675 {(char *)"next", (PyCFunction)SwigPyObject_next, METH_NOARGS, (char *)"returns the next 'this' object"}, 1676 {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_NOARGS, (char *)"returns object representation"}, 1557 1677 {0, 0, 0, 0} 1558 1678 }; … … 1560 1680 static PyMethodDef 1561 1681 swigobject_methods[] = { 1562 {(char *)"disown", (PyCFunction) PySwigObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"},1563 {(char *)"acquire", (PyCFunction) PySwigObject_acquire, METH_VARARGS, (char *)"aquires ownership of the pointer"},1564 {(char *)"own", (PyCFunction) PySwigObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"},1565 {(char *)"append", (PyCFunction) PySwigObject_append, METH_VARARGS, (char *)"appends another 'this' object"},1566 {(char *)"next", (PyCFunction) PySwigObject_next, METH_VARARGS, (char *)"returns the next 'this' object"},1567 {(char *)"__repr__",(PyCFunction) PySwigObject_repr, METH_VARARGS, (char *)"returns object representation"},1682 {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"}, 1683 {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS, (char *)"aquires ownership of the pointer"}, 1684 {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, 1685 {(char *)"append", (PyCFunction)SwigPyObject_append, METH_VARARGS, (char *)"appends another 'this' object"}, 1686 {(char *)"next", (PyCFunction)SwigPyObject_next, METH_VARARGS, (char *)"returns the next 'this' object"}, 1687 {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_VARARGS, (char *)"returns object representation"}, 1568 1688 {0, 0, 0, 0} 1569 1689 }; … … 1572 1692 #if PY_VERSION_HEX < 0x02020000 1573 1693 SWIGINTERN PyObject * 1574 PySwigObject_getattr(PySwigObject *sobj,char *name)1694 SwigPyObject_getattr(SwigPyObject *sobj,char *name) 1575 1695 { 1576 1696 return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name); … … 1582 1702 static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer"; 1583 1703 1584 static PyNumberMethods PySwigObject_as_number = {1704 static PyNumberMethods SwigPyObject_as_number = { 1585 1705 (binaryfunc)0, /*nb_add*/ 1586 1706 (binaryfunc)0, /*nb_subtract*/ 1587 1707 (binaryfunc)0, /*nb_multiply*/ 1708 /* nb_divide removed in Python 3 */ 1709 #if PY_VERSION_HEX < 0x03000000 1588 1710 (binaryfunc)0, /*nb_divide*/ 1711 #endif 1589 1712 (binaryfunc)0, /*nb_remainder*/ 1590 1713 (binaryfunc)0, /*nb_divmod*/ … … 1600 1723 0, /*nb_xor*/ 1601 1724 0, /*nb_or*/ 1602 (coercion)0, /*nb_coerce*/ 1603 (unaryfunc)PySwigObject_long, /*nb_int*/ 1604 (unaryfunc)PySwigObject_long, /*nb_long*/ 1725 #if PY_VERSION_HEX < 0x03000000 1726 0, /*nb_coerce*/ 1727 #endif 1728 (unaryfunc)SwigPyObject_long, /*nb_int*/ 1729 #if PY_VERSION_HEX < 0x03000000 1730 (unaryfunc)SwigPyObject_long, /*nb_long*/ 1731 #else 1732 0, /*nb_reserved*/ 1733 #endif 1605 1734 (unaryfunc)0, /*nb_float*/ 1606 (unaryfunc)PySwigObject_oct, /*nb_oct*/ 1607 (unaryfunc)PySwigObject_hex, /*nb_hex*/ 1608 #if PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */ 1735 #if PY_VERSION_HEX < 0x03000000 1736 (unaryfunc)SwigPyObject_oct, /*nb_oct*/ 1737 (unaryfunc)SwigPyObject_hex, /*nb_hex*/ 1738 #endif 1739 #if PY_VERSION_HEX >= 0x03000000 /* 3.0 */ 1740 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */ 1741 #elif PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */ 1609 1742 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */ 1610 1743 #elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */ … … 1615 1748 }; 1616 1749 1617 static PyTypeObject pyswigobject_type;1750 static PyTypeObject swigpyobject_type; 1618 1751 static int type_init = 0; 1619 1752 if (!type_init) { 1620 1753 const PyTypeObject tmp 1621 1754 = { 1755 /* PyObject header changed in Python 3 */ 1756 #if PY_VERSION_HEX >= 0x03000000 1757 PyVarObject_HEAD_INIT(&PyType_Type, 0) 1758 #else 1622 1759 PyObject_HEAD_INIT(NULL) 1623 1760 0, /* ob_size */ 1624 (char *)"PySwigObject", /* tp_name */ 1625 sizeof(PySwigObject), /* tp_basicsize */ 1761 #endif 1762 (char *)"SwigPyObject", /* tp_name */ 1763 sizeof(SwigPyObject), /* tp_basicsize */ 1626 1764 0, /* tp_itemsize */ 1627 (destructor) PySwigObject_dealloc, /* tp_dealloc */1628 (printfunc) PySwigObject_print, /* tp_print */1765 (destructor)SwigPyObject_dealloc, /* tp_dealloc */ 1766 (printfunc)SwigPyObject_print, /* tp_print */ 1629 1767 #if PY_VERSION_HEX < 0x02020000 1630 (getattrfunc) PySwigObject_getattr, /* tp_getattr */1768 (getattrfunc)SwigPyObject_getattr, /* tp_getattr */ 1631 1769 #else 1632 1770 (getattrfunc)0, /* tp_getattr */ 1633 1771 #endif 1634 1772 (setattrfunc)0, /* tp_setattr */ 1635 (cmpfunc)PySwigObject_compare, /* tp_compare */ 1636 (reprfunc)PySwigObject_repr, /* tp_repr */ 1637 &PySwigObject_as_number, /* tp_as_number */ 1773 #if PY_VERSION_HEX >= 0x03000000 1774 0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */ 1775 #else 1776 (cmpfunc)SwigPyObject_compare, /* tp_compare */ 1777 #endif 1778 (reprfunc)SwigPyObject_repr, /* tp_repr */ 1779 &SwigPyObject_as_number, /* tp_as_number */ 1638 1780 0, /* tp_as_sequence */ 1639 1781 0, /* tp_as_mapping */ 1640 1782 (hashfunc)0, /* tp_hash */ 1641 1783 (ternaryfunc)0, /* tp_call */ 1642 (reprfunc) PySwigObject_str, /* tp_str */1784 (reprfunc)SwigPyObject_str, /* tp_str */ 1643 1785 PyObject_GenericGetAttr, /* tp_getattro */ 1644 1786 0, /* tp_setattro */ … … 1648 1790 0, /* tp_traverse */ 1649 1791 0, /* tp_clear */ 1650 0,/* tp_richcompare */1792 (richcmpfunc)SwigPyObject_richcompare, /* tp_richcompare */ 1651 1793 0, /* tp_weaklistoffset */ 1652 1794 #if PY_VERSION_HEX >= 0x02020000 … … 1665 1807 0, /* tp_new */ 1666 1808 0, /* tp_free */ 1667 1809 0, /* tp_is_gc */ 1668 1810 0, /* tp_bases */ 1669 1811 0, /* tp_mro */ 1670 1812 0, /* tp_cache */ 1671 1813 0, /* tp_subclasses */ 1672 1814 0, /* tp_weaklist */ 1673 1815 #endif … … 1679 1821 #endif 1680 1822 }; 1681 pyswigobject_type = tmp; 1682 pyswigobject_type.ob_type = &PyType_Type; 1823 swigpyobject_type = tmp; 1824 /* for Python 3 we already assigned ob_type in PyVarObject_HEAD_INIT() */ 1825 #if PY_VERSION_HEX < 0x03000000 1826 swigpyobject_type.ob_type = &PyType_Type; 1827 #endif 1683 1828 type_init = 1; 1684 1829 } 1685 return & pyswigobject_type;1830 return &swigpyobject_type; 1686 1831 } 1687 1832 1688 1833 SWIGRUNTIME PyObject * 1689 PySwigObject_New(void *ptr, swig_type_info *ty, int own)1834 SwigPyObject_New(void *ptr, swig_type_info *ty, int own) 1690 1835 { 1691 PySwigObject *sobj = PyObject_NEW(PySwigObject, PySwigObject_type());1836 SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type()); 1692 1837 if (sobj) { 1693 1838 sobj->ptr = ptr; … … 1708 1853 swig_type_info *ty; 1709 1854 size_t size; 1710 } PySwigPacked;1855 } SwigPyPacked; 1711 1856 1712 1857 SWIGRUNTIME int 1713 PySwigPacked_print(PySwigPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags))1858 SwigPyPacked_print(SwigPyPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags)) 1714 1859 { 1715 1860 char result[SWIG_BUFFER_SIZE]; … … 1725 1870 1726 1871 SWIGRUNTIME PyObject * 1727 PySwigPacked_repr(PySwigPacked *v)1872 SwigPyPacked_repr(SwigPyPacked *v) 1728 1873 { 1729 1874 char result[SWIG_BUFFER_SIZE]; 1730 1875 if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) { 1731 return PyString_FromFormat("<Swig Packed at %s%s>", result, v->ty->name);1876 return SWIG_Python_str_FromFormat("<Swig Packed at %s%s>", result, v->ty->name); 1732 1877 } else { 1733 return PyString_FromFormat("<Swig Packed %s>", v->ty->name);1878 return SWIG_Python_str_FromFormat("<Swig Packed %s>", v->ty->name); 1734 1879 } 1735 1880 } 1736 1881 1737 1882 SWIGRUNTIME PyObject * 1738 PySwigPacked_str(PySwigPacked *v)1883 SwigPyPacked_str(SwigPyPacked *v) 1739 1884 { 1740 1885 char result[SWIG_BUFFER_SIZE]; 1741 1886 if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){ 1742 return PyString_FromFormat("%s%s", result, v->ty->name);1887 return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name); 1743 1888 } else { 1744 return PyString_FromString(v->ty->name);1889 return SWIG_Python_str_FromChar(v->ty->name); 1745 1890 } 1746 1891 } 1747 1892 1748 1893 SWIGRUNTIME int 1749 PySwigPacked_compare(PySwigPacked *v, PySwigPacked *w)1894 SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w) 1750 1895 { 1751 1896 size_t i = v->size; … … 1758 1903 1759 1904 SWIGRUNTIME PyTypeObject* 1760 PySwigPacked_type(void) {1905 SwigPyPacked_type(void) { 1761 1906 static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigPacked_type(); 1762 1907 return type; … … 1764 1909 1765 1910 SWIGRUNTIMEINLINE int 1766 PySwigPacked_Check(PyObject *op) {1911 SwigPyPacked_Check(PyObject *op) { 1767 1912 return ((op)->ob_type == _PySwigPacked_type()) 1768 || (strcmp((op)->ob_type->tp_name," PySwigPacked") == 0);1913 || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0); 1769 1914 } 1770 1915 1771 1916 SWIGRUNTIME void 1772 PySwigPacked_dealloc(PyObject *v)1917 SwigPyPacked_dealloc(PyObject *v) 1773 1918 { 1774 if ( PySwigPacked_Check(v)) {1775 PySwigPacked *sobj = (PySwigPacked *) v;1919 if (SwigPyPacked_Check(v)) { 1920 SwigPyPacked *sobj = (SwigPyPacked *) v; 1776 1921 free(sobj->pack); 1777 1922 } … … 1782 1927 _PySwigPacked_type(void) { 1783 1928 static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer"; 1784 static PyTypeObject pyswigpacked_type;1929 static PyTypeObject swigpypacked_type; 1785 1930 static int type_init = 0; 1786 1931 if (!type_init) { 1787 1932 const PyTypeObject tmp 1788 1933 = { 1934 /* PyObject header changed in Python 3 */ 1935 #if PY_VERSION_HEX>=0x03000000 1936 PyVarObject_HEAD_INIT(&PyType_Type, 0) 1937 #else 1789 1938 PyObject_HEAD_INIT(NULL) 1790 0, /* ob_size */ 1791 (char *)"PySwigPacked", /* tp_name */ 1792 sizeof(PySwigPacked), /* tp_basicsize */ 1939 0, /* ob_size */ 1940 #endif 1941 (char *)"SwigPyPacked", /* tp_name */ 1942 sizeof(SwigPyPacked), /* tp_basicsize */ 1793 1943 0, /* tp_itemsize */ 1794 (destructor) PySwigPacked_dealloc, /* tp_dealloc */1795 (printfunc) PySwigPacked_print, /* tp_print */1944 (destructor)SwigPyPacked_dealloc, /* tp_dealloc */ 1945 (printfunc)SwigPyPacked_print, /* tp_print */ 1796 1946 (getattrfunc)0, /* tp_getattr */ 1797 1947 (setattrfunc)0, /* tp_setattr */ 1798 (cmpfunc)PySwigPacked_compare, /* tp_compare */ 1799 (reprfunc)PySwigPacked_repr, /* tp_repr */ 1800 0, /* tp_as_number */ 1948 #if PY_VERSION_HEX>=0x03000000 1949 0, /* tp_reserved in 3.0.1 */ 1950 #else 1951 (cmpfunc)SwigPyPacked_compare, /* tp_compare */ 1952 #endif 1953 (reprfunc)SwigPyPacked_repr, /* tp_repr */ 1954 0, /* tp_as_number */ 1801 1955 0, /* tp_as_sequence */ 1802 0, /* tp_as_mapping */ 1803 (hashfunc)0, /* tp_hash */ 1804 (ternaryfunc)0, /* tp_call */ 1805 (reprfunc) PySwigPacked_str, /* tp_str */1956 0, /* tp_as_mapping */ 1957 (hashfunc)0, /* tp_hash */ 1958 (ternaryfunc)0, /* tp_call */ 1959 (reprfunc)SwigPyPacked_str, /* tp_str */ 1806 1960 PyObject_GenericGetAttr, /* tp_getattro */ 1807 1961 0, /* tp_setattro */ … … 1842 1996 #endif 1843 1997 }; 1844 pyswigpacked_type = tmp; 1845 pyswigpacked_type.ob_type = &PyType_Type; 1998 swigpypacked_type = tmp; 1999 /* for Python 3 the ob_type already assigned in PyVarObject_HEAD_INIT() */ 2000 #if PY_VERSION_HEX < 0x03000000 2001 swigpypacked_type.ob_type = &PyType_Type; 2002 #endif 1846 2003 type_init = 1; 1847 2004 } 1848 return & pyswigpacked_type;2005 return &swigpypacked_type; 1849 2006 } 1850 2007 1851 2008 SWIGRUNTIME PyObject * 1852 PySwigPacked_New(void *ptr, size_t size, swig_type_info *ty)2009 SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty) 1853 2010 { 1854 PySwigPacked *sobj = PyObject_NEW(PySwigPacked, PySwigPacked_type());2011 SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type()); 1855 2012 if (sobj) { 1856 2013 void *pack = malloc(size); … … 1869 2026 1870 2027 SWIGRUNTIME swig_type_info * 1871 PySwigPacked_UnpackData(PyObject *obj, void *ptr, size_t size)2028 SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size) 1872 2029 { 1873 if ( PySwigPacked_Check(obj)) {1874 PySwigPacked *sobj = (PySwigPacked *)obj;2030 if (SwigPyPacked_Check(obj)) { 2031 SwigPyPacked *sobj = (SwigPyPacked *)obj; 1875 2032 if (sobj->size != size) return 0; 1876 2033 memcpy(ptr, sobj->pack, size); … … 1888 2045 _SWIG_This(void) 1889 2046 { 1890 return PyString_FromString("this");2047 return SWIG_Python_str_FromChar("this"); 1891 2048 } 1892 2049 … … 1900 2057 /* #define SWIG_PYTHON_SLOW_GETSET_THIS */ 1901 2058 1902 SWIGRUNTIME PySwigObject * 2059 /* TODO: I don't know how to implement the fast getset in Python 3 right now */ 2060 #if PY_VERSION_HEX>=0x03000000 2061 #define SWIG_PYTHON_SLOW_GETSET_THIS 2062 #endif 2063 2064 SWIGRUNTIME SwigPyObject * 1903 2065 SWIG_Python_GetSwigThis(PyObject *pyobj) 1904 2066 { 1905 if ( PySwigObject_Check(pyobj)) {1906 return ( PySwigObject *) pyobj;2067 if (SwigPyObject_Check(pyobj)) { 2068 return (SwigPyObject *) pyobj; 1907 2069 } else { 1908 2070 PyObject *obj = 0; … … 1940 2102 } 1941 2103 #endif 1942 if (obj && ! PySwigObject_Check(obj)) {2104 if (obj && !SwigPyObject_Check(obj)) { 1943 2105 /* a PyObject is called 'this', try to get the 'real this' 1944 PySwigObject from it */2106 SwigPyObject from it */ 1945 2107 return SWIG_Python_GetSwigThis(obj); 1946 2108 } 1947 return ( PySwigObject *)obj;2109 return (SwigPyObject *)obj; 1948 2110 } 1949 2111 } … … 1954 2116 SWIG_Python_AcquirePtr(PyObject *obj, int own) { 1955 2117 if (own == SWIG_POINTER_OWN) { 1956 PySwigObject *sobj = SWIG_Python_GetSwigThis(obj);2118 SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj); 1957 2119 if (sobj) { 1958 2120 int oldown = sobj->own; … … 1973 2135 return SWIG_OK; 1974 2136 } else { 1975 PySwigObject *sobj = SWIG_Python_GetSwigThis(obj);2137 SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj); 1976 2138 if (own) 1977 2139 *own = 0; … … 1987 2149 swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); 1988 2150 if (!tc) { 1989 sobj = ( PySwigObject *)sobj->next;2151 sobj = (SwigPyObject *)sobj->next; 1990 2152 } else { 1991 2153 if (ptr) { … … 2016 2178 int res = SWIG_ERROR; 2017 2179 if (flags & SWIG_POINTER_IMPLICIT_CONV) { 2018 PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0;2180 SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; 2019 2181 if (data && !data->implicitconv) { 2020 2182 PyObject *klass = data->klass; … … 2029 2191 } 2030 2192 if (impconv) { 2031 PySwigObject *iobj = SWIG_Python_GetSwigThis(impconv);2193 SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv); 2032 2194 if (iobj) { 2033 2195 void *vptr; … … 2067 2229 const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); 2068 2230 const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0; 2069 if (desc) {2231 if (desc) 2070 2232 desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0; 2071 if (!desc) return SWIG_ERROR;2072 }2233 if (!desc) 2234 return SWIG_ERROR; 2073 2235 if (ty) { 2074 2236 swig_cast_info *tc = SWIG_TypeCheck(desc,ty); … … 2091 2253 SWIGRUNTIME int 2092 2254 SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) { 2093 swig_type_info *to = PySwigPacked_UnpackData(obj, ptr, sz);2255 swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz); 2094 2256 if (!to) return SWIG_ERROR; 2095 2257 if (ty) { … … 2108 2270 2109 2271 /* 2110 Create a new instance object, w hitout calling __init__, and set the2272 Create a new instance object, without calling __init__, and set the 2111 2273 'this' attribute. 2112 2274 */ 2113 2275 2114 2276 SWIGRUNTIME PyObject* 2115 SWIG_Python_NewShadowInstance( PySwigClientData *data, PyObject *swig_this)2277 SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) 2116 2278 { 2117 2279 #if (PY_VERSION_HEX >= 0x02020000) … … 2137 2299 } 2138 2300 } else { 2301 #if PY_VERSION_HEX >= 0x03000000 2302 inst = PyBaseObject_Type.tp_new((PyTypeObject*) data->newargs, Py_None, Py_None); 2303 PyObject_SetAttr(inst, SWIG_This(), swig_this); 2304 Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG; 2305 #else 2139 2306 PyObject *dict = PyDict_New(); 2140 2307 PyDict_SetItem(dict, SWIG_This(), swig_this); 2141 2308 inst = PyInstance_NewRaw(data->newargs, dict); 2142 2309 Py_DECREF(dict); 2310 #endif 2143 2311 } 2144 2312 return inst; … … 2203 2371 return NULL; 2204 2372 } else { 2205 PySwigObject *sthis = SWIG_Python_GetSwigThis(obj[0]);2373 SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]); 2206 2374 if (sthis) { 2207 PySwigObject_append((PyObject*) sthis, obj[1]);2375 SwigPyObject_append((PyObject*) sthis, obj[1]); 2208 2376 } else { 2209 2377 SWIG_Python_SetSwigThis(obj[0], obj[1]); … … 2221 2389 } else { 2222 2390 int own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0; 2223 PyObject *robj = PySwigObject_New(ptr, type, own);2224 PySwigClientData *clientdata = type ? (PySwigClientData *)(type->clientdata) : 0;2391 PyObject *robj = SwigPyObject_New(ptr, type, own); 2392 SwigPyClientData *clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0; 2225 2393 if (clientdata && !(flags & SWIG_POINTER_NOSHADOW)) { 2226 2394 PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj); … … 2238 2406 SWIGRUNTIMEINLINE PyObject * 2239 2407 SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) { 2240 return ptr ? PySwigPacked_New((void *) ptr, sz, type) : SWIG_Py_Void();2408 return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void(); 2241 2409 } 2242 2410 … … 2309 2477 swig_type_info *ty = types[i]; 2310 2478 if (ty->owndata) { 2311 PySwigClientData *data = (PySwigClientData *) ty->clientdata;2312 if (data) PySwigClientData_Del(data);2479 SwigPyClientData *data = (SwigPyClientData *) ty->clientdata; 2480 if (data) SwigPyClientData_Del(data); 2313 2481 } 2314 2482 } … … 2320 2488 static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} };/* Sentinel */ 2321 2489 2490 #if PY_VERSION_HEX >= 0x03000000 2491 /* Add a dummy module object into sys.modules */ 2492 PyObject *module = PyImport_AddModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION); 2493 #else 2322 2494 PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, 2323 2495 swig_empty_runtime_method_table); 2496 #endif 2324 2497 PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule); 2325 2498 if (pointer && module) { … … 2341 2514 { 2342 2515 PyObject *cache = SWIG_Python_TypeCache(); 2343 PyObject *key = PyString_FromString(type);2516 PyObject *key = SWIG_Python_str_FromChar(type); 2344 2517 PyObject *obj = PyDict_GetItem(cache, key); 2345 2518 swig_type_info *descriptor; … … 2368 2541 SWIGRUNTIME int 2369 2542 SWIG_Python_AddErrMesg(const char* mesg, int infront) 2370 { 2543 { 2371 2544 if (PyErr_Occurred()) { 2372 2545 PyObject *type = 0; … … 2375 2548 PyErr_Fetch(&type, &value, &traceback); 2376 2549 if (value) { 2550 char *tmp; 2377 2551 PyObject *old_str = PyObject_Str(value); 2378 2552 Py_XINCREF(type); 2379 2553 PyErr_Clear(); 2380 2554 if (infront) { 2381 PyErr_Format(type, "%s %s", mesg, PyString_AsString(old_str));2555 PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str)); 2382 2556 } else { 2383 PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg);2557 PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); 2384 2558 } 2559 SWIG_Python_str_DelForPy3(tmp); 2385 2560 Py_DECREF(old_str); 2386 2561 } … … 2405 2580 2406 2581 SWIGRUNTIMEINLINE const char * 2407 PySwigObject_GetDesc(PyObject *self)2582 SwigPyObject_GetDesc(PyObject *self) 2408 2583 { 2409 PySwigObject *v = (PySwigObject *)self;2584 SwigPyObject *v = (SwigPyObject *)self; 2410 2585 swig_type_info *ty = v ? v->ty : 0; 2411 2586 return ty ? ty->str : (char*)""; … … 2417 2592 if (type) { 2418 2593 #if defined(SWIG_COBJECT_TYPES) 2419 if (obj && PySwigObject_Check(obj)) {2420 const char *otype = (const char *) PySwigObject_GetDesc(obj);2594 if (obj && SwigPyObject_Check(obj)) { 2595 const char *otype = (const char *) SwigPyObject_GetDesc(obj); 2421 2596 if (otype) { 2422 PyErr_Format(PyExc_TypeError, "a '%s' is expected, ' PySwigObject(%s)' is received",2597 PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received", 2423 2598 type, otype); 2424 2599 return; … … 2430 2605 if (otype) { 2431 2606 PyObject *str = PyObject_Str(obj); 2432 const char *cstr = str ? PyString_AsString(str) : 0;2607 const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0; 2433 2608 if (cstr) { 2434 2609 PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received", 2435 2610 type, otype, cstr); 2611 SWIG_Python_str_DelForPy3(cstr); 2436 2612 } else { 2437 2613 PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", … … 2455 2631 if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) { 2456 2632 PyErr_Clear(); 2457 if (flags & SWIG_POINTER_EXCEPTION) { 2633 #if SWIG_POINTER_EXCEPTION 2634 if (flags) { 2458 2635 SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj); 2459 2636 SWIG_Python_ArgFail(argnum); 2460 2637 } 2638 #endif 2461 2639 } 2462 2640 return result; … … 2504 2682 @(target):= _pbs.so 2505 2683 ------------------------------------------------*/ 2506 #define SWIG_init init_pbs 2507 2684 #if PY_VERSION_HEX >= 0x03000000 2685 # define SWIG_init PyInit__pbs 2686 2687 #else 2688 # define SWIG_init init_pbs 2689 2690 #endif 2508 2691 #define SWIG_name "_pbs" 2509 2692 2510 #define SWIGVERSION 0x0103 362693 #define SWIGVERSION 0x010340 2511 2694 #define SWIG_VERSION SWIGVERSION 2512 2695 … … 2820 3003 SWIG_NewPointerObj((char *)(carray), pchar_descriptor, 0) : SWIG_Py_Void(); 2821 3004 } else { 3005 #if PY_VERSION_HEX >= 0x03000000 3006 return PyUnicode_FromStringAndSize(carray, (int)(size)); 3007 #else 2822 3008 return PyString_FromStringAndSize(carray, (int)(size)); 3009 #endif 2823 3010 } 2824 3011 } else { … … 2838 3025 SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) 2839 3026 { 2840 if (PyString_Check(obj)) { 3027 #if PY_VERSION_HEX>=0x03000000 3028 if (PyUnicode_Check(obj)) 3029 #else 3030 if (PyString_Check(obj)) 3031 #endif 3032 { 2841 3033 char *cstr; Py_ssize_t len; 3034 #if PY_VERSION_HEX>=0x03000000 3035 if (!alloc && cptr) { 3036 /* We can't allow converting without allocation, since the internal 3037 representation of string in Python 3 is UCS-2/UCS-4 but we require 3038 a UTF-8 representation. 3039 TODO(bhy) More detailed explanation */ 3040 return SWIG_RuntimeError; 3041 } 3042 obj = PyUnicode_AsUTF8String(obj); 3043 PyBytes_AsStringAndSize(obj, &cstr, &len); 3044 if(alloc) *alloc = SWIG_NEWOBJ; 3045 #else 2842 3046 PyString_AsStringAndSize(obj, &cstr, &len); 2843 if (cptr) { 3047 #endif 3048 if (cptr) { 2844 3049 if (alloc) { 2845 3050 /* … … 2866 3071 } 2867 3072 } else { 2868 *cptr = PyString_AsString(obj); 3073 #if PY_VERSION_HEX>=0x03000000 3074 assert(0); /* Should never reach here in Python 3 */ 3075 #endif 3076 *cptr = SWIG_Python_str_AsChar(obj); 2869 3077 } 2870 3078 } 2871 3079 if (psize) *psize = len + 1; 3080 #if PY_VERSION_HEX>=0x03000000 3081 Py_XDECREF(obj); 3082 #endif 2872 3083 return SWIG_OK; 2873 3084 } else { … … 7105 7316 7106 7317 static PyMethodDef SwigMethods[] = { 7318 { (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL}, 7107 7319 { (char *)"new_attrl", _wrap_new_attrl, METH_VARARGS, NULL}, 7108 7320 { (char *)"new_attropl", _wrap_new_attropl, METH_VARARGS, NULL}, … … 7513 7725 SWIGINTERN PyObject * 7514 7726 swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) { 7727 #if PY_VERSION_HEX >= 0x03000000 7728 return PyUnicode_InternFromString("<Swig global variables>"); 7729 #else 7515 7730 return PyString_FromString("<Swig global variables>"); 7731 #endif 7516 7732 } 7517 7733 7518 7734 SWIGINTERN PyObject * 7519 7735 swig_varlink_str(swig_varlinkobject *v) { 7736 #if PY_VERSION_HEX >= 0x03000000 7737 PyObject *str = PyUnicode_InternFromString("("); 7738 PyObject *tail; 7739 PyObject *joined; 7740 swig_globalvar *var; 7741 for (var = v->vars; var; var=var->next) { 7742 tail = PyUnicode_FromString(var->name); 7743 joined = PyUnicode_Concat(str, tail); 7744 Py_DecRef(str); 7745 Py_DecRef(tail); 7746 str = joined; 7747 if (var->next) { 7748 tail = PyUnicode_InternFromString(", "); 7749 joined = PyUnicode_Concat(str, tail); 7750 Py_DecRef(str); 7751 Py_DecRef(tail); 7752 str = joined; 7753 } 7754 } 7755 tail = PyUnicode_InternFromString(")"); 7756 joined = PyUnicode_Concat(str, tail); 7757 Py_DecRef(str); 7758 Py_DecRef(tail); 7759 str = joined; 7760 #else 7520 7761 PyObject *str = PyString_FromString("("); 7521 swig_globalvar 7762 swig_globalvar *var; 7522 7763 for (var = v->vars; var; var=var->next) { 7523 7764 PyString_ConcatAndDel(&str,PyString_FromString(var->name)); … … 7525 7766 } 7526 7767 PyString_ConcatAndDel(&str,PyString_FromString(")")); 7768 #endif 7527 7769 return str; 7528 7770 } … … 7530 7772 SWIGINTERN int 7531 7773 swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { 7774 char *tmp; 7532 7775 PyObject *str = swig_varlink_str(v); 7533 7776 fprintf(fp,"Swig global variables "); 7534 fprintf(fp,"%s\n", PyString_AsString(str)); 7777 fprintf(fp,"%s\n", tmp = SWIG_Python_str_AsChar(str)); 7778 SWIG_Python_str_DelForPy3(tmp); 7535 7779 Py_DECREF(str); 7536 7780 return 0; … … 7590 7834 const PyTypeObject tmp 7591 7835 = { 7836 /* PyObject header changed in Python 3 */ 7837 #if PY_VERSION_HEX >= 0x03000000 7838 PyVarObject_HEAD_INIT(&PyType_Type, 0) 7839 #else 7592 7840 PyObject_HEAD_INIT(NULL) 7593 7841 0, /* Number of items in variable part (ob_size) */ 7842 #endif 7594 7843 (char *)"swigvarlink", /* Type name (tp_name) */ 7595 7844 sizeof(swig_varlinkobject), /* Basic size (tp_basicsize) */ 7596 7845 0, /* Itemsize (tp_itemsize) */ 7597 (destructor) swig_varlink_dealloc, 7846 (destructor) swig_varlink_dealloc, /* Deallocator (tp_dealloc) */ 7598 7847 (printfunc) swig_varlink_print, /* Print (tp_print) */ 7599 7848 (getattrfunc) swig_varlink_getattr, /* get attr (tp_getattr) */ … … 7606 7855 0, /* tp_hash */ 7607 7856 0, /* tp_call */ 7608 (reprfunc) swig_varlink_str, /* tp_str */7857 (reprfunc) swig_varlink_str, /* tp_str */ 7609 7858 0, /* tp_getattro */ 7610 7859 0, /* tp_setattro */ … … 7627 7876 }; 7628 7877 varlink_type = tmp; 7878 /* for Python 3 we already assigned ob_type in PyVarObject_HEAD_INIT() */ 7879 #if PY_VERSION_HEX < 0x03000000 7629 7880 varlink_type.ob_type = &PyType_Type; 7881 #endif 7630 7882 type_init = 1; 7631 7883 } … … 7752 8004 extern "C" 7753 8005 #endif 7754 SWIGEXPORT void SWIG_init(void) { 7755 PyObject *m, *d; 8006 8007 SWIGEXPORT 8008 #if PY_VERSION_HEX >= 0x03000000 8009 PyObject* 8010 #else 8011 void 8012 #endif 8013 SWIG_init(void) { 8014 PyObject *m, *d; 8015 #if PY_VERSION_HEX >= 0x03000000 8016 static struct PyModuleDef SWIG_module = { 8017 PyModuleDef_HEAD_INIT, 8018 (char *) SWIG_name, 8019 NULL, 8020 -1, 8021 SwigMethods, 8022 NULL, 8023 NULL, 8024 NULL, 8025 NULL 8026 }; 8027 #endif 7756 8028 7757 8029 /* Fix SwigMethods to carry the callback ptrs when needed */ 7758 8030 SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial); 7759 8031 8032 #if PY_VERSION_HEX >= 0x03000000 8033 m = PyModule_Create(&SWIG_module); 8034 #else 7760 8035 m = Py_InitModule((char *) SWIG_name, SwigMethods); 8036 #endif 7761 8037 d = PyModule_GetDict(m); 7762 8038 … … 8072 8348 SWIG_Python_SetConstant(d, "FALSE",SWIG_From_int((int)(0))); 8073 8349 SWIG_addvarlink(SWIG_globals(),(char*)"msg_daemonname",Swig_var_msg_daemonname_get, Swig_var_msg_daemonname_set); 8074 } 8075 8350 #if PY_VERSION_HEX >= 0x03000000 8351 return m; 8352 #else 8353 return; 8354 #endif 8355 } 8356 -
trunk/src/pbs_wrap_2.4.c
r215 r268 1 1 /* ---------------------------------------------------------------------------- 2 2 * This file was automatically generated by SWIG (http://www.swig.org). 3 * Version 1.3. 363 * Version 1.3.40 4 4 * 5 5 * This file is not intended to be easily readable and contains a number of … … 11 11 #define SWIGPYTHON 12 12 #define SWIG_PYTHON_DIRECTOR_NO_VTABLE 13 13 14 /* ----------------------------------------------------------------------------- 14 15 * This section contains generic SWIG labels for method/variable … … 127 128 * swigrun.swg 128 129 * 129 * This file contains generic C API SWIG runtime support for pointer130 * This file contains generic C API SWIG runtime support for pointer 130 131 * type checking. 131 132 * ----------------------------------------------------------------------------- */ … … 146 147 /* 147 148 You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for 148 creating a static or dynamic library from the swigruntime code.149 In 99.9% of the cases, swigjust needs to declare them as 'static'.150 151 But only do this if isstrictly necessary, ie, if you have problems152 with your compiler or s o.149 creating a static or dynamic library from the SWIG runtime code. 150 In 99.9% of the cases, SWIG just needs to declare them as 'static'. 151 152 But only do this if strictly necessary, ie, if you have problems 153 with your compiler or suchlike. 153 154 */ 154 155 … … 177 178 Flags/methods for returning states. 178 179 179 The swigconversion methods, as ConvertPtr, return and integer180 The SWIG conversion methods, as ConvertPtr, return and integer 180 181 that tells if the conversion was successful or not. And if not, 181 182 an error code can be returned (see swigerrors.swg for the codes). … … 184 185 states. 185 186 186 In old swig versions, you usually write code as:187 In old versions of SWIG, code such as the following was usually written: 187 188 188 189 if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) { … … 192 193 } 193 194 194 Now you can be more explicit as:195 Now you can be more explicit: 195 196 196 197 int res = SWIG_ConvertPtr(obj,vptr,ty.flags); … … 201 202 } 202 203 203 that seems to be the same, but now you can also do204 which is the same really, but now you can also do 204 205 205 206 Type *ptr; … … 219 220 I.e., now SWIG_ConvertPtr can return new objects and you can 220 221 identify the case and take care of the deallocation. Of course that 221 requires also to SWIG_ConvertPtr to return new result values,as222 also requires SWIG_ConvertPtr to return new result values, such as 222 223 223 224 int SWIG_ConvertPtr(obj, ptr,...) { … … 237 238 Of course, returning the plain '0(success)/-1(fail)' still works, but you can be 238 239 more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the 239 swigerrors code.240 SWIG errors code. 240 241 241 242 Finally, if the SWIG_CASTRANK_MODE is enabled, the result code … … 251 252 252 253 just use the SWIG_AddCast()/SWIG_CheckState() 253 254 255 */ 254 */ 255 256 256 #define SWIG_OK (0) 257 257 #define SWIG_ERROR (-1) … … 278 278 #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK)) 279 279 280 281 280 /* Cast-Rank Mode */ 282 281 #if defined(SWIG_CASTRANK_MODE) … … 301 300 302 301 303 304 305 302 #include <string.h> 306 303 … … 399 396 400 397 401 /* think of this as a c++ template<> or a scheme macro */402 #define SWIG_TypeCheck_Template(comparison, ty) \403 if (ty) { \404 swig_cast_info *iter = ty->cast; \405 while (iter) { \406 if (comparison) { \407 if (iter == ty->cast) return iter; \408 /* Move iter to the top of the linked list */ \409 iter->prev->next = iter->next; \410 if (iter->next) \411 iter->next->prev = iter->prev; \412 iter->next = ty->cast; \413 iter->prev = 0; \414 if (ty->cast) ty->cast->prev = iter; \415 ty->cast = iter; \416 return iter; \417 } \418 iter = iter->next; \419 } \420 } \421 return 0422 423 398 /* 424 399 Check the typename … … 426 401 SWIGRUNTIME swig_cast_info * 427 402 SWIG_TypeCheck(const char *c, swig_type_info *ty) { 428 SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty); 429 } 430 431 /* Same as previous function, except strcmp is replaced with a pointer comparison */ 403 if (ty) { 404 swig_cast_info *iter = ty->cast; 405 while (iter) { 406 if (strcmp(iter->type->name, c) == 0) { 407 if (iter == ty->cast) 408 return iter; 409 /* Move iter to the top of the linked list */ 410 iter->prev->next = iter->next; 411 if (iter->next) 412 iter->next->prev = iter->prev; 413 iter->next = ty->cast; 414 iter->prev = 0; 415 if (ty->cast) ty->cast->prev = iter; 416 ty->cast = iter; 417 return iter; 418 } 419 iter = iter->next; 420 } 421 } 422 return 0; 423 } 424 425 /* 426 Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison 427 */ 432 428 SWIGRUNTIME swig_cast_info * 433 SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) { 434 SWIG_TypeCheck_Template(iter->type == from, into); 429 SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) { 430 if (ty) { 431 swig_cast_info *iter = ty->cast; 432 while (iter) { 433 if (iter->type == from) { 434 if (iter == ty->cast) 435 return iter; 436 /* Move iter to the top of the linked list */ 437 iter->prev->next = iter->next; 438 if (iter->next) 439 iter->next->prev = iter->prev; 440 iter->next = ty->cast; 441 iter->prev = 0; 442 if (ty->cast) ty->cast->prev = iter; 443 ty->cast = iter; 444 return iter; 445 } 446 iter = iter->next; 447 } 448 } 449 return 0; 435 450 } 436 451 … … 711 726 712 727 728 /* Compatibility macros for Python 3 */ 729 #if PY_VERSION_HEX >= 0x03000000 730 731 #define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type) 732 #define PyInt_Check(x) PyLong_Check(x) 733 #define PyInt_AsLong(x) PyLong_AsLong(x) 734 #define PyInt_FromLong(x) PyLong_FromLong(x) 735 #define PyString_Format(fmt, args) PyUnicode_Format(fmt, args) 736 737 #endif 738 739 #ifndef Py_TYPE 740 # define Py_TYPE(op) ((op)->ob_type) 741 #endif 742 743 /* SWIG APIs for compatibility of both Python 2 & 3 */ 744 745 #if PY_VERSION_HEX >= 0x03000000 746 # define SWIG_Python_str_FromFormat PyUnicode_FromFormat 747 #else 748 # define SWIG_Python_str_FromFormat PyString_FromFormat 749 #endif 750 751 752 /* Warning: This function will allocate a new string in Python 3, 753 * so please call SWIG_Python_str_DelForPy3(x) to free the space. 754 */ 755 SWIGINTERN char* 756 SWIG_Python_str_AsChar(PyObject *str) 757 { 758 #if PY_VERSION_HEX >= 0x03000000 759 char *cstr; 760 char *newstr; 761 Py_ssize_t len; 762 str = PyUnicode_AsUTF8String(str); 763 PyBytes_AsStringAndSize(str, &cstr, &len); 764 newstr = (char *) malloc(len+1); 765 memcpy(newstr, cstr, len+1); 766 Py_XDECREF(str); 767 return newstr; 768 #else 769 return PyString_AsString(str); 770 #endif 771 } 772 773 #if PY_VERSION_HEX >= 0x03000000 774 # define SWIG_Python_str_DelForPy3(x) free( (void*) (x) ) 775 #else 776 # define SWIG_Python_str_DelForPy3(x) 777 #endif 778 779 780 SWIGINTERN PyObject* 781 SWIG_Python_str_FromChar(const char *c) 782 { 783 #if PY_VERSION_HEX >= 0x03000000 784 return PyUnicode_FromString(c); 785 #else 786 return PyString_FromString(c); 787 #endif 788 } 713 789 714 790 /* Add PyOS_snprintf for old Pythons */ … … 757 833 # endif 758 834 #endif 835 759 836 /* Py_NotImplemented is defined in 2.1 and up. */ 760 837 #if PY_VERSION_HEX < 0x02010000 … … 764 841 #endif 765 842 766 767 843 /* A crude PyString_AsStringAndSize implementation for old Pythons */ 768 844 #if PY_VERSION_HEX < 0x02010000 … … 778 854 # endif 779 855 #endif 780 781 856 782 857 /* PyBool_FromLong for old Pythons */ … … 857 932 if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback); 858 933 if (value) { 934 char *tmp; 859 935 PyObject *old_str = PyObject_Str(value); 860 936 PyErr_Clear(); 861 937 Py_XINCREF(type); 862 PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg); 938 939 PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); 940 SWIG_Python_str_DelForPy3(tmp); 863 941 Py_DECREF(old_str); 864 942 Py_DECREF(value); … … 867 945 } 868 946 } 869 870 871 947 872 948 #if defined(SWIG_PYTHON_NO_THREADS) … … 966 1042 } swig_const_info; 967 1043 1044 1045 /* ----------------------------------------------------------------------------- 1046 * Wrapper of PyInstanceMethod_New() used in Python 3 1047 * It is exported to the generated module, used for -fastproxy 1048 * ----------------------------------------------------------------------------- */ 1049 SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *self, PyObject *func) 1050 { 1051 #if PY_VERSION_HEX >= 0x03000000 1052 return PyInstanceMethod_New(func); 1053 #else 1054 return NULL; 1055 #endif 1056 } 1057 968 1058 #ifdef __cplusplus 969 1059 #if 0 … … 1018 1108 #define SWIG_GetModule(clientdata) SWIG_Python_GetModule() 1019 1109 #define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer) 1020 #define SWIG_NewClientData(obj) PySwigClientData_New(obj)1110 #define SWIG_NewClientData(obj) SwigPyClientData_New(obj) 1021 1111 1022 1112 #define SWIG_SetErrorObj SWIG_Python_SetErrorObj … … 1214 1304 } 1215 1305 1216 /* PySwigClientData */1306 /* SwigPyClientData */ 1217 1307 1218 1308 typedef struct { … … 1223 1313 int delargs; 1224 1314 int implicitconv; 1225 } PySwigClientData;1315 } SwigPyClientData; 1226 1316 1227 1317 SWIGRUNTIMEINLINE int 1228 1318 SWIG_Python_CheckImplicit(swig_type_info *ty) 1229 1319 { 1230 PySwigClientData *data = (PySwigClientData *)ty->clientdata;1320 SwigPyClientData *data = (SwigPyClientData *)ty->clientdata; 1231 1321 return data ? data->implicitconv : 0; 1232 1322 } … … 1234 1324 SWIGRUNTIMEINLINE PyObject * 1235 1325 SWIG_Python_ExceptionType(swig_type_info *desc) { 1236 PySwigClientData *data = desc ? (PySwigClientData *) desc->clientdata : 0;1326 SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0; 1237 1327 PyObject *klass = data ? data->klass : 0; 1238 1328 return (klass ? klass : PyExc_RuntimeError); … … 1240 1330 1241 1331 1242 SWIGRUNTIME PySwigClientData *1243 PySwigClientData_New(PyObject* obj)1332 SWIGRUNTIME SwigPyClientData * 1333 SwigPyClientData_New(PyObject* obj) 1244 1334 { 1245 1335 if (!obj) { 1246 1336 return 0; 1247 1337 } else { 1248 PySwigClientData *data = (PySwigClientData *)malloc(sizeof(PySwigClientData));1338 SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData)); 1249 1339 /* the klass element */ 1250 1340 data->klass = obj; … … 1294 1384 1295 1385 SWIGRUNTIME void 1296 PySwigClientData_Del(PySwigClientData* data)1386 SwigPyClientData_Del(SwigPyClientData* data) 1297 1387 { 1298 1388 Py_XDECREF(data->newraw); … … 1301 1391 } 1302 1392 1303 /* =============== PySwigObject =====================*/1393 /* =============== SwigPyObject =====================*/ 1304 1394 1305 1395 typedef struct { … … 1309 1399 int own; 1310 1400 PyObject *next; 1311 } PySwigObject;1401 } SwigPyObject; 1312 1402 1313 1403 SWIGRUNTIME PyObject * 1314 PySwigObject_long(PySwigObject *v)1404 SwigPyObject_long(SwigPyObject *v) 1315 1405 { 1316 1406 return PyLong_FromVoidPtr(v->ptr); … … 1318 1408 1319 1409 SWIGRUNTIME PyObject * 1320 PySwigObject_format(const char* fmt, PySwigObject *v)1410 SwigPyObject_format(const char* fmt, SwigPyObject *v) 1321 1411 { 1322 1412 PyObject *res = NULL; 1323 1413 PyObject *args = PyTuple_New(1); 1324 1414 if (args) { 1325 if (PyTuple_SetItem(args, 0, PySwigObject_long(v)) == 0) {1326 PyObject *ofmt = PyString_FromString(fmt);1415 if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) { 1416 PyObject *ofmt = SWIG_Python_str_FromChar(fmt); 1327 1417 if (ofmt) { 1418 #if PY_VERSION_HEX >= 0x03000000 1419 res = PyUnicode_Format(ofmt,args); 1420 #else 1328 1421 res = PyString_Format(ofmt,args); 1422 #endif 1329 1423 Py_DECREF(ofmt); 1330 1424 } … … 1336 1430 1337 1431 SWIGRUNTIME PyObject * 1338 PySwigObject_oct(PySwigObject *v)1432 SwigPyObject_oct(SwigPyObject *v) 1339 1433 { 1340 return PySwigObject_format("%o",v);1434 return SwigPyObject_format("%o",v); 1341 1435 } 1342 1436 1343 1437 SWIGRUNTIME PyObject * 1344 PySwigObject_hex(PySwigObject *v)1438 SwigPyObject_hex(SwigPyObject *v) 1345 1439 { 1346 return PySwigObject_format("%x",v);1440 return SwigPyObject_format("%x",v); 1347 1441 } 1348 1442 1349 1443 SWIGRUNTIME PyObject * 1350 1444 #ifdef METH_NOARGS 1351 PySwigObject_repr(PySwigObject *v)1445 SwigPyObject_repr(SwigPyObject *v) 1352 1446 #else 1353 PySwigObject_repr(PySwigObject *v, PyObject *args)1447 SwigPyObject_repr(SwigPyObject *v, PyObject *args) 1354 1448 #endif 1355 1449 { 1356 1450 const char *name = SWIG_TypePrettyName(v->ty); 1357 PyObject *hex = PySwigObject_hex(v); 1358 PyObject *repr = PyString_FromFormat("<Swig Object of type '%s' at 0x%s>", name, PyString_AsString(hex)); 1359 Py_DECREF(hex); 1451 PyObject *repr = SWIG_Python_str_FromFormat("<Swig Object of type '%s' at %p>", name, v); 1360 1452 if (v->next) { 1361 1453 #ifdef METH_NOARGS 1362 PyObject *nrep = PySwigObject_repr((PySwigObject *)v->next);1454 PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next); 1363 1455 #else 1364 PyObject *nrep = PySwigObject_repr((PySwigObject *)v->next, args); 1365 #endif 1456 PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next, args); 1457 #endif 1458 #if PY_VERSION_HEX >= 0x03000000 1459 PyObject *joined = PyUnicode_Concat(repr, nrep); 1460 Py_DecRef(repr); 1461 Py_DecRef(nrep); 1462 repr = joined; 1463 #else 1366 1464 PyString_ConcatAndDel(&repr,nrep); 1465 #endif 1367 1466 } 1368 1467 return repr; … … 1370 1469 1371 1470 SWIGRUNTIME int 1372 PySwigObject_print(PySwigObject *v, FILE *fp, int SWIGUNUSEDPARM(flags))1471 SwigPyObject_print(SwigPyObject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) 1373 1472 { 1473 char *str; 1374 1474 #ifdef METH_NOARGS 1375 PyObject *repr = PySwigObject_repr(v);1475 PyObject *repr = SwigPyObject_repr(v); 1376 1476 #else 1377 PyObject *repr = PySwigObject_repr(v, NULL);1477 PyObject *repr = SwigPyObject_repr(v, NULL); 1378 1478 #endif 1379 1479 if (repr) { 1380 fputs(PyString_AsString(repr), fp); 1480 str = SWIG_Python_str_AsChar(repr); 1481 fputs(str, fp); 1482 SWIG_Python_str_DelForPy3(str); 1381 1483 Py_DECREF(repr); 1382 1484 return 0; … … 1387 1489 1388 1490 SWIGRUNTIME PyObject * 1389 PySwigObject_str(PySwigObject *v)1491 SwigPyObject_str(SwigPyObject *v) 1390 1492 { 1391 1493 char result[SWIG_BUFFER_SIZE]; 1392 1494 return SWIG_PackVoidPtr(result, v->ptr, v->ty->name, sizeof(result)) ? 1393 PyString_FromString(result) : 0;1495 SWIG_Python_str_FromChar(result) : 0; 1394 1496 } 1395 1497 1396 1498 SWIGRUNTIME int 1397 PySwigObject_compare(PySwigObject *v, PySwigObject *w)1499 SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w) 1398 1500 { 1399 1501 void *i = v->ptr; … … 1402 1504 } 1403 1505 1506 /* Added for Python 3.x, would it also be useful for Python 2.x? */ 1507 SWIGRUNTIME PyObject* 1508 SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op) 1509 { 1510 PyObject* res; 1511 if( op != Py_EQ && op != Py_NE ) { 1512 Py_INCREF(Py_NotImplemented); 1513 return Py_NotImplemented; 1514 } 1515 if( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ) 1516 res = Py_True; 1517 else 1518 res = Py_False; 1519 Py_INCREF(res); 1520 return res; 1521 } 1522 1523 1404 1524 SWIGRUNTIME PyTypeObject* _PySwigObject_type(void); 1405 1525 1406 1526 SWIGRUNTIME PyTypeObject* 1407 PySwigObject_type(void) {1527 SwigPyObject_type(void) { 1408 1528 static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigObject_type(); 1409 1529 return type; … … 1411 1531 1412 1532 SWIGRUNTIMEINLINE int 1413 PySwigObject_Check(PyObject *op) {1414 return ( (op)->ob_type == PySwigObject_type())1415 || (strcmp( (op)->ob_type->tp_name,"PySwigObject") == 0);1533 SwigPyObject_Check(PyObject *op) { 1534 return (Py_TYPE(op) == SwigPyObject_type()) 1535 || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0); 1416 1536 } 1417 1537 1418 1538 SWIGRUNTIME PyObject * 1419 PySwigObject_New(void *ptr, swig_type_info *ty, int own);1539 SwigPyObject_New(void *ptr, swig_type_info *ty, int own); 1420 1540 1421 1541 SWIGRUNTIME void 1422 PySwigObject_dealloc(PyObject *v)1542 SwigPyObject_dealloc(PyObject *v) 1423 1543 { 1424 PySwigObject *sobj = (PySwigObject *) v;1544 SwigPyObject *sobj = (SwigPyObject *) v; 1425 1545 PyObject *next = sobj->next; 1426 1546 if (sobj->own == SWIG_POINTER_OWN) { 1427 1547 swig_type_info *ty = sobj->ty; 1428 PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0;1548 SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; 1429 1549 PyObject *destroy = data ? data->destroy : 0; 1430 1550 if (destroy) { … … 1432 1552 PyObject *res; 1433 1553 if (data->delargs) { 1434 /* we need to create a tempora lobject to carry the destroy operation */1435 PyObject *tmp = PySwigObject_New(sobj->ptr, ty, 0);1554 /* we need to create a temporary object to carry the destroy operation */ 1555 PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0); 1436 1556 res = SWIG_Python_CallFunctor(destroy, tmp); 1437 1557 Py_DECREF(tmp); … … 1455 1575 1456 1576 SWIGRUNTIME PyObject* 1457 PySwigObject_append(PyObject* v, PyObject* next)1577 SwigPyObject_append(PyObject* v, PyObject* next) 1458 1578 { 1459 PySwigObject *sobj = (PySwigObject *) v;1579 SwigPyObject *sobj = (SwigPyObject *) v; 1460 1580 #ifndef METH_O 1461 1581 PyObject *tmp = 0; … … 1463 1583 next = tmp; 1464 1584 #endif 1465 if (! PySwigObject_Check(next)) {1585 if (!SwigPyObject_Check(next)) { 1466 1586 return NULL; 1467 1587 } … … 1473 1593 SWIGRUNTIME PyObject* 1474 1594 #ifdef METH_NOARGS 1475 PySwigObject_next(PyObject* v)1595 SwigPyObject_next(PyObject* v) 1476 1596 #else 1477 PySwigObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args))1597 SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) 1478 1598 #endif 1479 1599 { 1480 PySwigObject *sobj = (PySwigObject *) v;1600 SwigPyObject *sobj = (SwigPyObject *) v; 1481 1601 if (sobj->next) { 1482 1602 Py_INCREF(sobj->next); … … 1489 1609 SWIGINTERN PyObject* 1490 1610 #ifdef METH_NOARGS 1491 PySwigObject_disown(PyObject *v)1611 SwigPyObject_disown(PyObject *v) 1492 1612 #else 1493 PySwigObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args))1613 SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) 1494 1614 #endif 1495 1615 { 1496 PySwigObject *sobj = (PySwigObject *)v;1616 SwigPyObject *sobj = (SwigPyObject *)v; 1497 1617 sobj->own = 0; 1498 1618 return SWIG_Py_Void(); … … 1501 1621 SWIGINTERN PyObject* 1502 1622 #ifdef METH_NOARGS 1503 PySwigObject_acquire(PyObject *v)1623 SwigPyObject_acquire(PyObject *v) 1504 1624 #else 1505 PySwigObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args))1625 SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) 1506 1626 #endif 1507 1627 { 1508 PySwigObject *sobj = (PySwigObject *)v;1628 SwigPyObject *sobj = (SwigPyObject *)v; 1509 1629 sobj->own = SWIG_POINTER_OWN; 1510 1630 return SWIG_Py_Void(); … … 1512 1632 1513 1633 SWIGINTERN PyObject* 1514 PySwigObject_own(PyObject *v, PyObject *args)1634 SwigPyObject_own(PyObject *v, PyObject *args) 1515 1635 { 1516 1636 PyObject *val = 0; … … 1525 1645 else 1526 1646 { 1527 PySwigObject *sobj = (PySwigObject *)v;1647 SwigPyObject *sobj = (SwigPyObject *)v; 1528 1648 PyObject *obj = PyBool_FromLong(sobj->own); 1529 1649 if (val) { 1530 1650 #ifdef METH_NOARGS 1531 1651 if (PyObject_IsTrue(val)) { 1532 PySwigObject_acquire(v);1652 SwigPyObject_acquire(v); 1533 1653 } else { 1534 PySwigObject_disown(v);1654 SwigPyObject_disown(v); 1535 1655 } 1536 1656 #else 1537 1657 if (PyObject_IsTrue(val)) { 1538 PySwigObject_acquire(v,args);1658 SwigPyObject_acquire(v,args); 1539 1659 } else { 1540 PySwigObject_disown(v,args);1660 SwigPyObject_disown(v,args); 1541 1661 } 1542 1662 #endif … … 1549 1669 static PyMethodDef 1550 1670 swigobject_methods[] = { 1551 {(char *)"disown", (PyCFunction) PySwigObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"},1552 {(char *)"acquire", (PyCFunction) PySwigObject_acquire, METH_NOARGS, (char *)"aquires ownership of the pointer"},1553 {(char *)"own", (PyCFunction) PySwigObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"},1554 {(char *)"append", (PyCFunction) PySwigObject_append, METH_O, (char *)"appends another 'this' object"},1555 {(char *)"next", (PyCFunction) PySwigObject_next, METH_NOARGS, (char *)"returns the next 'this' object"},1556 {(char *)"__repr__",(PyCFunction) PySwigObject_repr, METH_NOARGS, (char *)"returns object representation"},1671 {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"}, 1672 {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS, (char *)"aquires ownership of the pointer"}, 1673 {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, 1674 {(char *)"append", (PyCFunction)SwigPyObject_append, METH_O, (char *)"appends another 'this' object"}, 1675 {(char *)"next", (PyCFunction)SwigPyObject_next, METH_NOARGS, (char *)"returns the next 'this' object"}, 1676 {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_NOARGS, (char *)"returns object representation"}, 1557 1677 {0, 0, 0, 0} 1558 1678 }; … … 1560 1680 static PyMethodDef 1561 1681 swigobject_methods[] = { 1562 {(char *)"disown", (PyCFunction) PySwigObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"},1563 {(char *)"acquire", (PyCFunction) PySwigObject_acquire, METH_VARARGS, (char *)"aquires ownership of the pointer"},1564 {(char *)"own", (PyCFunction) PySwigObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"},1565 {(char *)"append", (PyCFunction) PySwigObject_append, METH_VARARGS, (char *)"appends another 'this' object"},1566 {(char *)"next", (PyCFunction) PySwigObject_next, METH_VARARGS, (char *)"returns the next 'this' object"},1567 {(char *)"__repr__",(PyCFunction) PySwigObject_repr, METH_VARARGS, (char *)"returns object representation"},1682 {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"}, 1683 {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS, (char *)"aquires ownership of the pointer"}, 1684 {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, 1685 {(char *)"append", (PyCFunction)SwigPyObject_append, METH_VARARGS, (char *)"appends another 'this' object"}, 1686 {(char *)"next", (PyCFunction)SwigPyObject_next, METH_VARARGS, (char *)"returns the next 'this' object"}, 1687 {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_VARARGS, (char *)"returns object representation"}, 1568 1688 {0, 0, 0, 0} 1569 1689 }; … … 1572 1692 #if PY_VERSION_HEX < 0x02020000 1573 1693 SWIGINTERN PyObject * 1574 PySwigObject_getattr(PySwigObject *sobj,char *name)1694 SwigPyObject_getattr(SwigPyObject *sobj,char *name) 1575 1695 { 1576 1696 return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name); … … 1582 1702 static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer"; 1583 1703 1584 static PyNumberMethods PySwigObject_as_number = {1704 static PyNumberMethods SwigPyObject_as_number = { 1585 1705 (binaryfunc)0, /*nb_add*/ 1586 1706 (binaryfunc)0, /*nb_subtract*/ 1587 1707 (binaryfunc)0, /*nb_multiply*/ 1708 /* nb_divide removed in Python 3 */ 1709 #if PY_VERSION_HEX < 0x03000000 1588 1710 (binaryfunc)0, /*nb_divide*/ 1711 #endif 1589 1712 (binaryfunc)0, /*nb_remainder*/ 1590 1713 (binaryfunc)0, /*nb_divmod*/ … … 1600 1723 0, /*nb_xor*/ 1601 1724 0, /*nb_or*/ 1602 (coercion)0, /*nb_coerce*/ 1603 (unaryfunc)PySwigObject_long, /*nb_int*/ 1604 (unaryfunc)PySwigObject_long, /*nb_long*/ 1725 #if PY_VERSION_HEX < 0x03000000 1726 0, /*nb_coerce*/ 1727 #endif 1728 (unaryfunc)SwigPyObject_long, /*nb_int*/ 1729 #if PY_VERSION_HEX < 0x03000000 1730 (unaryfunc)SwigPyObject_long, /*nb_long*/ 1731 #else 1732 0, /*nb_reserved*/ 1733 #endif 1605 1734 (unaryfunc)0, /*nb_float*/ 1606 (unaryfunc)PySwigObject_oct, /*nb_oct*/ 1607 (unaryfunc)PySwigObject_hex, /*nb_hex*/ 1608 #if PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */ 1735 #if PY_VERSION_HEX < 0x03000000 1736 (unaryfunc)SwigPyObject_oct, /*nb_oct*/ 1737 (unaryfunc)SwigPyObject_hex, /*nb_hex*/ 1738 #endif 1739 #if PY_VERSION_HEX >= 0x03000000 /* 3.0 */ 1740 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */ 1741 #elif PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */ 1609 1742 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */ 1610 1743 #elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */ … … 1615 1748 }; 1616 1749 1617 static PyTypeObject pyswigobject_type;1750 static PyTypeObject swigpyobject_type; 1618 1751 static int type_init = 0; 1619 1752 if (!type_init) { 1620 1753 const PyTypeObject tmp 1621 1754 = { 1755 /* PyObject header changed in Python 3 */ 1756 #if PY_VERSION_HEX >= 0x03000000 1757 PyVarObject_HEAD_INIT(&PyType_Type, 0) 1758 #else 1622 1759 PyObject_HEAD_INIT(NULL) 1623 1760 0, /* ob_size */ 1624 (char *)"PySwigObject", /* tp_name */ 1625 sizeof(PySwigObject), /* tp_basicsize */ 1761 #endif 1762 (char *)"SwigPyObject", /* tp_name */ 1763 sizeof(SwigPyObject), /* tp_basicsize */ 1626 1764 0, /* tp_itemsize */ 1627 (destructor) PySwigObject_dealloc, /* tp_dealloc */1628 (printfunc) PySwigObject_print, /* tp_print */1765 (destructor)SwigPyObject_dealloc, /* tp_dealloc */ 1766 (printfunc)SwigPyObject_print, /* tp_print */ 1629 1767 #if PY_VERSION_HEX < 0x02020000 1630 (getattrfunc) PySwigObject_getattr, /* tp_getattr */1768 (getattrfunc)SwigPyObject_getattr, /* tp_getattr */ 1631 1769 #else 1632 1770 (getattrfunc)0, /* tp_getattr */ 1633 1771 #endif 1634 1772 (setattrfunc)0, /* tp_setattr */ 1635 (cmpfunc)PySwigObject_compare, /* tp_compare */ 1636 (reprfunc)PySwigObject_repr, /* tp_repr */ 1637 &PySwigObject_as_number, /* tp_as_number */ 1773 #if PY_VERSION_HEX >= 0x03000000 1774 0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */ 1775 #else 1776 (cmpfunc)SwigPyObject_compare, /* tp_compare */ 1777 #endif 1778 (reprfunc)SwigPyObject_repr, /* tp_repr */ 1779 &SwigPyObject_as_number, /* tp_as_number */ 1638 1780 0, /* tp_as_sequence */ 1639 1781 0, /* tp_as_mapping */ 1640 1782 (hashfunc)0, /* tp_hash */ 1641 1783 (ternaryfunc)0, /* tp_call */ 1642 (reprfunc) PySwigObject_str, /* tp_str */1784 (reprfunc)SwigPyObject_str, /* tp_str */ 1643 1785 PyObject_GenericGetAttr, /* tp_getattro */ 1644 1786 0, /* tp_setattro */ … … 1648 1790 0, /* tp_traverse */ 1649 1791 0, /* tp_clear */ 1650 0,/* tp_richcompare */1792 (richcmpfunc)SwigPyObject_richcompare, /* tp_richcompare */ 1651 1793 0, /* tp_weaklistoffset */ 1652 1794 #if PY_VERSION_HEX >= 0x02020000 … … 1665 1807 0, /* tp_new */ 1666 1808 0, /* tp_free */ 1667 1809 0, /* tp_is_gc */ 1668 1810 0, /* tp_bases */ 1669 1811 0, /* tp_mro */ 1670 1812 0, /* tp_cache */ 1671 1813 0, /* tp_subclasses */ 1672 1814 0, /* tp_weaklist */ 1673 1815 #endif … … 1679 1821 #endif 1680 1822 }; 1681 pyswigobject_type = tmp; 1682 pyswigobject_type.ob_type = &PyType_Type; 1823 swigpyobject_type = tmp; 1824 /* for Python 3 we already assigned ob_type in PyVarObject_HEAD_INIT() */ 1825 #if PY_VERSION_HEX < 0x03000000 1826 swigpyobject_type.ob_type = &PyType_Type; 1827 #endif 1683 1828 type_init = 1; 1684 1829 } 1685 return & pyswigobject_type;1830 return &swigpyobject_type; 1686 1831 } 1687 1832 1688 1833 SWIGRUNTIME PyObject * 1689 PySwigObject_New(void *ptr, swig_type_info *ty, int own)1834 SwigPyObject_New(void *ptr, swig_type_info *ty, int own) 1690 1835 { 1691 PySwigObject *sobj = PyObject_NEW(PySwigObject, PySwigObject_type());1836 SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type()); 1692 1837 if (sobj) { 1693 1838 sobj->ptr = ptr; … … 1708 1853 swig_type_info *ty; 1709 1854 size_t size; 1710 } PySwigPacked;1855 } SwigPyPacked; 1711 1856 1712 1857 SWIGRUNTIME int 1713 PySwigPacked_print(PySwigPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags))1858 SwigPyPacked_print(SwigPyPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags)) 1714 1859 { 1715 1860 char result[SWIG_BUFFER_SIZE]; … … 1725 1870 1726 1871 SWIGRUNTIME PyObject * 1727 PySwigPacked_repr(PySwigPacked *v)1872 SwigPyPacked_repr(SwigPyPacked *v) 1728 1873 { 1729 1874 char result[SWIG_BUFFER_SIZE]; 1730 1875 if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) { 1731 return PyString_FromFormat("<Swig Packed at %s%s>", result, v->ty->name);1876 return SWIG_Python_str_FromFormat("<Swig Packed at %s%s>", result, v->ty->name); 1732 1877 } else { 1733 return PyString_FromFormat("<Swig Packed %s>", v->ty->name);1878 return SWIG_Python_str_FromFormat("<Swig Packed %s>", v->ty->name); 1734 1879 } 1735 1880 } 1736 1881 1737 1882 SWIGRUNTIME PyObject * 1738 PySwigPacked_str(PySwigPacked *v)1883 SwigPyPacked_str(SwigPyPacked *v) 1739 1884 { 1740 1885 char result[SWIG_BUFFER_SIZE]; 1741 1886 if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){ 1742 return PyString_FromFormat("%s%s", result, v->ty->name);1887 return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name); 1743 1888 } else { 1744 return PyString_FromString(v->ty->name);1889 return SWIG_Python_str_FromChar(v->ty->name); 1745 1890 } 1746 1891 } 1747 1892 1748 1893 SWIGRUNTIME int 1749 PySwigPacked_compare(PySwigPacked *v, PySwigPacked *w)1894 SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w) 1750 1895 { 1751 1896 size_t i = v->size; … … 1758 1903 1759 1904 SWIGRUNTIME PyTypeObject* 1760 PySwigPacked_type(void) {1905 SwigPyPacked_type(void) { 1761 1906 static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigPacked_type(); 1762 1907 return type; … … 1764 1909 1765 1910 SWIGRUNTIMEINLINE int 1766 PySwigPacked_Check(PyObject *op) {1911 SwigPyPacked_Check(PyObject *op) { 1767 1912 return ((op)->ob_type == _PySwigPacked_type()) 1768 || (strcmp((op)->ob_type->tp_name," PySwigPacked") == 0);1913 || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0); 1769 1914 } 1770 1915 1771 1916 SWIGRUNTIME void 1772 PySwigPacked_dealloc(PyObject *v)1917 SwigPyPacked_dealloc(PyObject *v) 1773 1918 { 1774 if ( PySwigPacked_Check(v)) {1775 PySwigPacked *sobj = (PySwigPacked *) v;1919 if (SwigPyPacked_Check(v)) { 1920 SwigPyPacked *sobj = (SwigPyPacked *) v; 1776 1921 free(sobj->pack); 1777 1922 } … … 1782 1927 _PySwigPacked_type(void) { 1783 1928 static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer"; 1784 static PyTypeObject pyswigpacked_type;1929 static PyTypeObject swigpypacked_type; 1785 1930 static int type_init = 0; 1786 1931 if (!type_init) { 1787 1932 const PyTypeObject tmp 1788 1933 = { 1934 /* PyObject header changed in Python 3 */ 1935 #if PY_VERSION_HEX>=0x03000000 1936 PyVarObject_HEAD_INIT(&PyType_Type, 0) 1937 #else 1789 1938 PyObject_HEAD_INIT(NULL) 1790 0, /* ob_size */ 1791 (char *)"PySwigPacked", /* tp_name */ 1792 sizeof(PySwigPacked), /* tp_basicsize */ 1939 0, /* ob_size */ 1940 #endif 1941 (char *)"SwigPyPacked", /* tp_name */ 1942 sizeof(SwigPyPacked), /* tp_basicsize */ 1793 1943 0, /* tp_itemsize */ 1794 (destructor) PySwigPacked_dealloc, /* tp_dealloc */1795 (printfunc) PySwigPacked_print, /* tp_print */1944 (destructor)SwigPyPacked_dealloc, /* tp_dealloc */ 1945 (printfunc)SwigPyPacked_print, /* tp_print */ 1796 1946 (getattrfunc)0, /* tp_getattr */ 1797 1947 (setattrfunc)0, /* tp_setattr */ 1798 (cmpfunc)PySwigPacked_compare, /* tp_compare */ 1799 (reprfunc)PySwigPacked_repr, /* tp_repr */ 1800 0, /* tp_as_number */ 1948 #if PY_VERSION_HEX>=0x03000000 1949 0, /* tp_reserved in 3.0.1 */ 1950 #else 1951 (cmpfunc)SwigPyPacked_compare, /* tp_compare */ 1952 #endif 1953 (reprfunc)SwigPyPacked_repr, /* tp_repr */ 1954 0, /* tp_as_number */ 1801 1955 0, /* tp_as_sequence */ 1802 0, /* tp_as_mapping */ 1803 (hashfunc)0, /* tp_hash */ 1804 (ternaryfunc)0, /* tp_call */ 1805 (reprfunc) PySwigPacked_str, /* tp_str */1956 0, /* tp_as_mapping */ 1957 (hashfunc)0, /* tp_hash */ 1958 (ternaryfunc)0, /* tp_call */ 1959 (reprfunc)SwigPyPacked_str, /* tp_str */ 1806 1960 PyObject_GenericGetAttr, /* tp_getattro */ 1807 1961 0, /* tp_setattro */ … … 1842 1996 #endif 1843 1997 }; 1844 pyswigpacked_type = tmp; 1845 pyswigpacked_type.ob_type = &PyType_Type; 1998 swigpypacked_type = tmp; 1999 /* for Python 3 the ob_type already assigned in PyVarObject_HEAD_INIT() */ 2000 #if PY_VERSION_HEX < 0x03000000 2001 swigpypacked_type.ob_type = &PyType_Type; 2002 #endif 1846 2003 type_init = 1; 1847 2004 } 1848 return & pyswigpacked_type;2005 return &swigpypacked_type; 1849 2006 } 1850 2007 1851 2008 SWIGRUNTIME PyObject * 1852 PySwigPacked_New(void *ptr, size_t size, swig_type_info *ty)2009 SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty) 1853 2010 { 1854 PySwigPacked *sobj = PyObject_NEW(PySwigPacked, PySwigPacked_type());2011 SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type()); 1855 2012 if (sobj) { 1856 2013 void *pack = malloc(size); … … 1869 2026 1870 2027 SWIGRUNTIME swig_type_info * 1871 PySwigPacked_UnpackData(PyObject *obj, void *ptr, size_t size)2028 SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size) 1872 2029 { 1873 if ( PySwigPacked_Check(obj)) {1874 PySwigPacked *sobj = (PySwigPacked *)obj;2030 if (SwigPyPacked_Check(obj)) { 2031 SwigPyPacked *sobj = (SwigPyPacked *)obj; 1875 2032 if (sobj->size != size) return 0; 1876 2033 memcpy(ptr, sobj->pack, size); … … 1888 2045 _SWIG_This(void) 1889 2046 { 1890 return PyString_FromString("this");2047 return SWIG_Python_str_FromChar("this"); 1891 2048 } 1892 2049 … … 1900 2057 /* #define SWIG_PYTHON_SLOW_GETSET_THIS */ 1901 2058 1902 SWIGRUNTIME PySwigObject * 2059 /* TODO: I don't know how to implement the fast getset in Python 3 right now */ 2060 #if PY_VERSION_HEX>=0x03000000 2061 #define SWIG_PYTHON_SLOW_GETSET_THIS 2062 #endif 2063 2064 SWIGRUNTIME SwigPyObject * 1903 2065 SWIG_Python_GetSwigThis(PyObject *pyobj) 1904 2066 { 1905 if ( PySwigObject_Check(pyobj)) {1906 return ( PySwigObject *) pyobj;2067 if (SwigPyObject_Check(pyobj)) { 2068 return (SwigPyObject *) pyobj; 1907 2069 } else { 1908 2070 PyObject *obj = 0; … … 1940 2102 } 1941 2103 #endif 1942 if (obj && ! PySwigObject_Check(obj)) {2104 if (obj && !SwigPyObject_Check(obj)) { 1943 2105 /* a PyObject is called 'this', try to get the 'real this' 1944 PySwigObject from it */2106 SwigPyObject from it */ 1945 2107 return SWIG_Python_GetSwigThis(obj); 1946 2108 } 1947 return ( PySwigObject *)obj;2109 return (SwigPyObject *)obj; 1948 2110 } 1949 2111 } … … 1954 2116 SWIG_Python_AcquirePtr(PyObject *obj, int own) { 1955 2117 if (own == SWIG_POINTER_OWN) { 1956 PySwigObject *sobj = SWIG_Python_GetSwigThis(obj);2118 SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj); 1957 2119 if (sobj) { 1958 2120 int oldown = sobj->own; … … 1973 2135 return SWIG_OK; 1974 2136 } else { 1975 PySwigObject *sobj = SWIG_Python_GetSwigThis(obj);2137 SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj); 1976 2138 if (own) 1977 2139 *own = 0; … … 1987 2149 swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); 1988 2150 if (!tc) { 1989 sobj = ( PySwigObject *)sobj->next;2151 sobj = (SwigPyObject *)sobj->next; 1990 2152 } else { 1991 2153 if (ptr) { … … 2016 2178 int res = SWIG_ERROR; 2017 2179 if (flags & SWIG_POINTER_IMPLICIT_CONV) { 2018 PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0;2180 SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; 2019 2181 if (data && !data->implicitconv) { 2020 2182 PyObject *klass = data->klass; … … 2029 2191 } 2030 2192 if (impconv) { 2031 PySwigObject *iobj = SWIG_Python_GetSwigThis(impconv);2193 SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv); 2032 2194 if (iobj) { 2033 2195 void *vptr; … … 2067 2229 const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); 2068 2230 const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0; 2069 if (desc) {2231 if (desc) 2070 2232 desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0; 2071 if (!desc) return SWIG_ERROR;2072 }2233 if (!desc) 2234 return SWIG_ERROR; 2073 2235 if (ty) { 2074 2236 swig_cast_info *tc = SWIG_TypeCheck(desc,ty); … … 2091 2253 SWIGRUNTIME int 2092 2254 SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) { 2093 swig_type_info *to = PySwigPacked_UnpackData(obj, ptr, sz);2255 swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz); 2094 2256 if (!to) return SWIG_ERROR; 2095 2257 if (ty) { … … 2108 2270 2109 2271 /* 2110 Create a new instance object, w hitout calling __init__, and set the2272 Create a new instance object, without calling __init__, and set the 2111 2273 'this' attribute. 2112 2274 */ 2113 2275 2114 2276 SWIGRUNTIME PyObject* 2115 SWIG_Python_NewShadowInstance( PySwigClientData *data, PyObject *swig_this)2277 SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) 2116 2278 { 2117 2279 #if (PY_VERSION_HEX >= 0x02020000) … … 2137 2299 } 2138 2300 } else { 2301 #if PY_VERSION_HEX >= 0x03000000 2302 inst = PyBaseObject_Type.tp_new((PyTypeObject*) data->newargs, Py_None, Py_None); 2303 PyObject_SetAttr(inst, SWIG_This(), swig_this); 2304 Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG; 2305 #else 2139 2306 PyObject *dict = PyDict_New(); 2140 2307 PyDict_SetItem(dict, SWIG_This(), swig_this); 2141 2308 inst = PyInstance_NewRaw(data->newargs, dict); 2142 2309 Py_DECREF(dict); 2310 #endif 2143 2311 } 2144 2312 return inst; … … 2203 2371 return NULL; 2204 2372 } else { 2205 PySwigObject *sthis = SWIG_Python_GetSwigThis(obj[0]);2373 SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]); 2206 2374 if (sthis) { 2207 PySwigObject_append((PyObject*) sthis, obj[1]);2375 SwigPyObject_append((PyObject*) sthis, obj[1]); 2208 2376 } else { 2209 2377 SWIG_Python_SetSwigThis(obj[0], obj[1]); … … 2221 2389 } else { 2222 2390 int own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0; 2223 PyObject *robj = PySwigObject_New(ptr, type, own);2224 PySwigClientData *clientdata = type ? (PySwigClientData *)(type->clientdata) : 0;2391 PyObject *robj = SwigPyObject_New(ptr, type, own); 2392 SwigPyClientData *clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0; 2225 2393 if (clientdata && !(flags & SWIG_POINTER_NOSHADOW)) { 2226 2394 PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj); … … 2238 2406 SWIGRUNTIMEINLINE PyObject * 2239 2407 SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) { 2240 return ptr ? PySwigPacked_New((void *) ptr, sz, type) : SWIG_Py_Void();2408 return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void(); 2241 2409 } 2242 2410 … … 2309 2477 swig_type_info *ty = types[i]; 2310 2478 if (ty->owndata) { 2311 PySwigClientData *data = (PySwigClientData *) ty->clientdata;2312 if (data) PySwigClientData_Del(data);2479 SwigPyClientData *data = (SwigPyClientData *) ty->clientdata; 2480 if (data) SwigPyClientData_Del(data); 2313 2481 } 2314 2482 } … … 2320 2488 static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} };/* Sentinel */ 2321 2489 2490 #if PY_VERSION_HEX >= 0x03000000 2491 /* Add a dummy module object into sys.modules */ 2492 PyObject *module = PyImport_AddModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION); 2493 #else 2322 2494 PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, 2323 2495 swig_empty_runtime_method_table); 2496 #endif 2324 2497 PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule); 2325 2498 if (pointer && module) { … … 2341 2514 { 2342 2515 PyObject *cache = SWIG_Python_TypeCache(); 2343 PyObject *key = PyString_FromString(type);2516 PyObject *key = SWIG_Python_str_FromChar(type); 2344 2517 PyObject *obj = PyDict_GetItem(cache, key); 2345 2518 swig_type_info *descriptor; … … 2368 2541 SWIGRUNTIME int 2369 2542 SWIG_Python_AddErrMesg(const char* mesg, int infront) 2370 { 2543 { 2371 2544 if (PyErr_Occurred()) { 2372 2545 PyObject *type = 0; … … 2375 2548 PyErr_Fetch(&type, &value, &traceback); 2376 2549 if (value) { 2550 char *tmp; 2377 2551 PyObject *old_str = PyObject_Str(value); 2378 2552 Py_XINCREF(type); 2379 2553 PyErr_Clear(); 2380 2554 if (infront) { 2381 PyErr_Format(type, "%s %s", mesg, PyString_AsString(old_str));2555 PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str)); 2382 2556 } else { 2383 PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg);2557 PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); 2384 2558 } 2559 SWIG_Python_str_DelForPy3(tmp); 2385 2560 Py_DECREF(old_str); 2386 2561 } … … 2405 2580 2406 2581 SWIGRUNTIMEINLINE const char * 2407 PySwigObject_GetDesc(PyObject *self)2582 SwigPyObject_GetDesc(PyObject *self) 2408 2583 { 2409 PySwigObject *v = (PySwigObject *)self;2584 SwigPyObject *v = (SwigPyObject *)self; 2410 2585 swig_type_info *ty = v ? v->ty : 0; 2411 2586 return ty ? ty->str : (char*)""; … … 2417 2592 if (type) { 2418 2593 #if defined(SWIG_COBJECT_TYPES) 2419 if (obj && PySwigObject_Check(obj)) {2420 const char *otype = (const char *) PySwigObject_GetDesc(obj);2594 if (obj && SwigPyObject_Check(obj)) { 2595 const char *otype = (const char *) SwigPyObject_GetDesc(obj); 2421 2596 if (otype) { 2422 PyErr_Format(PyExc_TypeError, "a '%s' is expected, ' PySwigObject(%s)' is received",2597 PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received", 2423 2598 type, otype); 2424 2599 return; … … 2430 2605 if (otype) { 2431 2606 PyObject *str = PyObject_Str(obj); 2432 const char *cstr = str ? PyString_AsString(str) : 0;2607 const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0; 2433 2608 if (cstr) { 2434 2609 PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received", 2435 2610 type, otype, cstr); 2611 SWIG_Python_str_DelForPy3(cstr); 2436 2612 } else { 2437 2613 PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", … … 2455 2631 if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) { 2456 2632 PyErr_Clear(); 2457 if (flags & SWIG_POINTER_EXCEPTION) { 2633 #if SWIG_POINTER_EXCEPTION 2634 if (flags) { 2458 2635 SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj); 2459 2636 SWIG_Python_ArgFail(argnum); 2460 2637 } 2638 #endif 2461 2639 } 2462 2640 return result; … … 2504 2682 @(target):= _pbs.so 2505 2683 ------------------------------------------------*/ 2506 #define SWIG_init init_pbs 2507 2684 #if PY_VERSION_HEX >= 0x03000000 2685 # define SWIG_init PyInit__pbs 2686 2687 #else 2688 # define SWIG_init init_pbs 2689 2690 #endif 2508 2691 #define SWIG_name "_pbs" 2509 2692 2510 #define SWIGVERSION 0x0103 362693 #define SWIGVERSION 0x010340 2511 2694 #define SWIG_VERSION SWIGVERSION 2512 2695 … … 2820 3003 SWIG_NewPointerObj((char *)(carray), pchar_descriptor, 0) : SWIG_Py_Void(); 2821 3004 } else { 3005 #if PY_VERSION_HEX >= 0x03000000 3006 return PyUnicode_FromStringAndSize(carray, (int)(size)); 3007 #else 2822 3008 return PyString_FromStringAndSize(carray, (int)(size)); 3009 #endif 2823 3010 } 2824 3011 } else { … … 2838 3025 SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) 2839 3026 { 2840 if (PyString_Check(obj)) { 3027 #if PY_VERSION_HEX>=0x03000000 3028 if (PyUnicode_Check(obj)) 3029 #else 3030 if (PyString_Check(obj)) 3031 #endif 3032 { 2841 3033 char *cstr; Py_ssize_t len; 3034 #if PY_VERSION_HEX>=0x03000000 3035 if (!alloc && cptr) { 3036 /* We can't allow converting without allocation, since the internal 3037 representation of string in Python 3 is UCS-2/UCS-4 but we require 3038 a UTF-8 representation. 3039 TODO(bhy) More detailed explanation */ 3040 return SWIG_RuntimeError; 3041 } 3042 obj = PyUnicode_AsUTF8String(obj); 3043 PyBytes_AsStringAndSize(obj, &cstr, &len); 3044 if(alloc) *alloc = SWIG_NEWOBJ; 3045 #else 2842 3046 PyString_AsStringAndSize(obj, &cstr, &len); 2843 if (cptr) { 3047 #endif 3048 if (cptr) { 2844 3049 if (alloc) { 2845 3050 /* … … 2866 3071 } 2867 3072 } else { 2868 *cptr = PyString_AsString(obj); 3073 #if PY_VERSION_HEX>=0x03000000 3074 assert(0); /* Should never reach here in Python 3 */ 3075 #endif 3076 *cptr = SWIG_Python_str_AsChar(obj); 2869 3077 } 2870 3078 } 2871 3079 if (psize) *psize = len + 1; 3080 #if PY_VERSION_HEX>=0x03000000 3081 Py_XDECREF(obj); 3082 #endif 2872 3083 return SWIG_OK; 2873 3084 } else { … … 7458 7669 7459 7670 static PyMethodDef SwigMethods[] = { 7671 { (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL}, 7460 7672 { (char *)"new_attrl", _wrap_new_attrl, METH_VARARGS, NULL}, 7461 7673 { (char *)"new_attropl", _wrap_new_attropl, METH_VARARGS, NULL}, … … 7874 8086 SWIGINTERN PyObject * 7875 8087 swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) { 8088 #if PY_VERSION_HEX >= 0x03000000 8089 return PyUnicode_InternFromString("<Swig global variables>"); 8090 #else 7876 8091 return PyString_FromString("<Swig global variables>"); 8092 #endif 7877 8093 } 7878 8094 7879 8095 SWIGINTERN PyObject * 7880 8096 swig_varlink_str(swig_varlinkobject *v) { 8097 #if PY_VERSION_HEX >= 0x03000000 8098 PyObject *str = PyUnicode_InternFromString("("); 8099 PyObject *tail; 8100 PyObject *joined; 8101 swig_globalvar *var; 8102 for (var = v->vars; var; var=var->next) { 8103 tail = PyUnicode_FromString(var->name); 8104 joined = PyUnicode_Concat(str, tail); 8105 Py_DecRef(str); 8106 Py_DecRef(tail); 8107 str = joined; 8108 if (var->next) { 8109 tail = PyUnicode_InternFromString(", "); 8110 joined = PyUnicode_Concat(str, tail); 8111 Py_DecRef(str); 8112 Py_DecRef(tail); 8113 str = joined; 8114 } 8115 } 8116 tail = PyUnicode_InternFromString(")"); 8117 joined = PyUnicode_Concat(str, tail); 8118 Py_DecRef(str); 8119 Py_DecRef(tail); 8120 str = joined; 8121 #else 7881 8122 PyObject *str = PyString_FromString("("); 7882 swig_globalvar 8123 swig_globalvar *var; 7883 8124 for (var = v->vars; var; var=var->next) { 7884 8125 PyString_ConcatAndDel(&str,PyString_FromString(var->name)); … … 7886 8127 } 7887 8128 PyString_ConcatAndDel(&str,PyString_FromString(")")); 8129 #endif 7888 8130 return str; 7889 8131 } … … 7891 8133 SWIGINTERN int 7892 8134 swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { 8135 char *tmp; 7893 8136 PyObject *str = swig_varlink_str(v); 7894 8137 fprintf(fp,"Swig global variables "); 7895 fprintf(fp,"%s\n", PyString_AsString(str)); 8138 fprintf(fp,"%s\n", tmp = SWIG_Python_str_AsChar(str)); 8139 SWIG_Python_str_DelForPy3(tmp); 7896 8140 Py_DECREF(str); 7897 8141 return 0; … … 7951 8195 const PyTypeObject tmp 7952 8196 = { 8197 /* PyObject header changed in Python 3 */ 8198 #if PY_VERSION_HEX >= 0x03000000 8199 PyVarObject_HEAD_INIT(&PyType_Type, 0) 8200 #else 7953 8201 PyObject_HEAD_INIT(NULL) 7954 8202 0, /* Number of items in variable part (ob_size) */ 8203 #endif 7955 8204 (char *)"swigvarlink", /* Type name (tp_name) */ 7956 8205 sizeof(swig_varlinkobject), /* Basic size (tp_basicsize) */ 7957 8206 0, /* Itemsize (tp_itemsize) */ 7958 (destructor) swig_varlink_dealloc, 8207 (destructor) swig_varlink_dealloc, /* Deallocator (tp_dealloc) */ 7959 8208 (printfunc) swig_varlink_print, /* Print (tp_print) */ 7960 8209 (getattrfunc) swig_varlink_getattr, /* get attr (tp_getattr) */ … … 7967 8216 0, /* tp_hash */ 7968 8217 0, /* tp_call */ 7969 (reprfunc) swig_varlink_str, /* tp_str */8218 (reprfunc) swig_varlink_str, /* tp_str */ 7970 8219 0, /* tp_getattro */ 7971 8220 0, /* tp_setattro */ … … 7988 8237 }; 7989 8238 varlink_type = tmp; 8239 /* for Python 3 we already assigned ob_type in PyVarObject_HEAD_INIT() */ 8240 #if PY_VERSION_HEX < 0x03000000 7990 8241 varlink_type.ob_type = &PyType_Type; 8242 #endif 7991 8243 type_init = 1; 7992 8244 } … … 8113 8365 extern "C" 8114 8366 #endif 8115 SWIGEXPORT void SWIG_init(void) { 8116 PyObject *m, *d; 8367 8368 SWIGEXPORT 8369 #if PY_VERSION_HEX >= 0x03000000 8370 PyObject* 8371 #else 8372 void 8373 #endif 8374 SWIG_init(void) { 8375 PyObject *m, *d; 8376 #if PY_VERSION_HEX >= 0x03000000 8377 static struct PyModuleDef SWIG_module = { 8378 PyModuleDef_HEAD_INIT, 8379 (char *) SWIG_name, 8380 NULL, 8381 -1, 8382 SwigMethods, 8383 NULL, 8384 NULL, 8385 NULL, 8386 NULL 8387 }; 8388 #endif 8117 8389 8118 8390 /* Fix SwigMethods to carry the callback ptrs when needed */ 8119 8391 SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial); 8120 8392 8393 #if PY_VERSION_HEX >= 0x03000000 8394 m = PyModule_Create(&SWIG_module); 8395 #else 8121 8396 m = Py_InitModule((char *) SWIG_name, SwigMethods); 8397 #endif 8122 8398 d = PyModule_GetDict(m); 8123 8399 … … 8433 8709 SWIG_Python_SetConstant(d, "FALSE",SWIG_From_int((int)(0))); 8434 8710 SWIG_addvarlink(SWIG_globals(),(char*)"msg_daemonname",Swig_var_msg_daemonname_get, Swig_var_msg_daemonname_set); 8435 } 8436 8711 #if PY_VERSION_HEX >= 0x03000000 8712 return m; 8713 #else 8714 return; 8715 #endif 8716 } 8717
Note: See TracChangeset
for help on using the changeset viewer.