mbidwell has asked for the wisdom of the Perl Monks concerning the following question:
andI32 enr_CreateChart (const CHAR* data_path, enr_Chart** chart) { I32 app_stat = ENR_NOERR; I32 chart_stat = ENR_NOERR; if (g_app == NULL) { app_stat = AppCreate (data_path, &g_app); } *chart = ChartCreate(); (*chart)->app = g_app; g_app->chart_cnt++; chart_stat = ChartInit (*chart); return (app_stat != ENR_NOERR) ? app_stat : chart_stat; }
All I want to do is send a call from Perl to the C API and get back the theme name using the enr_GetThemeName call.I32 enr_GetThemeName (const enr_Chart* chart, I32 idx, CHAR** name) { enr_App* app = chart ? chart->app : NULL; JCLArray* themes = app ? &app->themes : NULL; ChartTheme** theme = themes ? (ChartTheme**) ArrayGet (themes, id +x) : NULL; if (theme == NULL) { return ENR_ERR_BADARG; } *name = (*theme)->name; return ENR_NOERR; }
Any help would be appreciated.
Thanks, Mike
20041115 Edit by ysth: code and p tags
20041116 Edit by ysth: retitle from: XS newbie
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: A problem converting C code to XS
by tachyon (Chancellor) on Nov 16, 2004 at 02:20 UTC | |
|
Re: A problem converting C code to XS
by tall_man (Parson) on Nov 16, 2004 at 00:19 UTC | |
|
Re: A problem converting C code to XS
by cosmicperl (Chaplain) on Nov 16, 2004 at 00:19 UTC | |
by sth (Priest) on Nov 16, 2004 at 19:09 UTC | |
by Brutha (Friar) on Nov 17, 2004 at 12:31 UTC | |
by Anonymous Monk on Nov 23, 2004 at 15:23 UTC |