class Cproton::Pn_bytes_t
Public Class Methods
new(*args)
click to toggle source
SWIGINTERN VALUE
_wrap_new_pn_bytes_t(int argc, VALUE *argv, VALUE self) {
pn_bytes_t *result = 0 ;
if ((argc < 0) || (argc > 0)) {
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
}
result = (pn_bytes_t *)calloc(1, sizeof(pn_bytes_t));
DATA_PTR(self) = result;
return self;
fail:
return Qnil;
}
Public Instance Methods
size(*args)
click to toggle source
SWIGINTERN VALUE
_wrap_pn_bytes_t_size_get(int argc, VALUE *argv, VALUE self) {
pn_bytes_t *arg1 = (pn_bytes_t *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
size_t result;
VALUE vresult = Qnil;
if ((argc < 0) || (argc > 0)) {
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
}
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_pn_bytes_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "pn_bytes_t *","size", 1, self ));
}
arg1 = (pn_bytes_t *)(argp1);
result = (size_t) ((arg1)->size);
vresult = SWIG_From_size_t((size_t)(result));
return vresult;
fail:
return Qnil;
}
size=(x) → size_t
click to toggle source
Size or Length of the pn_bytes_t.
SWIGINTERN VALUE
_wrap_pn_bytes_t_size_set(int argc, VALUE *argv, VALUE self) {
pn_bytes_t *arg1 = (pn_bytes_t *) 0 ;
size_t arg2 ;
void *argp1 = 0 ;
int res1 = 0 ;
size_t val2 ;
int ecode2 = 0 ;
if ((argc < 1) || (argc > 1)) {
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
}
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_pn_bytes_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "pn_bytes_t *","size", 1, self ));
}
arg1 = (pn_bytes_t *)(argp1);
ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "size_t","size", 2, argv[0] ));
}
arg2 = (size_t)(val2);
if (arg1) (arg1)->size = arg2;
return Qnil;
fail:
return Qnil;
}
start(*args)
click to toggle source
SWIGINTERN VALUE
_wrap_pn_bytes_t_start_get(int argc, VALUE *argv, VALUE self) {
pn_bytes_t *arg1 = (pn_bytes_t *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
char *result = 0 ;
VALUE vresult = Qnil;
if ((argc < 0) || (argc > 0)) {
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
}
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_pn_bytes_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "pn_bytes_t *","start", 1, self ));
}
arg1 = (pn_bytes_t *)(argp1);
result = (char *) ((arg1)->start);
vresult = SWIG_FromCharPtr((const char *)result);
return vresult;
fail:
return Qnil;
}
start=(*args)
click to toggle source
SWIGINTERN VALUE
_wrap_pn_bytes_t_start_set(int argc, VALUE *argv, VALUE self) {
pn_bytes_t *arg1 = (pn_bytes_t *) 0 ;
char *arg2 = (char *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int res2 ;
char *buf2 = 0 ;
int alloc2 = 0 ;
if ((argc < 1) || (argc > 1)) {
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
}
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_pn_bytes_t, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "pn_bytes_t *","start", 1, self ));
}
arg1 = (pn_bytes_t *)(argp1);
res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char *","start", 2, argv[0] ));
}
arg2 = (char *)(buf2);
if (arg1->start) free((char*)arg1->start);
if (arg2) {
size_t size = strlen((const char *)(arg2)) + 1;
arg1->start = (char *)(char *)memcpy((char *)malloc((size)*sizeof(char)), (const char *)(arg2), sizeof(char)*(size));
} else {
arg1->start = 0;
}
if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
return Qnil;
fail:
if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
return Qnil;
}