Module::New::File::XS - Module::New::File::XS documentation


Module-New documentation Contained in the Module-New distribution.

Index


Code Index:

NAME

Top

Module::New::File::XS

DESCRIPTION

Top

a template for a main xs (Name.xs).

AUTHOR

Top

Kenichi Ishigaki, <ishigaki at cpan.org>

COPYRIGHT AND LICENSE

Top


Module-New documentation Contained in the Module-New distribution.

package Module::New::File::XS;

use strict;
use warnings;
use Module::New::File;

file '{MODULEBASE}.xs' => content { return <<'EOT';
#ifdef __cplusplus
extern "C" {
#endif
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#include "ppport.h"
#include "<%= $c->module_base %>.h"
#ifdef __cplusplus
}
#endif

MODULE = <%= $c->module %>  PACKAGE = <%= $c->module %>
EOT
};

file '{MODULEBASE}.h' => content { return <<'EOT';
#ifndef <%= uc $c->module_id %>_H
#define <%= uc $c->module_id %>_H 1

#endif /* #ifndef <%= uc $c->module_id %>_H */
EOT
};

1;

__END__