in reply to Inline::C better than XS?
#!/usr/bin/perl use Inline C => DATA => LIBS => '-lservices'; # Here's how we would configure Inline if our headers and # libraries are in a non-standard location #use Inline C => DATA => # INC => '-I/usr/local/include' => # LIBS => '-L/usr/local/lib -lservices'; my_services(); __END__ __C__ #include <libservices.h> int my_services( ) { struct serv *serv_list = serv_load(NULL); struct serv *serv = serv_list; for (; serv; serv = serv->next) { printf("%s %s %s \n", serv->name, serv->port, serv->proto ); } serv_destroy(serv_list); return 1; }
-derby
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Inline::C better than XS?
by ginttu (Sexton) on Nov 20, 2002 at 14:28 UTC | |
by jsegal (Friar) on Nov 20, 2002 at 16:47 UTC |