Skip to content

Commit

Permalink
This makes bad things happen
Browse files Browse the repository at this point in the history
  • Loading branch information
leto committed Apr 10, 2010
1 parent 54f7395 commit 4a007ea
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion plparrot.c
Expand Up @@ -292,12 +292,25 @@ Parrot_String create_string(const char *name)
Datum
plparrot_make_sausage(Parrot_Interp interp, Parrot_PMC pmc)
{
char *str, copy;
Parrot_PMC p, inspect;
Parrot_String s;
/* elog(NOTICE, "starting sausage machine"); */
if (Parrot_PMC_isa(interp,pmc,create_string("Integer"))) {
return Int32GetDatum(Parrot_PMC_get_integer(interp,pmc));
} else if (Parrot_PMC_isa(interp,pmc,create_string("String"))) {
inspect = create_pmc("ResizablePMCArray");
inspect = Parrot_PMC_inspect(interp,pmc);

/* XXX: This doesn't work */
return PointerGetDatum(Parrot_PMC_get_string(interp,pmc));
s = Parrot_PMC_get_string(interp,pmc);
str = Parrot_str_to_cstring(interp,s);
strcpy(copy,str);
Parrot_str_free_cstring(str);

elog(NOTICE,"sausage string = %s", copy);
return CStringGetDatum(copy);

} else if (Parrot_PMC_isa(interp,pmc,create_string("Numeric"))) {
return Float8GetDatum(Parrot_PMC_get_number(interp,pmc));
} else {
Expand Down

0 comments on commit 4a007ea

Please sign in to comment.