Perl added to the Unified typemap library, cleaner way to use the library, and 'normalized' macro names

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7707 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2005-10-24 14:59:05 +00:00
commit f2f1b9889f
112 changed files with 3262 additions and 3375 deletions

View file

@ -21,7 +21,7 @@ SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc)
if (cptr) {
if (alloc) {
if (*alloc == SWIG_NEWOBJ) {
*cptr = SWIG_new_copy_array(cstr, size, char);
*cptr = %new_copy_array(cstr, size, char);
} else {
*cptr = cstr;
*alloc = SWIG_OLDOBJ;
@ -42,9 +42,9 @@ SWIG_FromCharPtrAndSize(const char* carray, size_t size)
{
if (carray) {
if (size > LONG_MAX) {
return SWIG_NewPointerObj(SWIG_const_cast(carray,char *), SWIG_TypeQuery("char *"), 0);
return SWIG_NewPointerObj(%const_cast(carray,char *), SWIG_TypeQuery("char *"), 0);
} else {
return rb_str_new(carray, SWIG_numeric_cast(size,long));
return rb_str_new(carray, %numeric_cast(size,long));
}
} else {
return Qnil;
@ -52,9 +52,3 @@ SWIG_FromCharPtrAndSize(const char* carray, size_t size)
}
}
/* ------------------------------------------------------------
* The plain char * handling
* ------------------------------------------------------------ */
%include <typemaps/strings.swg>
%typemap_string(char, Char, SWIG_AsCharPtrAndSize, SWIG_FromCharPtrAndSize, strlen)