I am sorry to bother the list, because I am quite certain this is my mistake.
If this is the wrong list, I again apologize - I saw no other mailing lists
for Inline.  I tried browsing the archives, but saw nothing relevant and I
honestly could not think of a search query for my problem.  If this is
considered a bug, I do have the reportbug tarball ready for email.

I am using perl 5.6.1 on Solaris 8 compiled with gcc 2.95.1.  I am using
Parse::RecDescent v1.80 and Inline v0.43.  I am using the same gcc now as when
I compiled perl.

I am attempting to use Inline::C to link against an IBM development library.
I have read the cookbook and found the examples I needed, and played with them
enough to figure what I had to do.  

I wrote the Inline::C code. It compiled and ran without warnings after the
third or fourth try, but the library call returned with an error.  The error
message being generated is pretty specific to the library, and I will be happy
to provide it if requested.

After trying many things, I finally extracted the C code, put a simple main()
in it and compiled it.  It worked, and completed without errors.

I am now terribly confused.  I would appreciate any assistance, pointers to
FMs I can read, anything that would help me figure out my mistake.

Attached is the code I wrote ( usernames and passwords changed to protect the
innocent ).  

TIA,
  Mik


----------- context.pl -----------

#!/usr/local/bin/perl -w

use strict;
use Inline C => Config =>
            LIBS => "-lpdadminapi",
            INC  => "-I/usr/include/PolicyDirector";
use Inline C => << 'END_C';

#include <ivadminapi.h>

int context_create( char* user, char* passwd ) {
    ivadmin_context ctx;
    ivadmin_response rsp;
    unsigned long status;
    int i;

    printf("Establising context as %s (%s)\n", user,
                                               passwd );

    status = ivadmin_context_createdefault(user,passwd,&ctx,&rsp);

    if ( ivadmin_response_getok(rsp) ) {
        printf("ivadmin_context_createdefault succeeded\n" );
    }
    else {
        for(i=0; i<ivadmin_response_getcount(rsp);i++) {
            printf( "ivadmin_context_createdefault : %s\n",
            ivadmin_response_getmessage( rsp, i ) );
        }
    }
    ivadmin_free( rsp );
    return status;
}
END_C

my ( $foo, $user, $passwd );

$user = 'xxxxxxxx';
$passwd = 'xxxxxxxx';

$foo = context_create( $user, $passwd );

print "status = $foo\n";

-- 
Mik Firestone [EMAIL PROTECTED]
When I become an Evil Overlord:
Shooting is _not_ too good for my enemies.

Reply via email to