~ecryptfs/ecryptfs/trunk

« back to all changes in this revision

Viewing changes to src/libecryptfs-swig/libecryptfs_wrap.c

  • Committer: Dustin Kirkland
  • Date: 2009-07-17 05:32:26 UTC
  • Revision ID: kirkland@canonical.com-20090717053226-5r04floeb2ocuq4p
  * README, configure.ac, debian/control, debian/rules,
    doc/sourceforge_webpage/README, src/libecryptfs-swig/libecryptfs.py,
    src/libecryptfs-swig/libecryptfs_wrap.c,
    src/libecryptfs/key_management.c, src/libecryptfs/libecryptfs.pc.in,
    src/libecryptfs/main.c, src/pam_ecryptfs/Makefile.am,
    src/utils/manager.c, src/utils/mount.ecryptfs.c: move build from gcrypt
    to nss (this change has been pending for some time)


Signed-off-by: Dustin Kirkland <kirkland@canonical.com>

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* ----------------------------------------------------------------------------
2
2
 * This file was automatically generated by SWIG (http://www.swig.org).
3
 
 * Version 1.3.31
 
3
 * Version 1.3.36
4
4
 * 
5
5
 * This file is not intended to be easily readable and contains a number of 
6
6
 * coding conventions designed to improve portability and efficiency. Do not make
17
17
 
18
18
/* template workaround for compilers that cannot correctly implement the C++ standard */
19
19
#ifndef SWIGTEMPLATEDISAMBIGUATOR
20
 
# if defined(__SUNPRO_CC)
21
 
#   if (__SUNPRO_CC <= 0x560)
22
 
#     define SWIGTEMPLATEDISAMBIGUATOR template
23
 
#   else
24
 
#     define SWIGTEMPLATEDISAMBIGUATOR 
25
 
#   endif
 
20
# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
 
21
#  define SWIGTEMPLATEDISAMBIGUATOR template
 
22
# elif defined(__HP_aCC)
 
23
/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
 
24
/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
 
25
#  define SWIGTEMPLATEDISAMBIGUATOR template
26
26
# else
27
 
#   define SWIGTEMPLATEDISAMBIGUATOR 
 
27
#  define SWIGTEMPLATEDISAMBIGUATOR
28
28
# endif
29
29
#endif
30
30
 
52
52
# endif
53
53
#endif
54
54
 
 
55
#ifndef SWIG_MSC_UNSUPPRESS_4505
 
56
# if defined(_MSC_VER)
 
57
#   pragma warning(disable : 4505) /* unreferenced local function has been removed */
 
58
# endif 
 
59
#endif
 
60
 
55
61
#ifndef SWIGUNUSEDPARM
56
62
# ifdef __cplusplus
57
63
#   define SWIGUNUSEDPARM(p)
107
113
# define _CRT_SECURE_NO_DEPRECATE
108
114
#endif
109
115
 
 
116
/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
 
117
#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
 
118
# define _SCL_SECURE_NO_DEPRECATE
 
119
#endif
 
120
 
 
121
 
110
122
 
111
123
/* Python.h has to appear first */
112
124
#include <Python.h>
120
132
 
121
133
/* This should only be incremented when either the layout of swig_type_info changes,
122
134
   or for whatever reason, the runtime changes incompatibly */
123
 
#define SWIG_RUNTIME_VERSION "3"
 
135
#define SWIG_RUNTIME_VERSION "4"
124
136
 
125
137
/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
126
138
#ifdef SWIG_TYPE_TABLE
155
167
 
156
168
/* Flags for pointer conversions */
157
169
#define SWIG_POINTER_DISOWN        0x1
 
170
#define SWIG_CAST_NEW_MEMORY       0x2
158
171
 
159
172
/* Flags for new pointer objects */
160
173
#define SWIG_POINTER_OWN           0x1
295
308
extern "C" {
296
309
#endif
297
310
 
298
 
typedef void *(*swig_converter_func)(void *);
 
311
typedef void *(*swig_converter_func)(void *, int *);
299
312
typedef struct swig_type_info *(*swig_dycast_func)(void **);
300
313
 
301
 
/* Structure to store inforomation on one type */
 
314
/* Structure to store information on one type */
302
315
typedef struct swig_type_info {
303
316
  const char             *name;                 /* mangled name of this type */
304
317
  const char             *str;                  /* human readable name of this type */
343
356
    while ((*f2 == ' ') && (f2 != l2)) ++f2;
344
357
    if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
345
358
  }
346
 
  return (l1 - f1) - (l2 - f2);
 
359
  return (int)((l1 - f1) - (l2 - f2));
347
360
}
348
361
 
349
362
/*
425
438
  Cast a pointer up an inheritance hierarchy
426
439
*/
427
440
SWIGRUNTIMEINLINE void *
428
 
SWIG_TypeCast(swig_cast_info *ty, void *ptr) {
429
 
  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr);
 
441
SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
 
442
  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
430
443
}
431
444
 
432
445
/* 
850
863
    Py_DECREF(old_str);
851
864
    Py_DECREF(value);
852
865
  } else {
853
 
    PyErr_Format(PyExc_RuntimeError, mesg);
 
866
    PyErr_SetString(PyExc_RuntimeError, mesg);
854
867
  }
855
868
}
856
869
 
1090
1103
/* Unpack the argument tuple */
1091
1104
 
1092
1105
SWIGINTERN int
1093
 
SWIG_Python_UnpackTuple(PyObject *args, const char *name, int min, int max, PyObject **objs)
 
1106
SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs)
1094
1107
{
1095
1108
  if (!args) {
1096
1109
    if (!min && !max) {
1097
1110
      return 1;
1098
1111
    } else {
1099
1112
      PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none", 
1100
 
                   name, (min == max ? "" : "at least "), min);
 
1113
                   name, (min == max ? "" : "at least "), (int)min);
1101
1114
      return 0;
1102
1115
    }
1103
1116
  }  
1105
1118
    PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple");
1106
1119
    return 0;
1107
1120
  } else {
1108
 
    register int l = PyTuple_GET_SIZE(args);
 
1121
    register Py_ssize_t l = PyTuple_GET_SIZE(args);
1109
1122
    if (l < min) {
1110
1123
      PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", 
1111
 
                   name, (min == max ? "" : "at least "), min, l);
 
1124
                   name, (min == max ? "" : "at least "), (int)min, (int)l);
1112
1125
      return 0;
1113
1126
    } else if (l > max) {
1114
1127
      PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", 
1115
 
                   name, (min == max ? "" : "at most "), max, l);
 
1128
                   name, (min == max ? "" : "at most "), (int)max, (int)l);
1116
1129
      return 0;
1117
1130
    } else {
1118
1131
      register int i;
1410
1423
{
1411
1424
  PySwigObject *sobj = (PySwigObject *) v;
1412
1425
  PyObject *next = sobj->next;
1413
 
  if (sobj->own) {
 
1426
  if (sobj->own == SWIG_POINTER_OWN) {
1414
1427
    swig_type_info *ty = sobj->ty;
1415
1428
    PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0;
1416
1429
    PyObject *destroy = data ? data->destroy : 0;
1428
1441
        res = ((*meth)(mself, v));
1429
1442
      }
1430
1443
      Py_XDECREF(res);
1431
 
    } else {
 
1444
    } 
 
1445
#if !defined(SWIG_PYTHON_SILENT_MEMLEAK)
 
1446
    else {
1432
1447
      const char *name = SWIG_TypePrettyName(ty);
1433
 
#if !defined(SWIG_PYTHON_SILENT_MEMLEAK)
1434
 
      printf("swig/python detected a memory leak of type '%s', no destructor found.\n", name);
 
1448
      printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown"));
 
1449
    }
1435
1450
#endif
1436
 
    }
1437
1451
  } 
1438
1452
  Py_XDECREF(next);
1439
1453
  PyObject_DEL(v);
1591
1605
    (unaryfunc)0,                 /*nb_float*/
1592
1606
    (unaryfunc)PySwigObject_oct,  /*nb_oct*/
1593
1607
    (unaryfunc)PySwigObject_hex,  /*nb_hex*/
1594
 
#if PY_VERSION_HEX >= 0x02020000
1595
 
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */ 
1596
 
#elif PY_VERSION_HEX >= 0x02000000
 
1608
#if PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */
 
1609
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */
 
1610
#elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */
 
1611
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */
 
1612
#elif PY_VERSION_HEX >= 0x02000000 /* 2.0.0 */
1597
1613
    0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_or */
1598
1614
#endif
1599
1615
  };
1936
1952
 
1937
1953
SWIGRUNTIME int
1938
1954
SWIG_Python_AcquirePtr(PyObject *obj, int own) {
1939
 
  if (own) {
 
1955
  if (own == SWIG_POINTER_OWN) {
1940
1956
    PySwigObject *sobj = SWIG_Python_GetSwigThis(obj);
1941
1957
    if (sobj) {
1942
1958
      int oldown = sobj->own;
1957
1973
    return SWIG_OK;
1958
1974
  } else {
1959
1975
    PySwigObject *sobj = SWIG_Python_GetSwigThis(obj);
 
1976
    if (own)
 
1977
      *own = 0;
1960
1978
    while (sobj) {
1961
1979
      void *vptr = sobj->ptr;
1962
1980
      if (ty) {
1970
1988
          if (!tc) {
1971
1989
            sobj = (PySwigObject *)sobj->next;
1972
1990
          } else {
1973
 
            if (ptr) *ptr = SWIG_TypeCast(tc,vptr);
 
1991
            if (ptr) {
 
1992
              int newmemory = 0;
 
1993
              *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
 
1994
              if (newmemory == SWIG_CAST_NEW_MEMORY) {
 
1995
                assert(own);
 
1996
                if (own)
 
1997
                  *own = *own | SWIG_CAST_NEW_MEMORY;
 
1998
              }
 
1999
            }
1974
2000
            break;
1975
2001
          }
1976
2002
        }
1980
2006
      }
1981
2007
    }
1982
2008
    if (sobj) {
1983
 
      if (own) *own = sobj->own;
 
2009
      if (own)
 
2010
        *own = *own | sobj->own;
1984
2011
      if (flags & SWIG_POINTER_DISOWN) {
1985
2012
        sobj->own = 0;
1986
2013
      }
2045
2072
    }
2046
2073
    if (ty) {
2047
2074
      swig_cast_info *tc = SWIG_TypeCheck(desc,ty);
2048
 
      if (!tc) return SWIG_ERROR;
2049
 
      *ptr = SWIG_TypeCast(tc,vptr);
 
2075
      if (tc) {
 
2076
        int newmemory = 0;
 
2077
        *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
 
2078
        assert(!newmemory); /* newmemory handling not yet implemented */
 
2079
      } else {
 
2080
        return SWIG_ERROR;
 
2081
      }
2050
2082
    } else {
2051
2083
      *ptr = vptr;
2052
2084
    }
2469
2501
 
2470
2502
#define SWIG_name    "_libecryptfs"
2471
2503
 
2472
 
#define SWIGVERSION 0x010331 
 
2504
#define SWIGVERSION 0x010336 
2473
2505
#define SWIG_VERSION SWIGVERSION
2474
2506
 
2475
2507
 
2567
2599
  PyObject *resultobj = 0;
2568
2600
  char *arg1 = (char *) 0 ;
2569
2601
  char *arg2 = (char *) 0 ;
2570
 
  binary_data result;
2571
2602
  int res1 ;
2572
2603
  char *buf1 = 0 ;
2573
2604
  int alloc1 = 0 ;
2576
2607
  int alloc2 = 0 ;
2577
2608
  PyObject * obj0 = 0 ;
2578
2609
  PyObject * obj1 = 0 ;
 
2610
  binary_data result;
2579
2611
  
2580
2612
  if (!PyArg_ParseTuple(args,(char *)"OO:ecryptfs_passphrase_blob",&obj0,&obj1)) SWIG_fail;
2581
2613
  res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
2590
2622
  arg2 = (char *)(buf2);
2591
2623
  result = ecryptfs_passphrase_blob(arg1,arg2);
2592
2624
  {
2593
 
    resultobj = PyString_FromStringAndSize((char *)(&result)->data,(&result)->size);
 
2625
    resultobj = PyString_FromStringAndSize((&result)->data,(&result)->size);
2594
2626
  }
2595
2627
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
2596
2628
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2605
2637
SWIGINTERN PyObject *_wrap_ecryptfs_passphrase_sig_from_blob(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
2606
2638
  PyObject *resultobj = 0;
2607
2639
  char *arg1 = (char *) 0 ;
2608
 
  binary_data result;
2609
2640
  int res1 ;
2610
2641
  char *buf1 = 0 ;
2611
2642
  int alloc1 = 0 ;
2612
2643
  PyObject * obj0 = 0 ;
 
2644
  binary_data result;
2613
2645
  
2614
2646
  if (!PyArg_ParseTuple(args,(char *)"O:ecryptfs_passphrase_sig_from_blob",&obj0)) SWIG_fail;
2615
2647
  res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
2619
2651
  arg1 = (char *)(buf1);
2620
2652
  result = ecryptfs_passphrase_sig_from_blob(arg1);
2621
2653
  {
2622
 
    resultobj = PyString_FromStringAndSize((char *)(&result)->data,(&result)->size);
 
2654
    resultobj = PyString_FromStringAndSize((&result)->data,(&result)->size);
2623
2655
  }
2624
2656
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
2625
2657
  return resultobj;
2633
2665
  PyObject *resultobj = 0;
2634
2666
  char *arg1 = (char *) 0 ;
2635
2667
  char *arg2 = (char *) 0 ;
 
2668
  int res1 ;
 
2669
  char *buf1 = 0 ;
 
2670
  int alloc1 = 0 ;
 
2671
  int res2 ;
 
2672
  char *buf2 = 0 ;
 
2673
  int alloc2 = 0 ;
 
2674
  PyObject * obj0 = 0 ;
 
2675
  PyObject * obj1 = 0 ;
2636
2676
  int result;
2637
 
  int res1 ;
2638
 
  char *buf1 = 0 ;
2639
 
  int alloc1 = 0 ;
2640
 
  int res2 ;
2641
 
  char *buf2 = 0 ;
2642
 
  int alloc2 = 0 ;
2643
 
  PyObject * obj0 = 0 ;
2644
 
  PyObject * obj1 = 0 ;
2645
2677
  
2646
2678
  if (!PyArg_ParseTuple(args,(char *)"OO:ecryptfs_add_blob_to_keyring",&obj0,&obj1)) SWIG_fail;
2647
2679
  res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
2754
2786
SWIG_InitializeModule(void *clientdata) {
2755
2787
  size_t i;
2756
2788
  swig_module_info *module_head, *iter;
2757
 
  int found;
 
2789
  int found, init;
2758
2790
  
2759
2791
  clientdata = clientdata;
2760
2792
  
2764
2796
    swig_module.type_initial = swig_type_initial;
2765
2797
    swig_module.cast_initial = swig_cast_initial;
2766
2798
    swig_module.next = &swig_module;
 
2799
    init = 1;
 
2800
  } else {
 
2801
    init = 0;
2767
2802
  }
2768
2803
  
2769
2804
  /* Try and load any already created modules */
2792
2827
    module_head->next = &swig_module;
2793
2828
  }
2794
2829
  
 
2830
  /* When multiple interpeters are used, a module could have already been initialized in
 
2831
       a different interpreter, but not yet have a pointer in this interpreter.
 
2832
       In this case, we do not want to continue adding types... everything should be
 
2833
       set up already */
 
2834
  if (init == 0) return;
 
2835
  
2795
2836
  /* Now work on filling in swig_module.types */
2796
2837
#ifdef SWIGRUNTIME_DEBUG
2797
2838
  printf("SWIG_InitializeModule: size %d\n", swig_module.size);