SPUG: Inline doesn't like my code
starfire at zipcon.net
starfire at zipcon.net
Fri Dec 1 16:26:54 CST 2000
I'm a first-time user of Inline.pm. The following code generates a
segmentation fault. If I step through it with the Perl debugger, the error
message is "Signal SEGV: No such file or directory".
Any suggestions?
use Inline C => <<'END_OF_C_CODE';
#include <time.h>
void get_localtime(int utc) {
Inline_Stack_Vars;
int *utc, seconds;
struct tm *ltime;
SV* return_value;
seconds = Inline_Stack_Item(0);
utc = &seconds;
ltime = localtime(utc);
Inline_Stack_Reset;
return_value = ltime->tm_year;
Inline_Stack_Push(return_value);
return_value = ltime->tm_mon;
Inline_Stack_Push(return_value);
return_value = ltime->tm_mday;
Inline_Stack_Push(return_value);
return_value = ltime->tm_hour;
Inline_Stack_Push(return_value);
return_value = ltime->tm_min;
Inline_Stack_Push(return_value);
return_value = ltime->tm_sec;
Inline_Stack_Push(return_value);
return_value = ltime->tm_isdst;
Inline_Stack_Push(return_value);
Inline_Stack_Done;
}
END_OF_C_CODE
Richard Anderson www.rayCosoft.com RayCosoft Richard.Anderson at rayCosoft.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
POST TO: spug-list at pm.org PROBLEMS: owner-spug-list at pm.org
Subscriptions; Email to majordomo at pm.org: ACTION LIST EMAIL
Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest
Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/
More information about the spug-list
mailing list