Changeset 331 for devel/5.X/pbs_wrap.c


Ignore:
Timestamp:
03/09/15 23:06:35 (9 years ago)
Author:
bas
Message:

use the standard error file from pbs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/5.X/pbs_wrap.c

    r327 r331  
    29792979#include "log.h"
    29802980
    2981 #define SARA_DEBUG 0
     2981#define SARA_DEBUG 1
    29822982
    29832983//extern int pbs_errno;
     
    30913091int get_error()
    30923092{
    3093    char *errmsg;
    3094 
    3095    errmsg = pbse_to_txt(pbs_errno);
    30963093   if (SARA_DEBUG)
    30973094   {
    3098       printf("Bas = %d\n", pbs_errno);
    3099       printf("Bas = %d, text = %s\n", pbs_errno, errmsg);
     3095      printf("Bas pbs_errno = %d, pbs_strerror %s\n", pbs_errno, pbs_strerror(pbs_errno));
    31003096   }
    31013097   return (pbs_errno);
     
    83758371  if (alloc6 == SWIG_NEWOBJ) free((char*)buf6);
    83768372  return NULL;
     8373}
     8374
     8375
     8376SWIGINTERN PyObject *_wrap_pbse_to_txt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
     8377  PyObject *resultobj = 0;
     8378  int arg1 ;
     8379  int val1 ;
     8380  int ecode1 = 0 ;
     8381  PyObject * obj0 = 0 ;
     8382  char *result = 0 ;
     8383 
     8384  if (!PyArg_ParseTuple(args,(char *)"O:pbse_to_txt",&obj0)) SWIG_fail;
     8385  ecode1 = SWIG_AsVal_int(obj0, &val1);
     8386  if (!SWIG_IsOK(ecode1)) {
     8387    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "pbse_to_txt" "', argument " "1"" of type '" "int""'");
     8388  }
     8389  arg1 = (int)(val1);
     8390  result = (char *)pbse_to_txt(arg1);
     8391  resultobj = SWIG_FromCharPtr((const char *)result);
     8392  return resultobj;
     8393fail:
     8394  return NULL;
     8395}
     8396
     8397
     8398SWIGINTERN PyObject *_wrap_pbs_strerror(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
     8399  PyObject *resultobj = 0;
     8400  int arg1 ;
     8401  int val1 ;
     8402  int ecode1 = 0 ;
     8403  PyObject * obj0 = 0 ;
     8404  char *result = 0 ;
     8405 
     8406  if (!PyArg_ParseTuple(args,(char *)"O:pbs_strerror",&obj0)) SWIG_fail;
     8407  ecode1 = SWIG_AsVal_int(obj0, &val1);
     8408  if (!SWIG_IsOK(ecode1)) {
     8409    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "pbs_strerror" "', argument " "1"" of type '" "int""'");
     8410  }
     8411  arg1 = (int)(val1);
     8412  result = (char *)pbs_strerror(arg1);
     8413  resultobj = SWIG_FromCharPtr((const char *)result);
     8414  return resultobj;
     8415fail:
     8416  return NULL;
     8417}
     8418
     8419
     8420SWIGINTERN int Swig_var_pbs_errno_set(PyObject *_val) {
     8421  {
     8422    int val;
     8423    int res = SWIG_AsVal_int(_val, &val);
     8424    if (!SWIG_IsOK(res)) {
     8425      SWIG_exception_fail(SWIG_ArgError(res), "in variable '""pbs_errno""' of type '""int""'");
     8426    }
     8427    pbs_errno = (int)(val);
     8428  }
     8429  return 0;
     8430fail:
     8431  return 1;
     8432}
     8433
     8434
     8435SWIGINTERN PyObject *Swig_var_pbs_errno_get(void) {
     8436  PyObject *pyobj = 0;
     8437 
     8438  pyobj = SWIG_From_int((int)(pbs_errno));
     8439  return pyobj;
    83778440}
    83788441
     
    84908553         { (char *)"log_init", _wrap_log_init, METH_VARARGS, NULL},
    84918554         { (char *)"chk_file_sec", _wrap_chk_file_sec, METH_VARARGS, NULL},
     8555         { (char *)"pbse_to_txt", _wrap_pbse_to_txt, METH_VARARGS, NULL},
     8556         { (char *)"pbs_strerror", _wrap_pbs_strerror, METH_VARARGS, NULL},
    84928557         { NULL, NULL, 0, NULL }
    84938558};
     
    96409705  SWIG_Python_SetConstant(d, "TRUE",SWIG_From_int((int)(1)));
    96419706  SWIG_Python_SetConstant(d, "FALSE",SWIG_From_int((int)(0)));
     9707  SWIG_Python_SetConstant(d, "PBSE_TOTAL_CEILING",SWIG_From_int((int)(PBSE_TOTAL_CEILING)));
     9708  SWIG_Python_SetConstant(d, "PBSE_",SWIG_From_int((int)(15000)));
     9709  SWIG_Python_SetConstant(d, "PBSE_NONE",SWIG_From_int((int)(0)));
     9710  SWIG_addvarlink(SWIG_globals(),(char*)"pbs_errno",Swig_var_pbs_errno_get, Swig_var_pbs_errno_set);
    96429711#if PY_VERSION_HEX >= 0x03000000
    96439712  return m;
Note: See TracChangeset for help on using the changeset viewer.