//genMethods "-g" "-t" "char*" "-d" "basic" "-y" "display_charptr" "-w" "free_charptr" "-m" "mark_charptr" 
#include <stk.h>
#include <LINK/stkWrapper/LINK_STk.h>
#include <LINK/stkWrapper/Wrapper.h>
#include <LINK/stkWrapper/Register.h>
void display_charptr(SCM, SCM, int);
void mark_charptr(SCM);
void free_charptr(SCM);
typedef char* _char_;
#define _char_DATA(x) ((char**) (EXTDATA(x)))
#define _char_IS_DATA(x) (TYPEP(x, tc_CXXwrapper) && \
		TYPEP(STk_slot_ref(x,val_scm), tc_CXXwrapper) && \
		(EXTID(STk_slot_ref(x,val_scm)) == Wrapper<char* >::type))
#define _char_ISNT_DATA(x) (!IS_DATA(x))
#define _char_CXX_DATA(x) (*(char**) (EXTDATA(VAL(x))))
#define _char_CXX_IS_DATA(x) (INSTANCEP(x) && \
		TYPEP(STk_slot_ref(x,val_scm), tc_CXXwrapper) && \
		(EXTID(STk_slot_ref(x,val_scm)) == Wrapper<char* >::type))
#define _char_CXX_ISNT_DATA(x) (!CXX_IS_DATA(x))
#include<strstream.h>
void display_charptr(SCM c, SCM port, int mode)
{
        ostrstream oss;
        if (*_char_DATA(c))
        oss << **_char_DATA(c);
        oss << ends;
        char *buffer = oss.str();
        Puts(buffer, (port));
        delete buffer;
}
void mark_charptr(SCM p)
{
        //cout << "mark_charptr" << endl;
        Register<char>::markEntry(*_char_DATA(p));
}
void free_charptr(SCM p)
{
        //cout << "free_charptr" << endl;
        if (!EXTSTATICP(p)) {
                delete _char_DATA(p);
        }
}
// define your new methods above 
// and register them using STk_add_new_cpp_primitive() below
void genExtra_char_Methods() {}
