]> git.proxmox.com Git - libxdgmime-perl.git/blame - Xdgmime/lib/Xdgmime.pm
update bindings
[libxdgmime-perl.git] / Xdgmime / lib / Xdgmime.pm
CommitLineData
a1d229d1
DM
1package Xdgmime;
2
94212449 3use 5.036000;
a1d229d1
DM
4use strict;
5use warnings;
6use Carp;
7
8require Exporter;
9use AutoLoader;
10
11our @ISA = qw(Exporter);
12
13# Items to export into callers namespace by default. Note: do not export
14# names by default without a very good reason. Use EXPORT_OK instead.
15# Do not simply export all your public functions/methods/constants.
16
17# This allows declaration use Xdgmime ':all';
18# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
19# will save memory.
20our %EXPORT_TAGS = ( 'all' => [ qw(
21 XDG_MIME_TYPE_EMPTY
22 XDG_MIME_TYPE_TEXTPLAIN
23 XDG_MIME_TYPE_UNKNOWN
a1d229d1 24 xdg_mime_dump
a1d229d1 25 xdg_mime_get_max_buffer_extents
a1d229d1
DM
26 xdg_mime_get_mime_type_for_data
27 xdg_mime_get_mime_type_for_file
28 xdg_mime_get_mime_type_from_file_name
a1d229d1
DM
29 xdg_mime_is_valid_mime_type
30 xdg_mime_list_mime_parents
31 xdg_mime_media_type_equal
32 xdg_mime_mime_type_equal
33 xdg_mime_mime_type_subclass
a1d229d1 34 xdg_mime_shutdown
a1d229d1
DM
35) ] );
36
37our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
38
39our @EXPORT = qw(
40 XDG_MIME_TYPE_EMPTY
41 XDG_MIME_TYPE_TEXTPLAIN
42 XDG_MIME_TYPE_UNKNOWN
a1d229d1 43 xdg_mime_dump
a1d229d1 44 xdg_mime_get_max_buffer_extents
a1d229d1
DM
45 xdg_mime_get_mime_type_for_data
46 xdg_mime_get_mime_type_for_file
47 xdg_mime_get_mime_type_from_file_name
a1d229d1
DM
48 xdg_mime_is_valid_mime_type
49 xdg_mime_list_mime_parents
50 xdg_mime_media_type_equal
51 xdg_mime_mime_type_equal
52 xdg_mime_mime_type_subclass
a1d229d1 53 xdg_mime_shutdown
a1d229d1
DM
54);
55
94212449 56our $VERSION = '1.1';
a1d229d1
DM
57
58sub AUTOLOAD {
59 # This AUTOLOAD is used to 'autoload' constants from the constant()
60 # XS function.
61
62 my $constname;
63 our $AUTOLOAD;
64 ($constname = $AUTOLOAD) =~ s/.*:://;
65 croak "&Xdgmime::constant not defined" if $constname eq 'constant';
66 my ($error, $val) = constant($constname);
67 if ($error) { croak $error; }
68 {
69 no strict 'refs';
70 # Fixed between 5.005_53 and 5.005_61
71#XXX if ($] >= 5.00561) {
72#XXX *$AUTOLOAD = sub () { $val };
73#XXX }
74#XXX else {
75 *$AUTOLOAD = sub { $val };
76#XXX }
77 }
78 goto &$AUTOLOAD;
79}
80
81require XSLoader;
82XSLoader::load('Xdgmime', $VERSION);
83
84# Preloaded methods go here.
85
e66585f4 86# Autoload methods go after __END__, and are processed by the autosplit program.
a1d229d1
DM
87
881;
89__END__