Hello, Eric,

> ----8<----will_not_work.pl---------------------------------
> will_not_work.pl
> #!/usr/bin/perl -w
>
> BEGIN{
>   use Inline;
>   $Inline::Config::CLEAN_AFTER_BUILD = 0;
> }
>
> use strict;
>
> my $dance = 100;
>
> two_step($dance);
>
> exit;
>
> use Inline C => <<'END_OF_C_CODE';
>
> void steps(int *steps_array)
> {
>     printf("I can only hope to get this far\n");
> }
>
> void two_step(int isteps)
> {
>   int *dance = NULL;
>
>   dance = (int*)malloc(isteps*sizeof(int));
>   if (dance=NULL)
>      handle_error(1, 1);
>
>   steps(dance);
>
>   free(dance);
>
> }
>
> handle_error (int err_no, int trap)
> {
>   printf("Could not allocated sufficient memory! (Error #1 at trap %d)\n\n",
> trap);
>   exit(0);
> }
>
> END_OF_C_CODE

This example *works* on my system here (perl 5.6, Inline 0.30, gcc). (Your
example uses Inline::Config which disappeared with 0.2x?)

> This is fine, because I don't want to pass or access
> these parameters or call this subroutine from perl space, only c space

In this case, steps() could be declared static.

                                 Jochen

Reply via email to