Added Perl support for member pointers. Some reorganization of other runtime code
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5436 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
dc3fa7ee39
commit
1095ee9859
7 changed files with 111 additions and 85 deletions
|
|
@ -11,8 +11,6 @@ SWIGIMPORT(char *) SWIG_Ruby_MangleStr(VALUE);
|
|||
SWIGIMPORT(int) SWIG_Ruby_ConvertPtr(VALUE, void**, swig_type_info *, int);
|
||||
SWIGIMPORT(void *) SWIG_Ruby_MustGetPtr(VALUE, swig_type_info *, int, int);
|
||||
SWIGIMPORT(int) SWIG_Ruby_CheckConvert(VALUE, swig_type_info *);
|
||||
SWIGIMPORT(char *) SWIG_Ruby_PackData(char *c, void *ptr, int sz);
|
||||
SWIGIMPORT(char *) SWIG_Ruby_UnpackData(char *c, void *ptr, int sz);
|
||||
SWIGIMPORT(VALUE) SWIG_Ruby_NewPackedObj(void *ptr, int sz, swig_type_info *type);
|
||||
SWIGIMPORT(void) SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty, int flags);
|
||||
|
||||
|
|
|
|||
|
|
@ -136,44 +136,6 @@ SWIG_Ruby_CheckConvert(VALUE obj, swig_type_info *ty)
|
|||
return SWIG_TypeCheck(c,ty) != 0;
|
||||
}
|
||||
|
||||
/* Pack binary data into a string */
|
||||
SWIGRUNTIME(char *)
|
||||
SWIG_Ruby_PackData(char *c, void *ptr, int sz) {
|
||||
static char hex[17] = "0123456789abcdef";
|
||||
int i;
|
||||
unsigned char *u = (unsigned char *) ptr;
|
||||
register unsigned char uu;
|
||||
for (i = 0; i < sz; i++,u++) {
|
||||
uu = *u;
|
||||
*(c++) = hex[(uu & 0xf0) >> 4];
|
||||
*(c++) = hex[uu & 0xf];
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
/* Unpack binary data from a string */
|
||||
SWIGRUNTIME(char *)
|
||||
SWIG_Ruby_UnpackData(char *c, void *ptr, int sz) {
|
||||
register unsigned char uu = 0;
|
||||
register int d;
|
||||
unsigned char *u = (unsigned char *) ptr;
|
||||
int i;
|
||||
for (i = 0; i < sz; i++, u++) {
|
||||
d = *(c++);
|
||||
if ((d >= '0') && (d <= '9'))
|
||||
uu = ((d - '0') << 4);
|
||||
else if ((d >= 'a') && (d <= 'f'))
|
||||
uu = ((d - ('a'-10)) << 4);
|
||||
d = *(c++);
|
||||
if ((d >= '0') && (d <= '9'))
|
||||
uu |= (d - '0');
|
||||
else if ((d >= 'a') && (d <= 'f'))
|
||||
uu |= (d - ('a'-10));
|
||||
*u = uu;
|
||||
}
|
||||
return c;
|
||||
}
|
||||
|
||||
SWIGRUNTIME(VALUE)
|
||||
SWIG_Ruby_NewPackedObj(void *ptr, int sz, swig_type_info *type) {
|
||||
char result[1024];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue