## http://search.cpan.org/dist/Inline/C/C-Cookbook.pod

use Inline C => Config =>
    ENABLE => 'UNTAINT',    ## This is needed by mod_perl
    DIRECTORY => '/root/Inline',
    DISABLE => 'CLEAN_AFTER_BUILD',
    NAME => 'Raima_Test',
    CCFLAGS => '-O2',
    INC =>  '-I/usr/local/rdm/include -I/usr/local/rdm/examples/poi/lnx64',
    LIBS => '-L/usr/local/rdm/lib/lnx64 -lrdme9';

use Inline C;
Inline->init();

print "Testing C Raima functions from Perl :\n";
test_raima();
exit (0);

__END__
__C__

#define LINUX_X64
#define RDME_LINUX

#define _STDIO_H
#define _IO_STDIO_H
#define NO_UNICODE

#include "rdm.h"
#include "poi.h"
    
void test_raima()
{
 int r;
 struct pointsofinterest poi;

 r = d_open ("poi", "o", DEFAULT_TASK);
 printf ("r = [%d]\n", r);

 r = d_initialize (DEFAULT_TASK, CURR_DB); 
 printf ("r = [%d]\n", r);

 strcpy (poi.name, "john smith");
 poi.zvalue = 123;

 r = d_fillnew (POINTSOFINTEREST, &poi, DEFAULT_TASK, CURR_DB);
 printf ("r = [%d]\n", r);
}

