~ubuntu-branches/debian/sid/redland-bindings/sid

« back to all changes in this revision

Viewing changes to ruby/redland_wrap.c

  • Committer: Package Import Robot
  • Author(s): Dave Beckett
  • Date: 2013-01-22 16:03:44 UTC
  • mfrom: (0.1.10)
  • Revision ID: package-import@ubuntu.com-20130122160344-vxrnfl0xynfzbze7
Tags: 1.0.16.1-1
* New upstream release
* Add dpkg-buildflags to configure for hardening

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.40
 
3
 * Version 2.0.7
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
281
281
/* 
282
282
   Flags/methods for returning states.
283
283
   
284
 
   The SWIG conversion methods, as ConvertPtr, return and integer 
 
284
   The SWIG conversion methods, as ConvertPtr, return an integer 
285
285
   that tells if the conversion was successful or not. And if not,
286
286
   an error code can be returned (see swigerrors.swg for the codes).
287
287
   
831
831
 
832
832
#include <ruby.h>
833
833
 
 
834
/* Ruby 1.9.1 has a "memoisation optimisation" when compiling with GCC which
 
835
 * breaks using rb_intern as an lvalue, as SWIG does.  We work around this
 
836
 * issue for now by disabling this.
 
837
 * https://sourceforge.net/tracker/?func=detail&aid=2859614&group_id=1645&atid=101645
 
838
 */
 
839
#ifdef rb_intern
 
840
# undef rb_intern
 
841
#endif
 
842
 
834
843
/* Remove global macros defined in Ruby's win32.h */
835
844
#ifdef write
836
845
# undef write
989
998
 
990
999
/* Define custom exceptions for errors that do not map to existing Ruby
991
1000
   exceptions.  Note this only works for C++ since a global cannot be
992
 
   initialized by a funtion in C.  For C, fallback to rb_eRuntimeError.*/
 
1001
   initialized by a function in C.  For C, fallback to rb_eRuntimeError.*/
993
1002
 
994
1003
SWIGINTERN VALUE 
995
1004
getNullReferenceError(void) {
1134
1143
}
1135
1144
 
1136
1145
/* -----------------------------------------------------------------------------
1137
 
 * See the LICENSE file for information on copyright, usage and redistribution
1138
 
 * of SWIG, and the README file for authors - http://www.swig.org/release.html.
1139
 
 *
1140
1146
 * rubytracking.swg
1141
1147
 *
1142
1148
 * This file contains support for tracking mappings from 
1332
1338
 
1333
1339
 
1334
1340
/* -----------------------------------------------------------------------------
1335
 
 * See the LICENSE file for information on copyright, usage and redistribution
1336
 
 * of SWIG, and the README file for authors - http://www.swig.org/release.html.
1337
 
 *
1338
1341
 * rubyrun.swg
1339
1342
 *
1340
1343
 * This file contains the runtime support for Ruby modules
1378
1381
/* Error manipulation */
1379
1382
 
1380
1383
#define SWIG_ErrorType(code)                            SWIG_Ruby_ErrorType(code)               
1381
 
#define SWIG_Error(code, msg)                           rb_raise(SWIG_Ruby_ErrorType(code), msg)
 
1384
#define SWIG_Error(code, msg)                           rb_raise(SWIG_Ruby_ErrorType(code), "%s", msg)
1382
1385
#define SWIG_fail                                       goto fail                                
1383
1386
 
1384
1387
 
1433
1436
      ++swig_virtual_calls;
1434
1437
#  define SWIG_RELEASE_STACK --swig_virtual_calls;
1435
1438
#  define Ruby_DirectorTypeMismatchException(x) \
1436
 
          rb_raise( rb_eTypeError, x ); return c_result;
 
1439
          rb_raise( rb_eTypeError, "%s", x ); return c_result;
1437
1440
 
1438
1441
      static unsigned int swig_virtual_calls = 0;
1439
1442
 
1525
1528
        downcast methods. */
1526
1529
      if (obj != Qnil) {
1527
1530
        VALUE value = rb_iv_get(obj, "@__swigtype__");
1528
 
        char* type_name = RSTRING_PTR(value);
 
1531
        const char* type_name = RSTRING_PTR(value);
1529
1532
                                
1530
1533
        if (strcmp(type->name, type_name) == 0) {
1531
1534
          return obj;
1821
1824
#define SWIG_RUBY_THREAD_END_BLOCK
1822
1825
 
1823
1826
 
1824
 
#define SWIGVERSION 0x010340 
 
1827
#define SWIGVERSION 0x020007 
1825
1828
#define SWIG_VERSION SWIGVERSION
1826
1829
 
1827
1830
 
1974
1977
1975
1978
 
1976
1979
 
1977
 
/*@SWIG:/usr/share/swig1.3/ruby/rubyprimtypes.swg,23,%ruby_aux_method@*/
 
1980
/*@SWIG:/usr/share/swig2.0/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
1978
1981
SWIGINTERN VALUE SWIG_AUX_NUM2ULONG(VALUE *args)
1979
1982
{
1980
1983
  VALUE obj = args[0];
2033
2036
}
2034
2037
 
2035
2038
 
2036
 
/*@SWIG:/usr/share/swig1.3/ruby/rubyprimtypes.swg,23,%ruby_aux_method@*/
 
2039
/*@SWIG:/usr/share/swig2.0/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
2037
2040
SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE *args)
2038
2041
{
2039
2042
  VALUE obj = args[0];
2313
2316
 
2314
2317
 
2315
2318
SWIGINTERN VALUE
 
2319
_wrap_librdf_new_hash(int argc, VALUE *argv, VALUE self) {
 
2320
  librdf_world *arg1 = (librdf_world *) 0 ;
 
2321
  char *arg2 = (char *) 0 ;
 
2322
  void *argp1 = 0 ;
 
2323
  int res1 = 0 ;
 
2324
  int res2 ;
 
2325
  char *buf2 = 0 ;
 
2326
  int alloc2 = 0 ;
 
2327
  librdf_hash *result = 0 ;
 
2328
  VALUE vresult = Qnil;
 
2329
  
 
2330
  if ((argc < 2) || (argc > 2)) {
 
2331
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
 
2332
  }
 
2333
  res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_librdf_world_s, 0 |  0 );
 
2334
  if (!SWIG_IsOK(res1)) {
 
2335
    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "librdf_world *","librdf_new_hash", 1, argv[0] )); 
 
2336
  }
 
2337
  arg1 = (librdf_world *)(argp1);
 
2338
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
 
2339
  if (!SWIG_IsOK(res2)) {
 
2340
    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","librdf_new_hash", 2, argv[1] ));
 
2341
  }
 
2342
  arg2 = (char *)(buf2);
 
2343
  result = (librdf_hash *)librdf_new_hash(arg1,(char const *)arg2);
 
2344
  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_librdf_hash_s, SWIG_POINTER_OWN |  0 );
 
2345
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
 
2346
  return vresult;
 
2347
fail:
 
2348
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
 
2349
  return Qnil;
 
2350
}
 
2351
 
 
2352
 
 
2353
SWIGINTERN VALUE
2316
2354
_wrap_librdf_new_hash_from_string(int argc, VALUE *argv, VALUE self) {
2317
2355
  librdf_world *arg1 = (librdf_world *) 0 ;
2318
2356
  char *arg2 = (char *) 0 ;
8510
8548
  rb_define_module_function(mRedland, "librdf_digest_update_string", _wrap_librdf_digest_update_string, -1);
8511
8549
  rb_define_module_function(mRedland, "librdf_digest_final", _wrap_librdf_digest_final, -1);
8512
8550
  rb_define_module_function(mRedland, "librdf_digest_to_string", _wrap_librdf_digest_to_string, -1);
 
8551
  rb_define_module_function(mRedland, "librdf_new_hash", _wrap_librdf_new_hash, -1);
8513
8552
  rb_define_module_function(mRedland, "librdf_new_hash_from_string", _wrap_librdf_new_hash_from_string, -1);
8514
8553
  rb_define_module_function(mRedland, "librdf_new_hash_from_array_of_strings", _wrap_librdf_new_hash_from_array_of_strings, -1);
8515
8554
  rb_define_module_function(mRedland, "librdf_hash_to_string", _wrap_librdf_hash_to_string, -1);