[vala] Add libmagic bindings.
- From: Evan Nemerson <evann src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [vala] Add libmagic bindings.
- Date: Sat, 7 Nov 2009 19:25:43 +0000 (UTC)
commit a0d18f481a69bad8f91b48940f65ffd8c05cf812
Author: Jens Georg <mail jensge org>
Date: Sat Nov 7 11:15:37 2009 -0800
Add libmagic bindings.
Fixes bug 599811.
vapi/Makefile.am | 1 +
vapi/libmagic.vapi | 43 +++++++++++++++++++++++++++++++++++++++++++
2 files changed, 44 insertions(+), 0 deletions(-)
---
diff --git a/vapi/Makefile.am b/vapi/Makefile.am
index fc5fd86..e9587b6 100644
--- a/vapi/Makefile.am
+++ b/vapi/Makefile.am
@@ -111,6 +111,7 @@ dist_vapi_DATA = \
libgnomeui-2.0.vapi \
libgsf-1.deps \
libgsf-1.vapi \
+ libmagic.vapi \
libnl-1.vapi \
libnotify.deps \
libnotify.vapi \
diff --git a/vapi/libmagic.vapi b/vapi/libmagic.vapi
new file mode 100644
index 0000000..2d1448b
--- /dev/null
+++ b/vapi/libmagic.vapi
@@ -0,0 +1,43 @@
+[CCode (cheader_filename = "magic.h")]
+namespace LibMagic {
+ [Compact]
+ [CCode (cname = "struct magic_set", cprefix = "magic_", free_function = "magic_close")]
+ public class Magic {
+ [CCode (cname = "magic_open")]
+ public Magic (Flags flags = Flags.NONE);
+ public unowned string? error ();
+ public int errno ();
+ public unowned string? file (string filename);
+ public unowned string? buffer (void *buffer, size_t length);
+ public int setflags (int flags);
+ public int check (string? filename = null);
+ public int compile (string? filename = null);
+ public int load (string? filename = null);
+ }
+
+ [Flags]
+ [CCode (cprefix = "MAGIC_", cname = "int")]
+ public enum Flags {
+ NONE,
+ DEBUG,
+ SYMLINK,
+ COMPRESS,
+ DEVICES,
+ MIME_TYPE,
+ MIME_ENCODING,
+ CONTINUE,
+ CHECK,
+ PRESERVE_ATIME,
+ RAW,
+ ERROR,
+ NO_CHECK_ATYPE,
+ NO_CHECK_ASCII,
+ NO_CHECK_COMPRESS,
+ NO_CHECK_ELF,
+ NO_CHECK_FORTRAN,
+ NO_CHECK_SOFT,
+ NO_CHECK_TAR,
+ NO_CHECK_TOKENS,
+ NO_CHECK_TROFF
+ }
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]