Changeset 335 for devel/5.X/pbs.i


Ignore:
Timestamp:
03/10/15 11:46:37 (9 years ago)
Author:
bas
Message:

finally version of pbs_python to 5.X, still no working rm interface

File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/5.X/pbs.i

    r331 r335  
    2323#include "log.h"
    2424
    25 #define SARA_DEBUG 1
    26 
    27 //extern int pbs_errno;
     25#define SARA_DEBUG 0
    2826
    2927%}
     
    4442  int                   i=0, size=0;
    4543
    46   // printf("Python --> C\n");
    47 
    48   if (SARA_DEBUG) printf("Converteren python -> c (struct batch_status *):\n");
     44  if (SARA_DEBUG) printf("Convert python -> c (struct batch_status *):\n");
    4945
    5046  size = Get_List_Size($input);
     
    104100  // printf("Python --> C\n");
    105101
    106   if (SARA_DEBUG) printf("Converteren python -> c (struct attrl *):\n");
     102  if (SARA_DEBUG) printf("Convert python -> c (struct attrl *):\n");
    107103
    108104  size = Get_List_Size($input);
     
    125121      return NULL;
    126122
    127       // This will skipp the wrong entry
     123      // This will skip the wrong entry
    128124      // continue;
    129125    }
     
    145141
    146142  } // end for
     143
    147144  if (SARA_DEBUG) printf("\t</Contents>\n");
    148145} // end struct attrl *IN typemap
     
    159156  // printf("Python --> C\n");
    160157
    161   if (SARA_DEBUG) printf("Converteren python -> c (struct attropl *):\n");
     158  if (SARA_DEBUG) printf("Convert python -> c (struct attropl *):\n");
    162159
    163160  size = Get_List_Size($input);
     
    244241
    245242  PyObject              *obj_batch;
    246   struct batch_status   *ptr;
     243  struct batch_status   *ptr, *org;
    247244  int                   i=0, len=0;
    248245
    249   // printf("Ja we are in bussniss\n");
    250   if (SARA_DEBUG) printf("Converteren c (struct batch_status *) -> python:\n");
     246  if (SARA_DEBUG) printf("Convert c (struct batch_status *) -> python:\n");
    251247 
    252248  // Deterime length of list
    253249  //
    254   ptr = $1;
     250  org = $1;
     251  ptr = org;
    255252  while (ptr != NULL) {
    256253    len++;
     
    274271  }
    275272
    276   free(ptr);
    277273  if (SARA_DEBUG) printf("\t</Contents>\n");
    278274} // end typemap struct batch_status *
     
    283279  int           i=0, len=0;
    284280
    285   if (SARA_DEBUG) printf("Converteren c (struct attrl *) -> python:\n");
     281  if (SARA_DEBUG) printf("Convert c (struct attrl *) -> python:\n");
    286282
    287283  ptr = $1;
     
    302298    ptr = ptr->next;
    303299  }
    304 
    305   free(ptr);
    306300  if (SARA_DEBUG) printf("\t</Contents>\n");
    307301} // end typemap struct attrl *
     
    312306  int               i=0, len=0;
    313307
    314   if (SARA_DEBUG) printf("Converteren c (struct attropl *) -> python:\n");
     308  if (SARA_DEBUG) printf("Convert c (struct attropl *) -> python:\n");
    315309 
    316310  ptr = $1;
     
    330324  }
    331325
    332   free(ptr);
    333326  if (SARA_DEBUG) printf("\t</Contents>\n");
    334327} // end typemap struct attropl *
     
    340333
    341334   if (SARA_DEBUG)
    342      printf("Converteren char ** -> python list\n");
     335     printf("Convert char ** -> python list\n");
    343336
    344337
     
    513506//
    514507%nodefault;
    515 // %include "pbs_python.h"
     508
     509
    516510%include "pbs_ifl.h"
    517511%include "rm.h"
    518512%include "log.h"
    519513%include "pbs_error.h"
    520 
    521 
    522 // Iets van uhhh..... obsolete
    523 // %ignore pbs_errno;
    524 //%include <pbs_error.h>
    525 
    526 
    527 /*
    528 %feature("shadow") attrl::__str__ {
    529   def __str__(self): print self.name + self.value;
    530 }
    531 %extend attrl {
    532   void __str__();
    533 }
    534 */
    535514
    536515/* not used
     
    561540       printf("Bas free attrl\n");
    562541
    563     /*
    564         free(self);
    565     */
     542    // free(self);
    566543  }
    567544}
     
    584561       printf("Bas free attropl\n");
    585562
    586     /*
    587         free(self);
    588     */
     563    // free(self);
    589564  }
    590565}
Note: See TracChangeset for help on using the changeset viewer.