├── SDL2_gfx.deps ├── SDL2_net.deps ├── SDL2_ttf.deps ├── alure.deps ├── ctpl.deps ├── hiredis.deps ├── libcurl.deps ├── libudev.deps ├── sdl2-ios.deps ├── sdl2-winrt.deps ├── sensors.deps ├── uuid.deps ├── xcb-dri2.deps ├── xcb-dri3.deps ├── xcb-icccm.deps ├── xcb-render.deps ├── xcb-res.deps ├── xcb-shape.deps ├── xcb-shm.deps ├── xcb-sync.deps ├── xcb-xtest.deps ├── SDL2_image.deps ├── SDL2_mixer.deps ├── augeas.deps ├── gpgme.deps ├── libinput.deps ├── libmemcached.deps ├── sdl2-android.deps ├── sdl2-windows.deps ├── xcb-xinerama.deps ├── cairosdl.deps ├── check.deps ├── xcb-randr.deps ├── xcb-xv.deps ├── cairo-xcb.deps ├── libfprint.deps ├── libmemcachedutil.deps ├── libssh2.deps ├── xcb-damage.deps ├── xcb-composite.deps ├── xcb-xfixes.deps ├── libsystemd-journal.deps ├── xcb-present.deps ├── libsystemd-id128.vapi ├── cairo-xcb.vapi ├── vala-extra-vapis.doap ├── sdl2-ios.vapi ├── libstemmer.vapi ├── snappy.vapi ├── libmemcachedutil.vapi ├── xcb-icccm.vapi ├── cairosdl.vapi ├── README.md ├── libsodium.vapi ├── uchardet.vapi ├── sdl2-android.vapi ├── libqrencode.vapi ├── sdl2-winrt.vapi ├── samplerate.vapi ├── libmatheval.vapi ├── sdl2-windows.vapi ├── kiss_fft.vapi ├── tcc.vapi ├── uuid.vapi ├── xcb-damage.vapi ├── xcb-xtest.vapi ├── aubio.vapi ├── magic.vapi ├── pa_ringbuffer.vapi ├── xcb-composite.vapi ├── libsystemd-journal.vapi ├── pwquality.vapi ├── cpufreq.vapi ├── libmarkdown.vapi ├── xcb-shm.vapi ├── xcb-dri3.vapi ├── SDL2_net.vapi ├── xcb-present.vapi ├── libzmq.vapi ├── xcb-xinerama.vapi ├── xkbregistry.vapi ├── libevent.vapi ├── libudev.vapi ├── SDL2_image.vapi ├── sasl2.vapi ├── xcb-shape.vapi ├── portmidi.vapi ├── sensors.vapi ├── leveldb.vapi ├── libcolumbus.vapi ├── alure.vapi ├── espeak.vapi └── libgsasl.vapi /SDL2_gfx.deps: -------------------------------------------------------------------------------- 1 | sdl2 2 | -------------------------------------------------------------------------------- /SDL2_net.deps: -------------------------------------------------------------------------------- 1 | sdl2 2 | -------------------------------------------------------------------------------- /SDL2_ttf.deps: -------------------------------------------------------------------------------- 1 | sdl2 2 | -------------------------------------------------------------------------------- /alure.deps: -------------------------------------------------------------------------------- 1 | openal 2 | -------------------------------------------------------------------------------- /ctpl.deps: -------------------------------------------------------------------------------- 1 | gio-2.0 2 | -------------------------------------------------------------------------------- /hiredis.deps: -------------------------------------------------------------------------------- 1 | posix 2 | -------------------------------------------------------------------------------- /libcurl.deps: -------------------------------------------------------------------------------- 1 | posix 2 | -------------------------------------------------------------------------------- /libudev.deps: -------------------------------------------------------------------------------- 1 | posix 2 | -------------------------------------------------------------------------------- /sdl2-ios.deps: -------------------------------------------------------------------------------- 1 | sdl2 2 | -------------------------------------------------------------------------------- /sdl2-winrt.deps: -------------------------------------------------------------------------------- 1 | sdl2 -------------------------------------------------------------------------------- /sensors.deps: -------------------------------------------------------------------------------- 1 | posix 2 | -------------------------------------------------------------------------------- /uuid.deps: -------------------------------------------------------------------------------- 1 | posix 2 | -------------------------------------------------------------------------------- /xcb-dri2.deps: -------------------------------------------------------------------------------- 1 | xcb 2 | -------------------------------------------------------------------------------- /xcb-dri3.deps: -------------------------------------------------------------------------------- 1 | xcb 2 | -------------------------------------------------------------------------------- /xcb-icccm.deps: -------------------------------------------------------------------------------- 1 | xcb 2 | -------------------------------------------------------------------------------- /xcb-render.deps: -------------------------------------------------------------------------------- 1 | xcb 2 | -------------------------------------------------------------------------------- /xcb-res.deps: -------------------------------------------------------------------------------- 1 | xcb 2 | -------------------------------------------------------------------------------- /xcb-shape.deps: -------------------------------------------------------------------------------- 1 | xcb 2 | -------------------------------------------------------------------------------- /xcb-shm.deps: -------------------------------------------------------------------------------- 1 | xcb 2 | -------------------------------------------------------------------------------- /xcb-sync.deps: -------------------------------------------------------------------------------- 1 | xcb 2 | -------------------------------------------------------------------------------- /xcb-xtest.deps: -------------------------------------------------------------------------------- 1 | xcb 2 | -------------------------------------------------------------------------------- /SDL2_image.deps: -------------------------------------------------------------------------------- 1 | sdl2 2 | -------------------------------------------------------------------------------- /SDL2_mixer.deps: -------------------------------------------------------------------------------- 1 | sdl2 2 | -------------------------------------------------------------------------------- /augeas.deps: -------------------------------------------------------------------------------- 1 | libxml-2.0 2 | -------------------------------------------------------------------------------- /gpgme.deps: -------------------------------------------------------------------------------- 1 | gpg-error 2 | -------------------------------------------------------------------------------- /libinput.deps: -------------------------------------------------------------------------------- 1 | libudev 2 | -------------------------------------------------------------------------------- /libmemcached.deps: -------------------------------------------------------------------------------- 1 | posix 2 | -------------------------------------------------------------------------------- /sdl2-android.deps: -------------------------------------------------------------------------------- 1 | sdl2 2 | -------------------------------------------------------------------------------- /sdl2-windows.deps: -------------------------------------------------------------------------------- 1 | sdl2 2 | -------------------------------------------------------------------------------- /xcb-xinerama.deps: -------------------------------------------------------------------------------- 1 | xcb 2 | -------------------------------------------------------------------------------- /cairosdl.deps: -------------------------------------------------------------------------------- 1 | cairo 2 | sdl 3 | -------------------------------------------------------------------------------- /check.deps: -------------------------------------------------------------------------------- 1 | posix 2 | glib-2.0 3 | -------------------------------------------------------------------------------- /xcb-randr.deps: -------------------------------------------------------------------------------- 1 | xcb-render 2 | -------------------------------------------------------------------------------- /xcb-xv.deps: -------------------------------------------------------------------------------- 1 | xcb 2 | xcb-shm 3 | -------------------------------------------------------------------------------- /cairo-xcb.deps: -------------------------------------------------------------------------------- 1 | cairo 2 | xcb 3 | 4 | -------------------------------------------------------------------------------- /libfprint.deps: -------------------------------------------------------------------------------- 1 | glib-2.0 2 | posix 3 | -------------------------------------------------------------------------------- /libmemcachedutil.deps: -------------------------------------------------------------------------------- 1 | libmemcached 2 | -------------------------------------------------------------------------------- /libssh2.deps: -------------------------------------------------------------------------------- 1 | glib-2.0 2 | posix 3 | -------------------------------------------------------------------------------- /xcb-damage.deps: -------------------------------------------------------------------------------- 1 | xcb 2 | xcb-xfixes 3 | -------------------------------------------------------------------------------- /xcb-composite.deps: -------------------------------------------------------------------------------- 1 | xcb 2 | xcb-xfixes 3 | -------------------------------------------------------------------------------- /xcb-xfixes.deps: -------------------------------------------------------------------------------- 1 | xcb 2 | xcb-render 3 | xcb-shape 4 | -------------------------------------------------------------------------------- /libsystemd-journal.deps: -------------------------------------------------------------------------------- 1 | posix 2 | libsystemd-id128 3 | -------------------------------------------------------------------------------- /xcb-present.deps: -------------------------------------------------------------------------------- 1 | xcb 2 | xcb-xfixes 3 | xcb-randr 4 | xcb-sync 5 | -------------------------------------------------------------------------------- /libsystemd-id128.vapi: -------------------------------------------------------------------------------- 1 | [CCode (lower_case_cprefix = "sd_", cheader_filename = "systemd/sd-id128.h")] 2 | namespace Systemd { 3 | [SimpleType, CCode (cname = "sd_id128_t", lower_case_cprefix = "sd_id128_", cheader_filename = "systemd/sd-id128.h", default_value = "SD_ID128_NULL")] 4 | public struct Id128 { 5 | public uint8 bytes[16]; 6 | public uint64 qwords[2]; 7 | 8 | [CCode (cname = "SD_ID128_NULL")] 9 | public const Systemd.Id128 NULL; 10 | 11 | [CCode (cname = "sd_id128_randomize")] 12 | public static int random (out Systemd.Id128 ret); 13 | [CCode (cname = "sd_id128_get_machine")] 14 | public static int machine (out Systemd.Id128 ret); 15 | [CCode (cname = "sd_id128_get_boot")] 16 | public static int boot (out Systemd.Id128 ret); 17 | public static int from_string (string s, out Systemd.Id128 ret); 18 | 19 | [CCode (cname = "sd_id128_to_string")] 20 | private string _to_string ([CCode (array_length = false)] owned char[] s = new char[33]); 21 | [CCode (cname = "_vala_sd_id128_to_string")] 22 | public string to_string () { 23 | return this.str; 24 | } 25 | 26 | public static bool equal (Systemd.Id128 a, Systemd.Id128 b); 27 | 28 | public unowned string str { 29 | [CCode (cname = "SD_ID128_CONST_STR")] 30 | get; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /cairo-xcb.vapi: -------------------------------------------------------------------------------- 1 | /* cairo-xcb.vala 2 | * 3 | * Copyright (C) 2009 Jürg Billeter 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | * 19 | * Author: 20 | * Jürg Billeter 21 | */ 22 | 23 | namespace Cairo { 24 | [Compact] 25 | [CCode (cname = "cairo_surface_t", cheader_filename = "cairo-xcb.h")] 26 | public class XcbSurface : Surface { 27 | [CCode (cname = "cairo_xcb_surface_create")] 28 | public XcbSurface (Xcb.Connection connection, Xcb.Drawable drawable, Xcb.VisualType? visual, int width, int height); 29 | public void set_size (int width, int height); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vala-extra-vapis.doap: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | vala-extra-vapis 9 | Vala bindings for additional libraries 10 | A collection of bindings which are not shipped with vala itself. 11 | 12 | 13 | 14 | 15 | 16 | Vala 17 | 18 | 19 | 20 | Evan Nemerson 21 | evann 22 | 23 | 24 | 25 | 26 | Rico Tzschichholz 27 | 28 | ricotz 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /sdl2-ios.vapi: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2016-2020 SDL2 VAPI Authors 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | * 24 | * Authors: 25 | * Mario Daniel Ruiz Saavedra 26 | * Gontzal Uriarte 27 | * Pedro H. Lara Campos 28 | */ 29 | 30 | namespace SDL { 31 | /// 32 | /// iOS 33 | /// 34 | 35 | public delegate void AnimationFunc (); 36 | [CCode (cheader_filename = "SDL2/SDL_system.h")] 37 | [Compact] 38 | public class iPhone { 39 | [CCode (cname = "SDL_iPhoneSetAnimationCallback")] 40 | public static int set_animation_callback (Video.Window window, int interval, AnimationFunc func); 41 | 42 | [CCode (cname = "SDL_iPhoneSetEventPump")] 43 | public static void set_event_pump (bool enable); 44 | }// iPhone 45 | 46 | 47 | } 48 | -------------------------------------------------------------------------------- /libstemmer.vapi: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2010-2013 Giulio Paci 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | * SUCH DAMAGE. 25 | */ 26 | 27 | [CCode (cheader_filename = "libstemmer.h", lower_case_cprefix = "sb_", cprefix="sb_")] 28 | namespace SnowBall { 29 | [Compact] 30 | [CCode (cname = "struct sb_stemmer", free_function="sb_stemmer_delete")] 31 | public class Stemmer { 32 | public unowned string stem(string word, int size); 33 | public int length(); 34 | public Stemmer(string language, string encoding = "UTF_8"); 35 | [CCode (array_length = false, array_null_terminated = true)] 36 | public static unowned string[] list(); 37 | } 38 | } -------------------------------------------------------------------------------- /snappy.vapi: -------------------------------------------------------------------------------- 1 | /* snappy Vala Bindings 2 | * Copyright 2011 Fabian Deutsch 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | [CCode (cheader_filename = "snappy-c.h")] 26 | namespace Snappy 27 | { 28 | 29 | [CCode (cname = "snappy_status", cprefix = "SNAPPY_")] 30 | public enum Status 31 | { 32 | OK, 33 | INVALID_INPUT, 34 | BUFFER_TOO_SMALL 35 | } 36 | 37 | 38 | Status compress (char* input, size_t input_length, 39 | char* compressed, size_t* compressed_length); 40 | 41 | Status uncompress (char* compressed, size_t compressed_length, 42 | char* uncompressed, size_t* uncompressed_length); 43 | 44 | size_t max_compressed_length (size_t source_length); 45 | 46 | Status uncompressed_length (char* compressed, size_t compressed_length, size_t* result); 47 | 48 | Status validate_compressed_buffer (char* compressed, size_t compressed_length); 49 | } 50 | -------------------------------------------------------------------------------- /libmemcachedutil.vapi: -------------------------------------------------------------------------------- 1 | namespace Memcached { 2 | [Compact, CCode (cname = "memcached_pool_st", has_type_id = false, free_function = "memcached_pool_destroy", cheader_filename = "libmemcachedutil-1.0/pool.h")] 3 | public class Pool { 4 | [CCode (cname = "memcached_pool")] 5 | public Pool ([CCode (array_length_type = "size_t")] uint8[] option_string); 6 | [Version (deprecated = true, deprecated_since = "0.46", replacement = "Pool"), CCode (cname = "memcached_pool_create")] 7 | public Pool.from_context (Memcached.Context mmc, uint32 initial, uint32 max); 8 | [Version (deprecated = true, deprecated_since = "0.53", replacement = "fetch")] 9 | public unowned Memcached.Context pop (bool block, out Memcached.ReturnCode rc); 10 | [Version (deprecated = true, deprecated_since = "0.53", replacement = "release")] 11 | public Memcached.ReturnCode push (Memcached.Context mmc); 12 | public Memcached.ReturnCode release (Memcached.Context mmc); 13 | public unowned Memcached.Context fetch (Posix.timespec relative_time, out Memcached.ReturnCode rc); 14 | public Memcached.ReturnCode behavior_set (Memcached.Behavior flag, uint64 data); 15 | public Memcached.ReturnCode behavior_get (Memcached.Behavior flag, out uint64 data); 16 | } 17 | [CCode (cprefix = "libmemcached_util_", cheader_filename = "libmemcachedutil-1.0/util.h")] 18 | namespace Util { 19 | // flush.h 20 | public bool flush (string hostname, in_port_t port, out Memcached.ReturnCode ret); 21 | // pid.h 22 | public Posix.pid_t getpid (string hostname, in_port_t port, out Memcached.ReturnCode ret); 23 | public Posix.pid_t getpid2 (string hostname, in_port_t port, string username, string password, out Memcached.ReturnCode ret); 24 | // ping.h 25 | public bool ping (string hostname, in_port_t port, out Memcached.ReturnCode ret); 26 | public bool ping2 (string hostname, in_port_t port, string username, string password, out Memcached.ReturnCode ret); 27 | // version.h 28 | public bool version_check (Memcached.Context mmc, uint8 major_version, uint8 minor_version, uint8 micro_version); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /xcb-icccm.vapi: -------------------------------------------------------------------------------- 1 | /* xcb-icccm.vapi 2 | * 3 | * Copyright (C) 2013 Sergio Costas 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | * 19 | * Author: 20 | * Sergio Costas 21 | */ 22 | 23 | using Xcb; 24 | 25 | namespace Xcb { 26 | 27 | [CCode (lower_case_cprefix = "xcb_icccm_", cheader_filename = "xcb/xcb_icccm.h")] 28 | namespace Icccm { 29 | 30 | /** 31 | * A factory method that creates an Icccm object. It allows to call the Xcb Icccm methods 32 | * @param conn The current Xcb connection 33 | * @return the new Icccm object 34 | */ 35 | public static Icccm new(Xcb.Connection conn) { 36 | unowned Xcb.Icccm.Icccm retval = (Xcb.Icccm.Icccm)conn; 37 | return retval; 38 | } 39 | 40 | // The Icccm class is, in fact, a Xcb.Connection class in disguise 41 | [Compact, CCode (cname = "xcb_connection_t", cprefix = "xcb_icccm_")] 42 | public class Icccm : Xcb.Connection { 43 | public GetPropertyCookie get_wm_class(Window window); 44 | public GetPropertyCookie get_wm_class_unchecked(Window window); 45 | } 46 | 47 | [SimpleType] 48 | [CCode (cname = "xcb_icccm_get_wm_class_reply_t", has_type_id = false)] 49 | public struct GetWmClassFromReply { 50 | unowned string instance_name; 51 | unowned string class_name; 52 | } 53 | 54 | public void get_wm_class_from_reply(out GetWmClassFromReply reply, GetPropertyReply input); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /cairosdl.vapi: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2012 Davorin Šego 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | this software and associated documentation files (the "Software"), to deal in 6 | the Software without restriction, including without limitation the rights to 7 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | of the Software, and to permit persons to whom the Software is furnished to do 9 | so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | SOFTWARE. 21 | */ 22 | 23 | [CCode (cprefix = "cairosdl_", lower_case_cprefix = "cairosdl_", cheader_filename = "cairosdl.h")] 24 | namespace CairoSDL { 25 | 26 | public Cairo.Surface surface_create(SDL.Surface sdl_surface); 27 | public SDL.Surface surface_get_target(Cairo.Surface cairo_surface); 28 | public void surface_flush_rects(Cairo.Surface surface, int num_rects, SDL.Rect[] rects); 29 | public void surface_flush_rect(Cairo.Surface surface, int x, int y, int width, int height); 30 | public void surface_flush(Cairo.Surface surface); 31 | public void surface_mark_dirty_rects(Cairo.Surface surface, int num_rects, SDL.Rect[] rects); 32 | public void cairosdl_surface_mark_dirty_rect(Cairo.Surface surface, int x, int y, int width, int height); 33 | public void surface_mark_dirty (Cairo.Surface surface); 34 | public Cairo.Context create(SDL.Surface sdl_surface); 35 | public SDL.Surface get_target(Cairo.Context context); 36 | public void destroy(Cairo.Context context); 37 | 38 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This repository provides Vala bindings to various libraries which do 2 | not provide their own bindings, and for which valac does not provide 3 | bindings. 4 | 5 | ## Rationale 6 | 7 | In most cases it is preferable for libraries to ship their own 8 | bindings (some of the reasons why, as well as information on how to do 9 | so, are at Vala Binding's 10 | [Upstream Guide](https://wiki.gnome.org/Projects/Vala/UpstreamGuide). 11 | Some libraries, however, are unable or unwilling to do so. Other 12 | bindings are distributed with valac, but generally that is reserved 13 | for relatively popular libraries with well structured VAPIs and have 14 | a fairly strong aversion to breaking backwards compatibility. 15 | 16 | Bindings included in this repository are meant to be copied into your 17 | project or used as a git submodule or subtree, and are *not* intended 18 | to be installed system-wide or packaged by distributions. This means 19 | that projects choose when to upgrade bindings instead of having the 20 | bindings upgraded for them when a new version of Vala is installed, 21 | which means backwards incompatible changes are allowed in this 22 | repository. 23 | 24 | Unlike valac, where submissions are carefully screened before 25 | inclusion, the barrier to entry for this repository is quite low. 26 | Pretty much the only thing which would preclude inclusion is a 27 | licensing issue. Contributors need not commit to maintaining the 28 | bindings, preserving backwards compatibility, testing, etc. With that 29 | in mind, this repository provides a good stable, central location for 30 | bindings. 31 | 32 | ## Usage 33 | 34 | Because the bindings shipped in this repository provide no 35 | backwards-compatibility promises, it is designed to be used as a git 36 | submodule. If that is not acceptable (for example, if you don't use 37 | git), it is recommended you simply copy the bindings you need into 38 | your source tree. 39 | 40 | ## Submitting Bindings For Inclusion 41 | 42 | If you have bindings which you would like to see housed in this 43 | repository, simply submit an issue to Gitlab: 44 | 45 | https://gitlab.gnome.org/GNOME/vala-extra-vapis 46 | -------------------------------------------------------------------------------- /libsodium.vapi: -------------------------------------------------------------------------------- 1 | /* libsodium Vala Bindings 2 | * Copyright 2016 Evan Nemerson 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | /* This is *very* incomplete. */ 26 | 27 | [CCode (cheader_filename = "sodium.h", lower_case_cprefix = "sodium_")] 28 | namespace Sodium { 29 | [CCode (lower_case_cprefix = "randombytes_")] 30 | namespace Random { 31 | [CCode (cname = "randombytes_random")] 32 | public static uint32 random (uint32 upper_bound = 0xffffffffU); 33 | public static void buffer (uint8[] buf); 34 | public static int close (); 35 | public static int stir (); 36 | } 37 | 38 | namespace Sign { 39 | [CCode (cname = "crypto_sign_PUBLICKEYBYTES")] 40 | public const size_t PUBLIC_KEY_BYTES; 41 | [CCode (cname = "crypto_sign_SECRETKEYBYTES")] 42 | public const size_t SECRET_KEY_BYTES; 43 | 44 | [CCode (cname = "crypto_sign_keypair")] 45 | public static int key_pair (uint8 public_key[Sodium.Sign.PUBLIC_KEY_BYTES], uint8 secret_key[Sodium.Sign.SECRET_KEY_BYTES]); 46 | } 47 | 48 | public static int init (); 49 | } 50 | -------------------------------------------------------------------------------- /uchardet.vapi: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2010-2013 Giulio Paci 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 | * SUCH DAMAGE. 25 | */ 26 | 27 | [CCode (cprefix = "uchardet_", lower_case_cprefix = "uchardet_")] 28 | namespace UcharDet { 29 | [Compact] 30 | [CCode (cname="uchardet_t",cheader_filename = "uchardet/uchardet.h", free_function="uchardet_delete")] 31 | public class Classifier { 32 | [CCode (cname = "uchardet_new", cheader_filename = "uchardet/uchardet.h")] 33 | public Classifier (); 34 | [CCode (cname = "uchardet_handle_data", cheader_filename = "uchardet/uchardet.h")] 35 | public int handle_data ([CCode (array_length_type = "size_t")] uint8[] buffer); 36 | [CCode (cname = "uchardet_data_end", cheader_filename = "uchardet/uchardet.h")] 37 | public void data_end (); 38 | [CCode (cname = "uchardet_reset", cheader_filename = "uchardet/uchardet.h")] 39 | public void reset (); 40 | [CCode (cname = "uchardet_get_charset", cheader_filename = "uchardet/uchardet.h")] 41 | public unowned string get_charset(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /sdl2-android.vapi: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2016-2020 SDL2 VAPI Authors 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | * 24 | * Authors: 25 | * Mario Daniel Ruiz Saavedra 26 | * Gontzal Uriarte 27 | * Pedro H. Lara Campos 28 | */ 29 | 30 | namespace SDL { 31 | /// 32 | /// Android 33 | /// 34 | [CCode (cheader_filename = "SDL2/SDL_system.h")] 35 | [Compact] 36 | public class Android { 37 | [CCode (cname = "SDL_AndroidGetJNIEnv")] 38 | public static void* get_jnienv (); 39 | 40 | [CCode (cname = "SDL_AndroidGetActivity")] 41 | public static void* get_activity (); 42 | 43 | [CCode (cname = "SDL_AndroidGetInternalStoragePath")] 44 | public static string get_internal_storage_path (); 45 | 46 | [CCode (cname = "SDL_AndroidGetExternalStoragePath")] 47 | public static string get_external_storage_path (); 48 | 49 | [CCode (cname = "SDL_AndroidGetExternalStorageState")] 50 | public static int get_external_storage_state (); 51 | 52 | [CCode (cname = "SDL_ANDROID_EXTERNAL_STORAGE_READ")] 53 | public const int EXTERNAL_STORAGE_READ; 54 | 55 | [CCode (cname = "SDL_ANDROID_EXTERNAL_STORAGE_WRITE")] 56 | public const int EXTERNAL_STORAGE_WRITE; 57 | }// Android 58 | 59 | 60 | } 61 | -------------------------------------------------------------------------------- /libqrencode.vapi: -------------------------------------------------------------------------------- 1 | /* qrencode.vapi 2 | * 3 | * Copyright (C) 2015 Ignacio Casal Quinteiro 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public License 7 | * as published by the Free Software Foundation; either version 2.1 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, but 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 18 | * 02110-1301 USA 19 | * 20 | * As a special exception, if you use inline functions from this file, 21 | * this file does not by itself cause the resulting executable to be 22 | * covered by the GNU Lesser General Public License. 23 | */ 24 | namespace Qrencode { 25 | [CCode (cheader_filename = "qrencode.h", cname = "QRcode", unref_function = "QRcode_free")] 26 | public class QRcode { 27 | [CCode (cname = "QRcode_encodeString")] 28 | public QRcode.encodeString(string digits, int version, EcLevel level, Mode hint, int casesensitive); 29 | 30 | public int version; 31 | public int width; 32 | [CCode (array_length = false)] 33 | public uint8[] data; 34 | } 35 | 36 | [CCode (cheader_filename = "qrencode.h", cname="QRencLevel")] 37 | public enum EcLevel { 38 | [CCode (cname="QR_ECLEVEL_L")] 39 | L, 40 | [CCode (cname="QR_ECLEVEL_M")] 41 | M, 42 | [CCode (cname="QR_ECLEVEL_Q")] 43 | Q, 44 | [CCode (cname="QR_ECLEVEL_H")] 45 | H 46 | } 47 | 48 | [CCode (cheader_filename = "qrencode.h", cname="QRencodeMode")] 49 | public enum Mode { 50 | [CCode (cname="QR_MODE_NUL")] 51 | NUL, 52 | [CCode (cname="QR_MODE_NUM")] 53 | NUM, 54 | [CCode (cname="QR_MODE_AN")] 55 | AN, 56 | [CCode (cname="QR_MODE_8")] 57 | B8, 58 | [CCode (cname="QR_MODE_KANJI")] 59 | KANJI, 60 | [CCode (cname="QR_MODE_STRUCTURE")] 61 | STRUCTURE 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /sdl2-winrt.vapi: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2016-2020 SDL2 VAPI Authors 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | * 24 | * Authors: 25 | * Mario Daniel Ruiz Saavedra 26 | * Gontzal Uriarte 27 | * Pedro H. Lara Campos 28 | */ 29 | 30 | namespace SDL { 31 | 32 | [CCode (cheader_filename = "SDL2/SDL_system.h")] 33 | [Compact] 34 | public class WinRt { 35 | [CCode (cname = "SDL_WinRT_Path", cprefix = "SDL_WINRT_PATH_")] 36 | public enum WinRTPath { 37 | /** 38 | * The installed app's root directory.<
> 39 | * Files here are likely to be read-only. 40 | */ 41 | INSTALLED_LOCATION, 42 | /** 43 | * The app's local data store. Files may be written here 44 | */ 45 | LOCAL_FOLDER, 46 | /** 47 | * The app's roaming data store. Unsupported on Windows Phone.<
> 48 | * Files written here may be copied to other machines via a network 49 | * connection. 50 | */ 51 | ROAMING_FOLDER, 52 | /** 53 | * The app's temporary data store. Unsupported on Windows Phone.<
> 54 | * Files written here may be deleted at any time. 55 | */ 56 | TEMP_FOLDER; 57 | 58 | [CCode (cname = "SDL_WinRTGetFSPathUTF8")] 59 | public unowned string get_fs_path (); 60 | } 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /samplerate.vapi: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2012 Davorin Šego 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | this software and associated documentation files (the "Software"), to deal in 6 | the Software without restriction, including without limitation the rights to 7 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | of the Software, and to permit persons to whom the Software is furnished to do 9 | so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | SOFTWARE. 21 | */ 22 | 23 | 24 | [CCode (cheader_filename = "samplerate.h")] 25 | namespace Samplerate { 26 | [CCode (cprefix = "")] 27 | public enum ConverterType { 28 | SRC_SINC_BEST_QUALITY, 29 | SRC_SINC_MEDIUM_QUALITY, 30 | SRC_SINC_FASTEST, 31 | SRC_ZERO_ORDER_HOLD, 32 | SRC_LINEAR 33 | } 34 | [Compact] 35 | [CCode (cname = "SRC_DATA", cprefix = "", destroy_function = "")] 36 | public struct Data { 37 | [CCode (array_length = false)] 38 | public float[] data_in; 39 | [CCode (array_length = false)] 40 | public float[] data_out ; 41 | public long input_frames; 42 | public long output_frames; 43 | public long input_frames_used; 44 | public long output_frames_gen; 45 | public int end_of_input; 46 | public double src_ratio; 47 | } 48 | [Compact] 49 | [CCode (cname = "SRC_STATE", free_function = "src_delete", cprefix = "src_")] 50 | public class SRC { 51 | public static string strerror(int error); 52 | [CCode (cname = "src_new")] 53 | public SRC(ConverterType type, int channels, int *error); 54 | public int process(Data *data); 55 | public int reset(); 56 | public int set_ratio(double new_ratio); 57 | public static int is_valid_ratio(double ratio); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /libmatheval.vapi: -------------------------------------------------------------------------------- 1 | /* matheval Vala Bindings 2 | * Copyright 2011 Fabian Deutsch 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | [CCode (cprefix = "", lower_case_cprefix = "", cheader_filename = "matheval.h")] 26 | namespace matheval 27 | { 28 | [Compact] 29 | [CCode (cname = "void", free_function = "evaluator_destroy")] 30 | public class Evaluator 31 | { 32 | public static Evaluator create (string s); 33 | 34 | /* 35 | * FIXME a bit hackish, as names.length == values.length 36 | * is not forced. 37 | */ 38 | public double evaluate ( 39 | [CCode (array_length_pos = 0)] string[] names, 40 | [CCode (array_length = false)] double[] values); 41 | 42 | public unowned string get_string (); 43 | 44 | public void get_variables ( 45 | [CCode (array_length_pos = 1)] out unowned string[] names); 46 | 47 | public Evaluator derivative (string name); 48 | 49 | public double evaluate_x (double x); 50 | public double evaluate_x_y (double x, double y); 51 | public double evaluate_x_y_z (double x, double y, double z); 52 | 53 | public Evaluator derivative_x (); 54 | public Evaluator derivative_y (); 55 | public Evaluator derivative_z (); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /sdl2-windows.vapi: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2016-2020 SDL2 VAPI Authors 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | * 24 | * Authors: 25 | * Mario Daniel Ruiz Saavedra 26 | * Gontzal Uriarte 27 | * Pedro H. Lara Campos 28 | */ 29 | 30 | namespace SDL { 31 | /// 32 | /// Windows 33 | /// 34 | [CCode (cname = "IDirect3DDevice9", cheader_filename = "d3d9.h")] 35 | [Compact] 36 | public struct IDirect3DDevice9 {} 37 | 38 | [CCode (cheader_filename = "SDL2/SDL_system.h")] 39 | [Compact] 40 | public class Windows { 41 | [CCode (cname = "SDL_Direct3D9GetAdapterIndex")] 42 | public static int get_adapter_index (int display_index); 43 | 44 | [CCode (cname = "SDL_RenderGetD3D9Device")] 45 | public static IDirect3DDevice9* get_render_device (Video.Renderer renderer); 46 | 47 | [CCode (cname = "SDL_DXGIGetOutputInfo")] 48 | public static void dxgi_get_output_info (int display_index, out int adapter_index, out int output_index); 49 | 50 | [CCode (cname = "SDL_WindowsMessageHook", has_target= true, delegate_target_pos = 0.0, cheader_filename = "SDL2/SDL_system.h")] 51 | public delegate void WindowsMessageHook (void* hWnd, uint message, uint64 w_param, int64 l_param); 52 | 53 | [CCode (cname = "SDL_SetWindowsMessageHook", cheader_filename = "SDL2/SDL_system.h")] 54 | public static void set_windows_message_hook (WindowsMessageHook hook); 55 | 56 | }// Windows 57 | 58 | } 59 | -------------------------------------------------------------------------------- /kiss_fft.vapi: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2012 Davorin Šego 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | this software and associated documentation files (the "Software"), to deal in 6 | the Software without restriction, including without limitation the rights to 7 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | of the Software, and to permit persons to whom the Software is furnished to do 9 | so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | SOFTWARE. 21 | */ 22 | 23 | [CCode (cprefix = "kiss_fft_", lower_case_cprefix = "kiss_fft_", cheader_filename = "kiss_fft.h")] 24 | namespace KissFFT { 25 | 26 | [SimpleType] 27 | public struct scalar : float {} 28 | 29 | [CCode (cname = "kiss_fft_cpx")] 30 | public struct Cpx { 31 | scalar r; 32 | scalar i; 33 | } 34 | 35 | [SimpleType] 36 | [CCode (cname = "kiss_fft_cfg", destroy_function = "kiss_fft_free")] 37 | public struct Cfg {} 38 | 39 | public Cfg alloc(int nfft, bool inverse_fft, void* mem, size_t* lenmem); 40 | 41 | [CCode (cname = "kiss_fft")] 42 | public void transform(Cfg cfg, Cpx* fin, Cpx* fout); 43 | 44 | [CCode (cname = "kiss_fft_stride")] 45 | public void transform_stride(Cfg cfg, Cpx* fin, Cpx* fout, int fin_stride); 46 | 47 | public void cleanup(); 48 | public int next_fast_size(int n); 49 | // public int kiss_fftr_next_fast_size_real(n) 50 | 51 | } 52 | 53 | [CCode (cprefix = "kiss_fftr_", lower_case_cprefix = "kiss_fftr_", cheader_filename = "tools/kiss_fftr.h")] 54 | namespace KissFFTR { 55 | 56 | [SimpleType] 57 | [CCode (cname = "kiss_fftr_cfg", destroy_function = "kiss_fftr_free")] 58 | public struct Cfg {} 59 | 60 | public Cfg alloc(int nfft, bool inverse_fft, void* mem, size_t* lenmem); 61 | 62 | [CCode (cname = "kiss_fftr")] 63 | public void transform(Cfg cfg, KissFFT.scalar* timedata, KissFFT.Cpx* freqdata); 64 | [CCode (cname = "kiss_fftri")] 65 | public void transform_inverse(Cfg cfg, KissFFT.Cpx* freqdata, KissFFT.scalar* timedata); 66 | 67 | } 68 | 69 | -------------------------------------------------------------------------------- /tcc.vapi: -------------------------------------------------------------------------------- 1 | /* tcc Vala Bindings 2 | * Copyright 2011 Fabian Deutsch 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | [CCode (lower_case_cprefix = "tcc_", cheader_filename = "libtcc.h")] 26 | namespace TCC { 27 | 28 | public enum OutputType { 29 | MEMORY, 30 | EXE, 31 | DLL, 32 | OBJ, 33 | PREPROCESS 34 | } 35 | 36 | [CCode (instance_pos=0.9)] 37 | public delegate void ErrorFunction (string msg); 38 | 39 | [Compact] 40 | [CCode (cprefix="tcc_",free_function="tcc_delete")] 41 | public class State { 42 | [CCode (cname = "tcc_new")] 43 | public State (); 44 | 45 | public void enable_debug (); 46 | public void set_error_func([CCode (delegate_target_pos=0.9)] ErrorFunction error_func); 47 | 48 | /* preprocessor */ 49 | public int add_include_path (string pathname); 50 | public int add_sysinclude_path (string pathname); 51 | public void define_symbol (string sym, string val); 52 | public void undefine_symbol (string sym); 53 | 54 | /* compiler */ 55 | public int add_file (string filename); 56 | public int compile_string (string buf); 57 | 58 | /* linking */ 59 | public int set_output_type (OutputType type); 60 | 61 | public int add_library_path (string pathname); 62 | public int add_library (string libraryname); 63 | public int add_symbol (string name, void* val); 64 | public int output_file (string filename); 65 | public int run ([CCode (array_length_pos="-1")] string[]? argv); 66 | public int relocate (void* ptr); 67 | public void* get_symbol (string name); 68 | public void set_lib_path (string path); 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /uuid.vapi: -------------------------------------------------------------------------------- 1 | /* libuuid Vala Bindings 2 | * Copyright 2014 Evan Nemerson 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | [CCode (cheader_filename = "uuid.h", lower_case_cprefix = "uuid_")] 26 | namespace UUID { 27 | [CCode (cname = "int", has_type_id = false)] 28 | public enum Variant { 29 | NCS, 30 | DCE, 31 | MICROSOFT, 32 | OTHER 33 | } 34 | 35 | [CCode (cname = "int", has_type_id = false)] 36 | public enum Type { 37 | DCE_TIME, 38 | DCE_RANDOM 39 | } 40 | 41 | public static void clear ([CCode (array_length = false)] uint8 uu[16]); 42 | public static void copy (uint8 dst[16], uint8 src[16]); 43 | 44 | public static void generate ([CCode (array_length = false)] uint8 @out[16]); 45 | public static void generate_random ([CCode (array_length = false)] uint8 @out[16]); 46 | public static void generate_time ([CCode (array_length = false)] uint8 @out[16]); 47 | public static int generate_time_safe ([CCode (array_length = false)] uint8 @out[16]); 48 | 49 | public static bool is_null ([CCode (array_length = false)] uint8 uu[16]); 50 | public static int compare ([CCode (array_length = false)] uint8 uu1[16], [CCode (array_length = false)] uint8 uu2[16]); 51 | 52 | public static int parse (string in, [CCode (array_length = false)] uint8 uu[16]); 53 | 54 | public static void unparse ([CCode (array_length = false)] uint8 uu[16], [CCode (array_length = false)] char @out[37]); 55 | public static void unparse_lower ([CCode (array_length = false)] uint8 uu[16], [CCode (array_length = false)] char @out[37]); 56 | public static void unparse_upper ([CCode (array_length = false)] uint8 uu[16], [CCode (array_length = false)] char @out[37]); 57 | 58 | public static time_t time ([CCode (array_length = false)] uint8 uu[16], out Posix.timeval ret_tv); 59 | public static UUID.Type type ([CCode (array_length = false)] uint8 uu[16]); 60 | public static UUID.Variant variant ([CCode (array_length = false)] uint8 uu[16]); 61 | } 62 | -------------------------------------------------------------------------------- /xcb-damage.vapi: -------------------------------------------------------------------------------- 1 | /* 2 | * This library is free software; you can redistribute it and/or 3 | * modify it under the terms of the GNU Lesser General Public 4 | * License as published by the Free Software Foundation; either 5 | * version 2.1 of the License, or (at your option) any later version. 6 | * 7 | * This library is distributed in the hope that it will be useful, 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 | * Lesser General Public License for more details. 11 | * 12 | * You should have received a copy of the GNU Lesser General Public 13 | * License along with this library; if not, write to the Free Software 14 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 15 | */ 16 | 17 | using Xcb; 18 | 19 | namespace Xcb { 20 | 21 | [CCode (cprefix = "xcb_damage_", cheader_filename = "xcb/damage.h")] 22 | namespace Damage { 23 | public static Connection get_connection (Xcb.Connection c) { 24 | return (Connection) c; 25 | } 26 | 27 | [Compact] 28 | [CCode (cname = "xcb_connection_t", cprefix = "xcb_damage_", unref_function = "")] 29 | public class Connection : Xcb.Connection { 30 | public QueryVersionCookie query_version (uint32 client_major_version, uint32 client_minor_version); 31 | public QueryVersionCookie query_version_unchecked (uint32 client_major_version, uint32 client_minor_version); 32 | public QueryVersionReply query_version_reply (QueryVersionCookie cookie, out Xcb.GenericError? e = null); 33 | 34 | public VoidCookie create_checked (Damage damage, Xcb.Drawable drawable, ReportLevel level); 35 | public VoidCookie create (Damage damage, Xcb.Drawable drawable, ReportLevel level); 36 | 37 | public VoidCookie destroy_checked (Damage damage); 38 | public VoidCookie destroy (Damage damage); 39 | 40 | public VoidCookie subtract_checked (Damage damage, XFixes.Region repair, XFixes.Region parts); 41 | public VoidCookie subtract (Damage damage, XFixes.Region repair, XFixes.Region parts); 42 | 43 | public VoidCookie add_checked (Damage damage, Xcb.Drawable drawable, XFixes.Region region); 44 | public VoidCookie add (Damage damage, Xcb.Drawable drawable, XFixes.Region region); 45 | } 46 | 47 | [SimpleType] 48 | [CCode (cname = "xcb_damage_damage_t", has_type_id = false)] 49 | public struct Damage : uint32 { 50 | } 51 | 52 | [CCode (cname = "xcb_damage_report_level_t", has_type_id = false)] 53 | public enum ReportLevel 54 | { 55 | RAW_RECTANGLES, 56 | DELTA_RECTANGLES, 57 | BOUNDING_BOX, 58 | NON_EMPTY 59 | } 60 | 61 | [SimpleType] 62 | [IntegerType (rank = 9)] 63 | [CCode (cname = "xcb_damage_query_version_cookie_t", has_type_id = false)] 64 | public struct QueryVersionCookie { 65 | } 66 | 67 | [Compact] 68 | [CCode (cname = "xcb_damage_query_version_reply_t", ref_function = "", unref_function = "free")] 69 | public class QueryVersionReply : Xcb.GenericReply { 70 | public uint32 major_version; 71 | public uint32 minor_version; 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /xcb-xtest.vapi: -------------------------------------------------------------------------------- 1 | /* 2 | * This library is free software; you can redistribute it and/or 3 | * modify it under the terms of the GNU Lesser General Public 4 | * License as published by the Free Software Foundation; either 5 | * version 2.1 of the License, or (at your option) any later version. 6 | * 7 | * This library is distributed in the hope that it will be useful, 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 | * Lesser General Public License for more details. 11 | * 12 | * You should have received a copy of the GNU Lesser General Public 13 | * License along with this library; if not, write to the Free Software 14 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 15 | */ 16 | 17 | using Xcb; 18 | 19 | namespace Xcb { 20 | 21 | [CCode (cprefix = "xcb_test_", cheader_filename = "xcb/xtest.h")] 22 | namespace XTest { 23 | public static Connection get_connection (Xcb.Connection c) { 24 | return (Connection) c; 25 | } 26 | 27 | [Compact] 28 | [CCode (cname = "xcb_connection_t", cprefix = "xcb_test_", unref_function = "")] 29 | public class Connection : Xcb.Connection { 30 | public GetVersionCookie get_version (uint8 major_version, uint16 minor_version); 31 | public GetVersionCookie get_version_unchecked (uint8 major_version, uint16 minor_version); 32 | public GetVersionReply get_version_reply (GetVersionCookie cookie, out Xcb.GenericError? e = null); 33 | 34 | public CompareCursorCookie compare_cursor (Xcb.Window window, Xcb.Cursor cursor); 35 | public CompareCursorCookie compare_cursor_unchecked (Xcb.Window window, Xcb.Cursor cursor); 36 | public CompareCursorReply compare_cursor_reply (CompareCursorCookie cookie, out Xcb.GenericError? e = null); 37 | 38 | public VoidCookie fake_input_checked (uint8 type, uint8 detail, uint32 time, Xcb.Window root, int16 rootX, int16 rootY, uint8 device_id); 39 | public VoidCookie fake_input (uint8 type, uint8 detail, uint32 time, Xcb.Window root, int16 rootX, int16 rootY, uint8 device_id); 40 | 41 | public VoidCookie grab_control_checked (bool impervious); 42 | public VoidCookie grab_control (bool impervious); 43 | } 44 | 45 | [SimpleType] 46 | [IntegerType (rank = 9)] 47 | [CCode (cname = "xcb_test_get_version_cookie_t", has_type_id = false)] 48 | public struct GetVersionCookie { 49 | } 50 | 51 | [Compact] 52 | [CCode (cname = "xcb_test_get_version_reply_t", ref_function = "", unref_function = "free")] 53 | public class GetVersionReply : Xcb.GenericReply { 54 | public uint8 major_version; 55 | public uint16 minor_version; 56 | } 57 | 58 | [SimpleType] 59 | [IntegerType (rank = 9)] 60 | [CCode (cname = "xcb_test_compare_cursor_cookie_t", has_type_id = false)] 61 | public struct CompareCursorCookie { 62 | } 63 | 64 | [Compact] 65 | [CCode (cname = "xcb_test_compare_cursor_reply_t", ref_function = "", unref_function = "free")] 66 | public class CompareCursorReply : Xcb.GenericReply { 67 | public bool same; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /aubio.vapi: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2012 Davorin Šego 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | this software and associated documentation files (the "Software"), to deal in 6 | the Software without restriction, including without limitation the rights to 7 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | of the Software, and to permit persons to whom the Software is furnished to do 9 | so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | SOFTWARE. 21 | */ 22 | 23 | [CCode (lower_case_cprefix = "aubio_", cheader_filename = "aubio/aubio.h")] 24 | namespace Aubio { 25 | [CCode (cname = "smpl_t")] 26 | [FloatingType (rank = 2)] 27 | public struct Sample : float {} 28 | [CCode (cname = "lsmp_t")] 29 | [FloatingType (rank = 2)] 30 | public struct LongSample : double {} 31 | [CCode (cname = "uint_t")] 32 | public struct Uint : uint {} 33 | [CCode (cname = "sint_t")] 34 | public struct Int : int {} 35 | 36 | /* Buffer type used to store real data. */ 37 | [Compact] 38 | [CCode (cname = "fvec_t", free_function = "del_fvec")] 39 | public class Fvector { 40 | [CCode (cname = "new_fvec")] 41 | public Fvector(Uint length, Uint channels); 42 | public Uint channels; 43 | [CCode (array_length_cname = "length")] 44 | public Sample[,] data; /* length * channels */ 45 | } 46 | 47 | [Compact] 48 | [CCode (cname = "aubio_pitchdetection_t", cprefix = "aubio_pitchdetection_", free_function = "del_aubio_pitchdetection")] 49 | public class Pitch { 50 | [CCode (cname = "new_aubio_pitchdetection")] 51 | public Pitch(Uint bufsize, Uint hopsize, Uint channels, Uint samplerate, Type type, Mode mode); 52 | [CCode (cname = "aubio_pitchdetection")] 53 | public Sample @do(Fvector ibuf); 54 | [CCode (cname = "aubio_pitchdetection_type")] 55 | [Flags] 56 | public enum Type { 57 | [CCode (cname = "aubio_pitch_yin")] YIN, 58 | [CCode (cname = "aubio_pitch_mcomb")] MULTI_COMB, 59 | [CCode (cname = "aubio_pitch_schmitt")] SCHMITT, 60 | [CCode (cname = "aubio_pitch_fcomb")] FAST_COMB, 61 | [CCode (cname = "aubio_pitch_yinfft")] YIN_FFT 62 | } 63 | [CCode (cname = "aubio_pitchdetection_mode")] 64 | [Flags] 65 | public enum Mode { 66 | [CCode (cname = "aubio_pitchm_freq")] FREQUENCY, 67 | [CCode (cname = "aubio_pitchm_midi")] MIDI, 68 | [CCode (cname = "pitchm_cent")] CENT, 69 | [CCode (cname = "aubio_pitchm_bin")] BIN, 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /magic.vapi: -------------------------------------------------------------------------------- 1 | /* magic.vapi 2 | * 3 | * Copyright (C) 2012 Nikolay Orlyuk 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | * 19 | * Author: 20 | * Nikolay Orlyuk 21 | */ 22 | 23 | namespace Magic { 24 | [SimpleType] 25 | [CCode (cname = "magic_t", destroy_function = "magic_close", lower_case_cprefix = "magic_", cheader_filename = "magic.h")] 26 | public struct Magic { 27 | [CCode (cname = "magic_open")] 28 | public Magic(Flags flags = Flags.NONE); 29 | public string? error { 30 | [CCode (cname = "magic_error")] 31 | get; 32 | } 33 | public int errno { 34 | [CCode (cname = "magic_errno")] 35 | get; 36 | } 37 | 38 | public unowned string? descriptor(int fd); 39 | public unowned string? file(string filename); 40 | public unowned string? buffer(uint8[]? buffer); 41 | public int flags { 42 | [CCode (cname = "magic_setflags")] 43 | set; 44 | } 45 | 46 | public int check(string filename); 47 | public int compile(string filename); 48 | public int list(string filename); 49 | public int load(string? filename = null); 50 | } 51 | 52 | [Flags] 53 | [CCode (cprefix = "MAGIC_", cname = "int")] 54 | public enum Flags { 55 | NONE, /* No flags */ 56 | DEBUG, /* Turn on debugging */ 57 | SYMLINK, /* Follow symlinks */ 58 | COMPRESS, /* Check inside compressed files */ 59 | DEVICES, /* Look at the contents of devices */ 60 | MIME_TYPE, /* Return the MIME type */ 61 | CONTINUE, /* Return all matches */ 62 | CHECK, /* Print warnings to stderr */ 63 | PRESERVE_ATIME, /* Restore access time on exit */ 64 | RAW, /* Don't translate unprintable chars */ 65 | ERROR, /* Handle ENOENT etc as real errors */ 66 | MIME_ENCODING, /* Return the MIME encoding */ 67 | MIME, 68 | APPLE, /* Return the Apple creator and type */ 69 | 70 | NO_CHECK_COMPRESS, /* Don't check for compressed files */ 71 | NO_CHECK_TAR, /* Don't check for tar files */ 72 | NO_CHECK_SOFT, /* Don't check magic entries */ 73 | NO_CHECK_APPTYPE, /* Don't check application type */ 74 | NO_CHECK_ELF, /* Don't check for elf details */ 75 | NO_CHECK_TEXT, /* Don't check for text files */ 76 | NO_CHECK_CDF, /* Don't check for cdf files */ 77 | NO_CHECK_TOKENS, /* Don't check tokens */ 78 | NO_CHECK_ENCODING, /* Don't check text encodings */ 79 | 80 | NO_CHECK_BUILTIN 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /pa_ringbuffer.vapi: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2012 Davorin Šego 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | this software and associated documentation files (the "Software"), to deal in 6 | the Software without restriction, including without limitation the rights to 7 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | of the Software, and to permit persons to whom the Software is furnished to do 9 | so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | SOFTWARE. 21 | */ 22 | 23 | [CCode (cprefix = "Pa", lower_case_cprefix = "", cheader_filename = "pa_ringbuffer.h")] 24 | namespace PortAudio.Util { 25 | 26 | [CCode (cname = "ring_buffer_size_t")] 27 | public struct size_t : long {} 28 | 29 | [Compact] 30 | [CCode (cname = "PaUtilRingBuffer", destroy_function = "")] 31 | public struct RingBuffer { 32 | 33 | [CCode (cname = "bufferSize")] 34 | public size_t buffer_size; 35 | [CCode (cname = "readIndex")] 36 | public size_t read_index; 37 | [CCode (cname = "bigMask")] 38 | public size_t big_mask; 39 | [CCode (cname = "smallMask")] 40 | public size_t small_mask; 41 | [CCode (cname = "elementSizeBytes")] 42 | public size_t element_size_bytes; 43 | public uint8[] buffer; 44 | 45 | [CCode (cname = "PaUtil_InitializeRingBuffer")] 46 | public size_t initialize(size_t element_size_bytes, 47 | size_t element_count, 48 | void* data_ptr); 49 | 50 | [CCode (cname = "PaUtil_FlushRingBuffer")] 51 | public void flush(); 52 | 53 | [CCode (cname = "PaUtil_GetRingBufferWriteAvailable")] 54 | public size_t get_write_available(); 55 | [CCode (cname = "PaUtil_GetRingBufferReadAvailable")] 56 | public size_t get_read_available(); 57 | 58 | [CCode (cname = "PaUtil_WriteRingBuffer")] 59 | public size_t write(void* data, size_t element_count); 60 | [CCode (cname = "PaUtil_ReadRingBuffer")] 61 | public size_t read(void* data, size_t element_count); 62 | 63 | [CCode (cname = "PaUtil_GetRingBufferWriteRegions")] 64 | public size_t get_write_regions(size_t element_count, 65 | void* data_ptr1, size_t *size_ptr1, 66 | void* data_ptr2, size_t *size_ptr2); 67 | [CCode (cname = "PaUtil_GetRingBufferReadRegions")] 68 | public size_t get_read_regions(size_t element_count, 69 | void* data_ptr1, size_t *size_ptr1, 70 | void* data_ptr2, size_t *size_ptr2); 71 | 72 | [CCode (cname = "PaUtil_AdvanceRingBufferWriteIndex")] 73 | public size_t advance_write_index(size_t element_count); 74 | [CCode (cname = "PaUtil_AdvanceRingBufferReadIndex")] 75 | public size_t advance_read_index(size_t element_count); 76 | 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /xcb-composite.vapi: -------------------------------------------------------------------------------- 1 | /* 2 | * This library is free software; you can redistribute it and/or 3 | * modify it under the terms of the GNU Lesser General Public 4 | * License as published by the Free Software Foundation; either 5 | * version 2.1 of the License, or (at your option) any later version. 6 | * 7 | * This library is distributed in the hope that it will be useful, 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 | * Lesser General Public License for more details. 11 | * 12 | * You should have received a copy of the GNU Lesser General Public 13 | * License along with this library; if not, write to the Free Software 14 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 15 | */ 16 | 17 | using Xcb; 18 | 19 | namespace Xcb { 20 | 21 | [CCode (cprefix = "xcb_composite_", cheader_filename = "xcb/composite.h")] 22 | namespace Composite { 23 | public static Connection get_connection (Xcb.Connection c) { 24 | return (Connection) c; 25 | } 26 | 27 | [Compact] 28 | [CCode (cname = "xcb_connection_t", cprefix = "xcb_composite_", unref_function = "")] 29 | public class Connection : Xcb.Connection { 30 | public QueryVersionCookie query_version (uint32 major_version, uint32 minor_version); 31 | public QueryVersionCookie query_version_unchecked (uint32 major_version, uint32 minor_version); 32 | public QueryVersionReply? query_version_reply (QueryVersionCookie cookie, out Xcb.GenericError? e = null); 33 | 34 | public VoidCookie redirect_window_checked (Xcb.Window window, uint8 update); 35 | public VoidCookie redirect_window (Xcb.Window window, uint8 update); 36 | 37 | public VoidCookie redirect_subwindows_checked (Xcb.Window window, uint8 update); 38 | public VoidCookie redirect_subwindows (Xcb.Window window, uint8 update); 39 | 40 | public VoidCookie unredirect_window_checked (Xcb.Window window, uint8 update); 41 | public VoidCookie unredirect_window (Xcb.Window window, uint8 update); 42 | 43 | public VoidCookie unredirect_subwindows_checked (Xcb.Window window, uint8 update); 44 | public VoidCookie unredirect_subwindows (Xcb.Window window, uint8 update); 45 | 46 | public VoidCookie create_region_from_border_clip_checked (Xcb.XFixes.Region region, Xcb.Window window); 47 | public VoidCookie create_region_from_border_clip (Xcb.XFixes.Region region, Xcb.Window window); 48 | 49 | public VoidCookie name_window_pixmap_checked (Xcb.Window window, Xcb.Pixmap pixmap); 50 | public VoidCookie name_window_pixmap (Xcb.Window window, Xcb.Pixmap pixmap); 51 | 52 | public GetOverlayWindowCookie get_overlay_window (Xcb.Window window); 53 | public GetOverlayWindowCookie get_overlay_window_unchecked (Xcb.Window window); 54 | public GetOverlayWindowReply? get_overlay_window_reply (GetOverlayWindowCookie cookie, out Xcb.GenericError? e = null); 55 | 56 | public VoidCookie release_overlay_window_checked (Xcb.Window window); 57 | public VoidCookie release_overlay_window (Xcb.Window window); 58 | } 59 | 60 | [SimpleType] 61 | [IntegerType (rank = 9)] 62 | [CCode (cname = "xcb_composite_query_version_cookie_t", has_type_id = false)] 63 | public struct QueryVersionCookie { 64 | } 65 | 66 | [Compact] 67 | [CCode (cname = "xcb_composite_query_version_reply_t", ref_function = "", unref_function = "free")] 68 | public class QueryVersionReply : Xcb.GenericReply { 69 | public uint32 major_version; 70 | public uint32 minor_version; 71 | } 72 | 73 | [SimpleType] 74 | [IntegerType (rank = 9)] 75 | [CCode (cname = "xcb_composite_get_overlay_window_cookie_t", has_type_id = false)] 76 | public struct GetOverlayWindowCookie { 77 | } 78 | 79 | [Compact] 80 | [CCode (cname = "xcb_composite_get_overlay_window_reply_t", ref_function = "", unref_function = "free")] 81 | public class GetOverlayWindowReply : Xcb.GenericReply { 82 | public Xcb.Window overlay_win; 83 | } 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /libsystemd-journal.vapi: -------------------------------------------------------------------------------- 1 | [CCode (lower_case_cprefix = "sd_")] 2 | namespace Systemd { 3 | [Compact, CCode (cheader_filename = "systemd/sd-journal.h", free_function = "sd_journal_close")] 4 | public class Journal { 5 | [CCode (cname = "int", cprefix = "LOG_", lower_case_cprefix = "sd_journal_", cheader_filename = "systemd/sd-journal.h,syslog.h", has_type_id = false)] 6 | public enum Priority { 7 | EMERG, 8 | ALERT, 9 | CRIT, 10 | ERR, 11 | WARNING, 12 | NOTICE, 13 | INFO, 14 | DEBUG; 15 | 16 | [PrintfFormat] 17 | public int print (string format, ...); 18 | public int printv (string format, va_list ap); 19 | 20 | [CCode (instance_pos = 1.5)] 21 | public int stream_fd (string identifier, bool level_prefix); 22 | [CCode (cname = "_vala_sd_journal_stream")] 23 | public GLib.FileStream? stream (string identifier, bool level_prefix) { 24 | int fd = this.stream_fd (identifier, level_prefix); 25 | return (fd < 0) ? null : GLib.FileStream.fdopen (fd, "w"); 26 | } 27 | } 28 | 29 | public static int send (string format, ...); 30 | public static int sendv (Posix.iovector[] iov); 31 | public static int perror (string message); 32 | 33 | [Flags, CCode (cname = "int", cprefix = "SD_JOURNAL_", has_type_id = false)] 34 | public enum OpenFlags { 35 | LOCAL_ONLY, 36 | RUNTIME_ONLY, 37 | SYSTEM, 38 | CURRENT_USER 39 | } 40 | 41 | public static int open (out Systemd.Journal ret, Systemd.Journal.OpenFlags flags); 42 | public static int open_directory (out Systemd.Journal ret, string path, Systemd.Journal.OpenFlags flags); 43 | public static int open_files (out Systemd.Journal ret, [CCode (array_length = false, array_null_terminated = true)] string[] paths, Systemd.Journal.OpenFlags flags); 44 | 45 | public int previous (); 46 | public int next (); 47 | 48 | public int previous_skip (uint64 skip); 49 | public int next_skip (uint64 skip); 50 | 51 | public int get_realtime_usec (out uint64 ret); 52 | public int get_monotonic_usec (out uint64 ret, out Systemd.Id128 ret_boot_id); 53 | 54 | public int set_data_threshold (size_t sz); 55 | public int get_data_threshold (out size_t sz); 56 | 57 | public int get_data (string field, [CCode (type = "const void**", array_length_type = "size_t")] out unowned uint8[] data); 58 | public int enumerate_data ([CCode (type = "const void**", array_length_type = "size_t")] out unowned uint8[] data); 59 | public void restart_data (); 60 | 61 | public int add_match ([CCode (array_length_type = "size_t")] uint8[] data); 62 | public int add_disjunction (); 63 | public int add_conjunction (); 64 | public void flush_matches (); 65 | 66 | public int seek_head (); 67 | public int seek_tail (); 68 | public int seek_monotonic_usec (Systemd.Id128 boot_id, uint64 usec); 69 | public int seek_realtime_usec (uint64 usec); 70 | public int seek_cursor (string cursor); 71 | 72 | public int get_cursor (out unowned string cursor); 73 | public int test_cursor (string cursor); 74 | 75 | public int get_cutoff_realtime_usec (out uint64 from, out uint64 to); 76 | public int get_cutoff_monotonic_usec (Systemd.Id128 boot_id, out uint64 from, out uint64 to); 77 | 78 | public int get_usage (out uint64 bytes); 79 | 80 | public int query_unique (string field); 81 | public int enumerate_unique ([CCode (type = "const void**", array_length_type = "size_t")] out unowned uint8[] data); 82 | public void restart_unique (); 83 | 84 | public int get_fd (); 85 | public int get_events (); 86 | public int get_timeout (out uint64 timeout_usec); 87 | public int process (); 88 | public int wait (uint64 timeout_usec); 89 | public int reliable_fd (); 90 | 91 | public int get_catalog (out unowned string text); 92 | public int get_catalog_for_message_id (Systemd.Id128 id, out unowned string ret); 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /pwquality.vapi: -------------------------------------------------------------------------------- 1 | /* libpwquality Vala Bindings 2 | * Copyright 2013 Evan Nemerson 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | [CCode (lower_case_cprefix = "pwquality_", cheader_filename = "pwquality.h")] 26 | namespace PasswordQuality { 27 | [CCode (cname = "int", cprefix = "PWQ_SETTING_", has_type_id = false)] 28 | public enum Setting { 29 | DIFF_OK, 30 | MIN_LENGTH, 31 | DIG_CREDIT, 32 | UP_CREDIT, 33 | LOW_CREDIT, 34 | OTH_CREDIT, 35 | MIN_CLASS, 36 | MAX_REPEAT, 37 | DICT_PATH, 38 | MAX_CLASS_REPEAT, 39 | GECOS_CHECK, 40 | BAD_WORDS, 41 | MAX_SEQUENCE 42 | } 43 | 44 | [CCode (cname = "int", cprefix = "PWQ_ERROR_", has_type_id = false)] 45 | public enum Error { 46 | SUCCESS, 47 | FATAL_FAILURE, 48 | INTEGER, 49 | CFGFILE_OPEN, 50 | CFGFILE_MALFORMED, 51 | UNKNOWN_SETTING, 52 | NON_INT_SETTING, 53 | NON_STR_SETTING, 54 | MEM_ALLOC, 55 | TOO_SIMILAR, 56 | MIN_DIGITS, 57 | MIN_UPPERS, 58 | MIN_LOWERS, 59 | MIN_OTHERS, 60 | MIN_LENGTH, 61 | PALINDROME, 62 | CASE_CHANGES_ONLY, 63 | ROTATED, 64 | MIN_CLASSES, 65 | MAX_CONSECUTIVE, 66 | EMPTY_PASSWORD, 67 | SAME_PASSWORD, 68 | CRACKLIB_CHECK, 69 | RNG, 70 | GENERATION_FAILED, 71 | USER_CHECK, 72 | GECOS_CHECK, 73 | MAX_CLASS_REPEAT, 74 | BAD_WORDS, 75 | MAX_SEQUENCE; 76 | 77 | [CCode (cname = "pwquality_strerror", instance_pos = 2.5)] 78 | private void* strerror (void* buf, size_t len, void* auxerror); 79 | 80 | public string to_string (void* auxerror = null) { 81 | string ret = null; 82 | string** retp = &ret; 83 | *retp = GLib.malloc (PasswordQuality.MAX_ERROR_MESSAGE_LEN); 84 | void* res = this.strerror (*retp, PasswordQuality.MAX_ERROR_MESSAGE_LEN, auxerror); 85 | 86 | if ( res != *retp ) { 87 | GLib.Memory.copy (*retp, res, ((string) res).length + 1); 88 | } 89 | 90 | return ret; 91 | } 92 | } 93 | 94 | [CCode (cname = "PWQ_MAX_ENTROPY_BITS")] 95 | public const int MAX_ENTROPY_BITS; 96 | [CCode (cname = "PWQ_MIN_ENTROPY_BITS")] 97 | public const int MIN_ENTROPY_BITS; 98 | [CCode (cname = "PWQ_MAX_ERROR_MESSAGE_LEN")] 99 | public const int MAX_ERROR_MESSAGE_LEN; 100 | 101 | [Compact, CCode (cname = "pwquality_settings_t", lower_case_cprefix = "pwquality_", free_function = "pwquality_free_settings")] 102 | public class Settings { 103 | [CCode (cname = "pwquality_default_settings")] 104 | public Settings (); 105 | 106 | public PasswordQuality.Error read_config (string cfgfile, out void* auxerror); 107 | public PasswordQuality.Error set_option (string option); 108 | public PasswordQuality.Error set_int_value (PasswordQuality.Setting setting, int value); 109 | public PasswordQuality.Error set_str_value (PasswordQuality.Setting setting, string value); 110 | public PasswordQuality.Error get_int_value (PasswordQuality.Setting setting, out int value); 111 | public PasswordQuality.Error get_str_value (PasswordQuality.Setting setting, out unowned string value); 112 | 113 | public PasswordQuality.Error generate (int entropy_bits, out string password); 114 | public int check (string password, string? oldpassword = null, string? user = null, out void* auxerror = null); 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /cpufreq.vapi: -------------------------------------------------------------------------------- 1 | /* cpufreq.vapi 2 | * 3 | * Copyright (C) 2011 Nikolay Orlyuk 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | * 19 | * Author: 20 | * Nikolay Orlyuk 21 | */ 22 | 23 | // note that this vapi is based on headers and sources of cpufrequtils-008 24 | 25 | [CCode (lower_case_cprefix = "cpufreq_", cheader_filename = "cpufreq.h")] 26 | namespace CpuFreq { 27 | // units 28 | [SimpleType] 29 | [CCode (cname = "unsigned long")] 30 | public struct Hz : ulong { 31 | public MHz mhz { get { return this / 1000000f; } } 32 | } 33 | 34 | [SimpleType] 35 | [CCode (cname = "float")] 36 | public struct MHz : float { 37 | public Hz hz { get { return (Hz)(this * 1000000f); } } 38 | } 39 | 40 | [Compact] 41 | [CCode (cname = "char", free_function = "cpufreq_put_driver")] 42 | public class Driver : string { 43 | } 44 | 45 | [Compact] 46 | [CCode (cname = "struct cpufreq_policy", free_function = "cpufreq_put_policy")] 47 | public class Policy { 48 | public Hz min; 49 | public Hz max; 50 | public unowned string governor; 51 | } 52 | 53 | [Compact] 54 | [CCode (cname = "struct cpufreq_available_governors", free_function = "cpufreq_put_available_governors")] 55 | public class AvailableGovernors { 56 | public unowned string governor; 57 | public unowned AvailableGovernors next; 58 | public unowned AvailableGovernors first; 59 | } 60 | 61 | [Compact] 62 | [CCode (cname = "struct cpufreqb_available_frequencies", free_function = "cpufreq_put_available_frequencies")] 63 | public class AvailableFrequencies { 64 | public Hz frequency; 65 | public unowned AvailableFrequencies next; 66 | public unowned AvailableFrequencies first; 67 | } 68 | 69 | [Compact] 70 | [CCode (cname = "struct cpufreq_affected_cpus", free_function = "cpufreq_put_affected_cpus")] 71 | public class AffectedCpus { 72 | public Cpu cpu; 73 | public unowned AffectedCpus next; 74 | public unowned AffectedCpus first; 75 | } 76 | 77 | [Compact] 78 | [CCode (cname = "struct cpufreq_affected_cpus", free_function = "cpufreq_put_related_cpus")] 79 | public class RelatedCpus { 80 | public Cpu cpu; 81 | public unowned RelatedCpus next; 82 | public unowned RelatedCpus first; 83 | } 84 | 85 | [Compact] 86 | [CCode (cname = "struct cpufreq_stats", free_function = "cpufreq_put_stats")] 87 | public class Stats { 88 | public Hz frequency; 89 | public uint64 time_in_state; 90 | public unowned Stats next; 91 | public unowned Stats first; 92 | } 93 | 94 | [SimpleType] 95 | [CCode (cname = "unsigned int", lower_case_cprefix = "cpufreq_")] 96 | public struct Cpu : uint { 97 | public int cpu_exists(); 98 | public bool exists { get { return cpu_exists() == 0; } } 99 | 100 | public Hz freq_kernel { get; } 101 | public Hz freq_hardware { get; } 102 | public Hz frequency { 103 | [CCode (cname = "cpufreq_get")] 104 | get; 105 | set; 106 | } 107 | 108 | public ulong transition_latency { get; } 109 | 110 | public int get_hardware_limits(out Hz min, out Hz max); 111 | 112 | public Driver driver { owned get; } 113 | 114 | public Policy policy { owned get; set; } 115 | public int modify_policy_min(Hz min_freq); 116 | public int modify_policy_max(Hz min_freq); 117 | public int modify_policy_governor(string governor); 118 | 119 | public AvailableGovernors available_governors { owned get; } 120 | public AvailableFrequencies available_frequencies { owned get; } 121 | public AffectedCpus affected_cpus { owned get; } 122 | public RelatedCpus related_cpus { owned get; } 123 | 124 | public Stats stats { owned get; } 125 | public ulong transitions { get; } 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /libmarkdown.vapi: -------------------------------------------------------------------------------- 1 | /* libmarkdown Vala Bindings 2 | * Copyright 2016 Guillaume Poirier-Morency 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * 1. Redistributions of works must retain the original copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the original copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. Neither my name (David L Parsons) nor the names of contributors to 14 | * this code may be used to endorse or promote products derived 15 | * from this work without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 20 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 21 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 22 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 23 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 27 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | [CCode (cheader_filename = "mkdio.h")] 32 | namespace Markdown 33 | { 34 | [CCode (cname = "mkd_callback_t", has_target = false)] 35 | public delegate string Callback (string str, int size, T user_data); 36 | [CCode (cname = "mkd_free_t", has_target = false)] 37 | public delegate void FreeCallback (string str, int size, T user_data); 38 | [CCode (cname = "mkd_sta_t", has_target = false)] 39 | public delegate int StringToAnchorCallback (int outchar, T @out); 40 | 41 | public void initialize (); 42 | public void with_html5_tags (); 43 | public void shlib_destructor (); 44 | public char[] markdown_version; 45 | 46 | [Compact] 47 | [CCode (cname = "MMIOT", cprefix = "mkd_", free_function = "mkd_cleanup")] 48 | public class Document 49 | { 50 | [CCode (cname = "mkd_in")] 51 | public Document.from_in (GLib.FileStream file, DocumentFlags flags); 52 | [CCode (cname = "mkd_string")] 53 | public Document.from_string (uint8[] doc, DocumentFlags flags); 54 | 55 | [CCode (cname = "gfm_in")] 56 | public Document.from_gfm_in (GLib.FileStream file, DocumentFlags flags); 57 | [CCode (cname = "gfm_string")] 58 | public Document.from_gfm_string (uint8[] doc, DocumentFlags flags); 59 | 60 | public void basename (string @base); 61 | 62 | public bool compile (DocumentFlags flags); 63 | public void cleanup (); 64 | 65 | public int dump (GLib.FileStream file, DocumentFlags flags, string title); 66 | [CCode (cname = "markdown")] 67 | public int markdown (GLib.FileStream file, DocumentFlags flags); 68 | public static int line (uint8[] buffer, out string @out, DocumentFlags flags); 69 | public static void string_to_anchor (uint8[] buffer, StringToAnchorCallback sta, T @out, DocumentFlags flags); 70 | public int xhtmlpage (DocumentFlags flags, GLib.FileStream file); 71 | 72 | public unowned string doc_title (); 73 | public unowned string doc_author (); 74 | public unowned string doc_date (); 75 | 76 | public int document (out unowned string text); 77 | public int toc (out unowned string @out); 78 | public int css (out unowned string @out); 79 | public static int xml (uint8[] buffer, out string @out); 80 | 81 | public int generatehtml (GLib.FileStream file); 82 | public int generatetoc (GLib.FileStream file); 83 | public static int generatexml (uint8[] buffer, GLib.FileStream file); 84 | public int generatecss (GLib.FileStream file); 85 | public static int generateline (uint8[] buffer, GLib.FileStream file, DocumentFlags flags); 86 | 87 | public void e_url (Callback callback); 88 | public void e_flags (Callback callback); 89 | public void e_free (FreeCallback callback); 90 | public void e_data (T user_data); 91 | 92 | public static void mmiot_flags (GLib.FileStream file, Document document, bool htmlplease); 93 | public static void flags_are (GLib.FileStream file, DocumentFlags flags, bool htmlplease); 94 | 95 | public void ref_prefix (string prefix); 96 | } 97 | 98 | [Flags] 99 | [CCode (cprefix = "MKD_")] 100 | public enum DocumentFlags 101 | { 102 | NOLINKS, 103 | NOIMAGE, 104 | NOPANTS, 105 | NOHTML, 106 | STRICT, 107 | TAGTEXT, 108 | NO_EXT, 109 | NOEXT, 110 | CDATA, 111 | NOSUPERSCRIPT, 112 | NORELAXED, 113 | NOTABLES, 114 | NOSTRIKETHROUGH, 115 | TOC, 116 | @1_COMPAT, 117 | AUTOLINK, 118 | SAFELINK, 119 | NOHEADER, 120 | TABSTOP, 121 | NODIVQUOTE, 122 | NOALPHALIST, 123 | NODLIST, 124 | EXTRA_FOOTNOTE, 125 | NOSTYLE, 126 | EMBED 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /xcb-shm.vapi: -------------------------------------------------------------------------------- 1 | /* 2 | * This library is free software; you can redistribute it and/or 3 | * modify it under the terms of the GNU Lesser General Public 4 | * License as published by the Free Software Foundation; either 5 | * version 2.1 of the License, or (at your option) any later version. 6 | * 7 | * This library is distributed in the hope that it will be useful, 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 | * Lesser General Public License for more details. 11 | * 12 | * You should have received a copy of the GNU Lesser General Public 13 | * License along with this library; if not, write to the Free Software 14 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 15 | */ 16 | 17 | using Xcb; 18 | 19 | namespace Xcb { 20 | 21 | [CCode (cprefix = "xcb_shm_", cheader_filename = "xcb/shm.h")] 22 | namespace Shm { 23 | public static Connection get_connection (Xcb.Connection c) { 24 | return (Connection) c; 25 | } 26 | 27 | [Compact] 28 | [CCode (cname = "xcb_connection_t", cprefix = "xcb_shm_", unref_function = "")] 29 | public class Connection : Xcb.Connection { 30 | public QueryVersionCookie query_version (); 31 | public QueryVersionCookie query_version_unchecked (); 32 | public QueryVersionReply query_version_reply (QueryVersionCookie cookie, out Xcb.GenericError? e = null); 33 | 34 | public VoidCookie attach_checked (Seg shmseg, uint32 shmid, bool read_only); 35 | public VoidCookie attach (Seg shmseg, uint32 shmid, bool read_only); 36 | 37 | public VoidCookie detach_checked (Seg shmseg); 38 | public VoidCookie detach (Seg shmseg); 39 | 40 | public VoidCookie put_image_checked (Xcb.Drawable drawable, Xcb.GC gc, uint16 total_width, uint16 total_height, uint16 src_x, uint16 src_y, uint16 src_width, uint16 src_height, int16 dst_x, int16 dest_y, uint8 depth, uint8 format, bool send_event, Seg shmseg, uint32 offset); 41 | public VoidCookie put_image (Xcb.Drawable drawable, Xcb.GC gc, uint16 total_width, uint16 total_height, uint16 src_x, uint16 src_y, uint16 src_width, uint16 src_height, int16 dst_x, int16 dest_y, uint8 depth, uint8 format, bool send_event, Seg shmseg, uint32 offset); 42 | 43 | public GetImageCookie get_image (Xcb.Drawable drawable, int16 x, int16 y, uint16 width, uint16 height, uint32 plane_mask, uint8 format, Seg shmseg, uint32 offset); 44 | public GetImageCookie get_image_unchecked (Xcb.Drawable drawable, int16 x, int16 y, uint16 width, uint16 height, uint32 plane_mask, uint8 format, Seg shmseg, uint32 offset); 45 | public GetImageReply? get_image_reply (GetImageCookie cookie, out Xcb.GenericError? e = null); 46 | 47 | public VoidCookie create_pixmap_checked (Xcb.Pixmap pid, Xcb.Drawable drawable, uint16 width, uint16 height, uint8 depth, Seg shmseg, uint32 offset); 48 | public VoidCookie create_pixmap (Xcb.Pixmap pid, Xcb.Drawable drawable, uint16 width, uint16 height, uint8 depth, Seg shmseg, uint32 offset); 49 | 50 | public VoidCookie attach_fd_checked (Seg shmseg, int32 shm_fd, bool read_only); 51 | public VoidCookie attach_fd (Seg shmseg, int32 shm_fd, bool read_only); 52 | 53 | public CreateSegmentCookie create_segment (Seg shmseg, uint32 size, bool read_only); 54 | public CreateSegmentCookie create_segment_unchecked (Seg shmseg, uint32 size, bool read_only); 55 | public CreateSegmentReply? create_segment_reply (CreateSegmentCookie cookie, out Xcb.GenericError? e = null); 56 | } 57 | 58 | [SimpleType] 59 | [CCode (cname = "xcb_shm_seg_t", has_type_id = false)] 60 | public struct Seg : uint32 { 61 | } 62 | 63 | [SimpleType] 64 | [IntegerType (rank = 9)] 65 | [CCode (cname = "xcb_shm_query_version_cookie_t", has_type_id = false)] 66 | public struct QueryVersionCookie { 67 | } 68 | 69 | [Compact] 70 | [CCode (cname = "xcb_shm_query_version_reply_t", ref_function = "", unref_function = "free")] 71 | public class QueryVersionReply : Xcb.GenericReply { 72 | public bool shared_pixmaps; 73 | public uint16 major_version; 74 | public uint16 minor_version; 75 | public uint16 uid; 76 | public uint16 gid; 77 | public uint8 pixmap_format; // FIXME enum? 78 | } 79 | 80 | [SimpleType] 81 | [IntegerType (rank = 9)] 82 | [CCode (cname = "xcb_shm_get_image_cookie_t", has_type_id = false)] 83 | public struct GetImageCookie { 84 | } 85 | 86 | [Compact] 87 | [CCode (cname = "xcb_shm_get_image_reply_t", ref_function = "", unref_function = "free")] 88 | public class GetImageReply : Xcb.GenericReply { 89 | public uint8 depth; 90 | public Xcb.VisualID visual; 91 | public uint32 size; 92 | } 93 | 94 | [SimpleType] 95 | [IntegerType (rank = 9)] 96 | [CCode (cname = "xcb_shm_create_segment_cookie_t", has_type_id = false)] 97 | public struct CreateSegmentCookie { 98 | } 99 | 100 | [Compact] 101 | [CCode (cname = "xcb_shm_create_segment_reply_t", ref_function = "", unref_function = "free")] 102 | public class CreateSegmentReply : Xcb.GenericReply { 103 | private uint8 nfd; 104 | [CCode (cname = "xcb_shm_create_segment_reply_fds")] 105 | private int* vala_fds (); 106 | public int[] fds 107 | { 108 | get { 109 | unowned int[] res = (int[]) vala_fds (); 110 | res.length = nfd; 111 | return res; 112 | } 113 | } 114 | } 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /xcb-dri3.vapi: -------------------------------------------------------------------------------- 1 | /* 2 | * This library is free software; you can redistribute it and/or 3 | * modify it under the terms of the GNU Lesser General Public 4 | * License as published by the Free Software Foundation; either 5 | * version 2.1 of the License, or (at your option) any later version. 6 | * 7 | * This library is distributed in the hope that it will be useful, 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 | * Lesser General Public License for more details. 11 | * 12 | * You should have received a copy of the GNU Lesser General Public 13 | * License along with this library; if not, write to the Free Software 14 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 15 | */ 16 | 17 | using Xcb; 18 | 19 | namespace Xcb { 20 | 21 | [CCode (cprefix = "xcb_dri3_", cheader_filename = "xcb/dri3.h")] 22 | namespace DRI3 { 23 | public static Connection get_connection (Xcb.Connection c) { 24 | return (Connection) c; 25 | } 26 | 27 | [Compact] 28 | [CCode (cname = "xcb_connection_t", cprefix = "xcb_dri3_", unref_function = "")] 29 | public class Connection : Xcb.Connection { 30 | public QueryVersionCookie query_version (uint32 major_version, uint32 minor_version); 31 | public QueryVersionCookie query_version_unchecked (uint32 major_version, uint32 minor_version); 32 | public QueryVersionReply? query_version_reply (QueryVersionCookie cookie, out Xcb.GenericError? e = null); 33 | 34 | public OpenCookie open (Xcb.Drawable drawable, uint32 provider); 35 | public OpenCookie open_unchecked (Xcb.Drawable drawable, uint32 provider); 36 | public OpenReply? open_reply (OpenCookie cookie, out Xcb.GenericError? e = null); 37 | 38 | public VoidCookie pixmap_from_buffer_checked (Pixmap pixmap, Drawable drawable, uint32 size, uint16 width, uint16 height, uint16 stride, uint8 depth, uint8 bpp, int32 pixmap_fd); 39 | public VoidCookie pixmap_from_buffer (Pixmap pixmap, Drawable drawable, uint32 size, uint16 width, uint16 height, uint16 stride, uint8 depth, uint8 bpp, int32 pixmap_fd); 40 | 41 | public BufferFromPixmapCookie buffer_from_pixmap (Pixmap pixmap); 42 | public BufferFromPixmapCookie buffer_from_pixmap_unchecked (Pixmap pixmap); 43 | public BufferFromPixmapReply? buffer_from_pixmap_reply (BufferFromPixmapCookie cookie, out Xcb.GenericError? e = null); 44 | 45 | public VoidCookie fence_from_fd_checked (Pixmap pixmap, Drawable drawable, uint32 fence, bool initially_triggered, int32 fence_fd); 46 | public VoidCookie fence_from_fd (Pixmap pixmap, Drawable drawable, uint32 fence, bool initially_triggered, int32 fence_fd); 47 | 48 | public FDFromFenceCookie fd_from_fence (Drawable drawable, uint32 fence); 49 | public FDFromFenceCookie fd_from_fence_unchecked (Drawable drawable, uint32 fence); 50 | public FDFromFenceReply? fd_from_fence_reply (FDFromFenceCookie cookie, out Xcb.GenericError? e = null); 51 | } 52 | 53 | [SimpleType] 54 | [IntegerType (rank = 9)] 55 | [CCode (cname = "xcb_dri3_query_version_cookie_t", has_type_id = false)] 56 | public struct QueryVersionCookie { 57 | } 58 | 59 | [Compact] 60 | [CCode (cname = "xcb_dri3_query_version_reply_t", ref_function = "", unref_function = "free")] 61 | public struct QueryVersionReply { 62 | public uint32 major_version; 63 | public uint32 minor_version; 64 | } 65 | 66 | [SimpleType] 67 | [IntegerType (rank = 9)] 68 | [CCode (cname = "xcb_dri3_open_cookie_t", has_type_id = false)] 69 | public struct OpenCookie { 70 | } 71 | 72 | [Compact] 73 | [CCode (cname = "xcb_dri3_open_reply_t", ref_function = "", unref_function = "free")] 74 | public struct OpenReply { 75 | private uint8 nfd; 76 | [CCode (cname = "xcb_dri3_open_reply_fds")] 77 | private int* vala_fds (); 78 | public int[] fds 79 | { 80 | get { 81 | unowned int[] res = (int[]) vala_fds (); 82 | res.length = nfd; 83 | return res; 84 | } 85 | } 86 | } 87 | 88 | [SimpleType] 89 | [IntegerType (rank = 9)] 90 | [CCode (cname = "xcb_dri3_buffer_from_pixmap_cookie_t", has_type_id = false)] 91 | public struct BufferFromPixmapCookie { 92 | } 93 | 94 | [Compact] 95 | [CCode (cname = "xcb_dri3_buffer_from_pixmap_reply_t", ref_function = "", unref_function = "free")] 96 | public struct BufferFromPixmapReply { 97 | public uint16 width; 98 | public uint16 height; 99 | public uint16 stride; 100 | public uint8 depth; 101 | public uint8 bpp; 102 | private uint8 nfd; 103 | [CCode (cname = "xcb_dri3_buffer_from_pixmap_reply_fds")] 104 | private int* vala_fds (); 105 | public int[] fds 106 | { 107 | get { 108 | unowned int[] res = (int[]) vala_fds (); 109 | res.length = nfd; 110 | return res; 111 | } 112 | } 113 | } 114 | 115 | [SimpleType] 116 | [IntegerType (rank = 9)] 117 | [CCode (cname = "xcb_dri3_fd_from_fence_cookie_t", has_type_id = false)] 118 | public struct FDFromFenceCookie { 119 | } 120 | 121 | [Compact] 122 | [CCode (cname = "xcb_dri3_fd_from_fence_reply_t", ref_function = "", unref_function = "free")] 123 | public struct FDFromFenceReply { 124 | private uint8 nfd; 125 | [CCode (cname = "xcb_dri3_fd_from_fence_reply_fds")] 126 | private int* vala_fds (); 127 | public int[] fds 128 | { 129 | get { 130 | unowned int[] res = (int[]) vala_fds (); 131 | res.length = nfd; 132 | return res; 133 | } 134 | } 135 | } 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /SDL2_net.vapi: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2016-2020 SDL2 VAPI Authors 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | * 24 | * Authors: 25 | * Mario Daniel Ruiz Saavedra 26 | * Gontzal Uriarte 27 | * Pedro H. Lara Campos 28 | */ 29 | 30 | [CCode (cprefix = "SDLNet_", cheader_filename = "SDL2/SDL_net.h")] 31 | namespace SDLNet { 32 | [CCode (cname = "SDLNet_Linked_Version")] 33 | public static unowned SDL.Version? linked_version (); 34 | 35 | [CCode (cname = "SDLNet_Init")] 36 | public static int init (); 37 | 38 | [CCode (cname = "SDLNet_Quit")] 39 | public static void quit (); 40 | 41 | [CCode (cname = "SDLNet_Write16")] 42 | public static void write16 (uint16 value, void* area); 43 | 44 | [CCode (cname = "SDLNet_Write32")] 45 | public static void write32 (uint value, void* area); 46 | 47 | [CCode (cname = "SDLNet_Read16")] 48 | public static uint16 read16 (void* area); 49 | 50 | [CCode (cname = "SDLNet_Read32")] 51 | public static uint read32 (void* area); 52 | 53 | 54 | [CCode (cname = "IPaddress", free_function = "g_free", has_type_id = false)] 55 | public struct IPAddress { 56 | public uint host; 57 | public uint16 port; 58 | 59 | [CCode (cname = "INADDR_ANY")] 60 | public const uint ANY; 61 | 62 | [CCode (cname = "INADDR_NONE")] 63 | public const uint NONE; 64 | 65 | [CCode (cname = "SDLNet_ResolveHost")] 66 | public static int from_host (out IPAddress address, string? host, uint16 port); 67 | 68 | [CCode (cname = "SDLNet_ResolveIP")] 69 | public unowned string? lookup (); 70 | }// IPAddress 71 | 72 | [CCode (cname = "UDPpacket", free_function = "SDLNet_FreePacket")] 73 | [Compact] 74 | public class UDPPacket { 75 | public int channel; 76 | public uchar *data; 77 | public int len; 78 | public int maxlen; 79 | public int status; 80 | public IPAddress address; 81 | 82 | [CCode (cname = "SDLNet_AllocPacket")] 83 | public UDPPacket (int size); 84 | 85 | [CCode (cname = "SDLNet_ResizePacket")] 86 | public int resize (int newsize); 87 | }// UDPPacket 88 | 89 | [CCode (cname = "struct _SDLNet_GenericSocket")] 90 | [Compact] 91 | public class Socket { 92 | public int ready; 93 | }// Socket 94 | 95 | [CCode (cname = "struct _TCPsocket", free_function = "SDLNet_TCP_Close")] 96 | [Compact] 97 | public class TCPSocket: Socket { 98 | [CCode (cname = "SDLNet_TCP_Open")] 99 | public TCPSocket (IPAddress ip); 100 | 101 | [CCode (cname = "SDLNet_TCP_Accept")] 102 | public TCPSocket? accept (); 103 | 104 | [CCode (cname = "SDLNet_TCP_GetPeerAddress")] 105 | public IPAddress? get_address (); 106 | 107 | [CCode (cname = "SDLNet_TCP_Send")] 108 | public int send (uchar[] data); 109 | 110 | [CCode (cname = "SDLNet_TCP_Recv")] 111 | public int receive (uchar[] data); 112 | }// TCPSocket 113 | 114 | [CCode (cname = "struct _UDPsocket", free_function = "SDLNet_UDP_Close")] 115 | [Compact] 116 | public class UDPSocket: Socket { 117 | [CCode (cname = "SDLNet_UDP_Open")] 118 | public UDPSocket (uint16 port); 119 | 120 | [CCode (cname = "SDLNet_UDP_Bind")] 121 | public int bind (int channel, IPAddress address); 122 | 123 | [CCode (cname = "SDLNet_UDP_Unbind")] 124 | public void unbind (int channel); 125 | 126 | [CCode (cname = "SDLNet_UDP_GetPeerAddress")] 127 | public IPAddress? get_address (int channel); 128 | 129 | [CCode (cname = "SDLNet_UDP_Send")] 130 | public int send (int channel, UDPPacket packet); 131 | 132 | [CCode (cname = "SDLNet_UDP_Recv")] 133 | public int receive (UDPPacket packet); 134 | 135 | [CCode (cname = "SDLNet_UDP_SendV")] 136 | public int send_many (UDPPacket[] packets); 137 | 138 | [CCode (cname = "SDLNet_UDP_RecvV")] 139 | public int receive_many ([CCode (array_length = false)] UDPPacket[] packets); 140 | }// UDPSocket 141 | 142 | [CCode (cname = "struct _SDLNet_SocketSet", free_function = "SDLNet_FreeSocketSet")] 143 | [Compact] 144 | public class SocketSet { 145 | [CCode (cname = "SDLNet_AllocSocketSet")] 146 | public SocketSet (int maxsockets); 147 | 148 | [CCode (cname = "SDLNet_AddSocket")] 149 | public int add (Socket socket); 150 | 151 | [CCode (cname = "SDLNet_DelSocket")] 152 | public int remove (Socket socket); 153 | 154 | [CCode (cname = "SDLNet_CheckSockets")] 155 | public int has_data (uint timeout); 156 | 157 | [CCode (cname = "SDLNet_SocketReady")] 158 | public int is_ready (); 159 | }// SocketSet 160 | }// SDL 161 | -------------------------------------------------------------------------------- /xcb-present.vapi: -------------------------------------------------------------------------------- 1 | /* 2 | * This library is free software; you can redistribute it and/or 3 | * modify it under the terms of the GNU Lesser General Public 4 | * License as published by the Free Software Foundation; either 5 | * version 2.1 of the License, or (at your option) any later version. 6 | * 7 | * This library is distributed in the hope that it will be useful, 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 | * Lesser General Public License for more details. 11 | * 12 | * You should have received a copy of the GNU Lesser General Public 13 | * License along with this library; if not, write to the Free Software 14 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 15 | */ 16 | 17 | using Xcb; 18 | 19 | namespace Xcb { 20 | 21 | [CCode (cprefix = "xcb_present_", cheader_filename = "xcb/present.h")] 22 | namespace Present { 23 | public static Connection get_connection (Xcb.Connection c) { 24 | return (Connection) c; 25 | } 26 | 27 | [Compact] 28 | [CCode (cname = "xcb_connection_t", cprefix = "xcb_present_", unref_function = "")] 29 | public class Connection : Xcb.Connection { 30 | public QueryVersionCookie query_version (uint32 major_version, uint32 minor_version); 31 | public QueryVersionCookie query_version_unchecked (uint32 major_version, uint32 minor_version); 32 | public QueryVersionReply? query_version_reply (QueryVersionCookie cookie, out GenericError? e = null); 33 | 34 | public VoidCookie pixmap_checked (Xcb.Window window, Xcb.Pixmap pixmap, uint32 serial, XFixes.Region valid, XFixes.Region update, int16 x_off, int16 y_off, RandR.Crtc target_crtc, Sync.Fence wait_fence, Sync.Fence idle_fence, Option options, uint64 target_msc, uint64 divisor, uint64 remainder, [CCode (array_length_pos = 14.9, array_length_type = "uint32_t")] Notify[] notifies); 35 | public VoidCookie pixmap (Xcb.Window window, Xcb.Pixmap pixmap, uint32 serial, XFixes.Region valid, XFixes.Region update, int16 x_off, int16 y_off, RandR.Crtc target_crtc, Sync.Fence wait_fence, Sync.Fence idle_fence, Option options, uint64 target_msc, uint64 divisor, uint64 remainder, [CCode (array_length_pos = 14.9, array_length_type = "uint32_t")] Notify[] notifies); 36 | 37 | public VoidCookie notify_msc_checked (Xcb.Window window, uint32 serial, uint64 target_msc, uint64 divisor, uint64 remainder); 38 | public VoidCookie notify_msc (Xcb.Window window, uint32 serial, uint64 target_msc, uint64 divisor, uint64 remainder); 39 | 40 | public VoidCookie select_input_checked (Event eid, Xcb.Window window, EventMask event_mask); 41 | public VoidCookie select_input (Event eid, Xcb.Window window, EventMask event_mask); 42 | 43 | public QueryCapabilitiesCookie query_capabilities (Xcb.Window window, uint32 target); 44 | public QueryCapabilitiesCookie query_capabilities_unchecked (Xcb.Window window, uint32 target); 45 | public QueryCapabilitiesReply? query_capabilities_reply (QueryCapabilitiesCookie cookie, out GenericError? e = null); 46 | } 47 | 48 | [SimpleType] 49 | [IntegerType (rank = 9)] 50 | [CCode (cname = "xcb_present_event_t", has_type_id = false)] 51 | public struct Event { 52 | } 53 | 54 | [CCode (cname = "xcb_present_event_enum_t", cprefix = "XCB_PRESENT_EVENT_", has_type_id = false)] 55 | public enum EventEnum { 56 | CONFIGURE_NOTIFY, 57 | COMPLETE_NOTIFY, 58 | IDLE_NOTIFY, 59 | REDIRECT_NOTIFY 60 | } 61 | 62 | [CCode (cname = "xcb_present_event_mask_t", cprefix = "XCB_PRESENT_EVENT_MASK_", has_type_id = false)] 63 | public enum EventMask { 64 | NO_EVENT, 65 | CONFIGURE_NOTIFY, 66 | COMPLETE_NOTIFY, 67 | IDLE_NOTIFY, 68 | REDIRECT_NOTIFY 69 | } 70 | 71 | [CCode (cname = "xcb_present_option_t", cprefix = "XCB_PRESENT_OPTION_", has_type_id = false)] 72 | public enum Option { 73 | NONE, 74 | ASYNC, 75 | COPY, 76 | UST 77 | } 78 | 79 | [CCode (cname = "xcb_present_capability_t", cprefix = "XCB_PRESENT_CAPABILITY_", has_type_id = false)] 80 | public enum Capability { 81 | NONE, 82 | ASYNC, 83 | FENCE, 84 | UST 85 | } 86 | 87 | [CCode (cname = "xcb_present_kind_t", cprefix = "XCB_PRESENT_COMPLETE_KIND_", has_type_id = false)] 88 | public enum CompleteKind { 89 | PIXMAP, 90 | NOTIFY_MSC 91 | } 92 | 93 | [CCode (cname = "xcb_present_complete_mode_t", cprefix = "XCB_PRESENT_COMPLETE_MODE_", has_type_id = false)] 94 | public enum CompleteMode { 95 | COPY, 96 | FLIP, 97 | SKIP 98 | } 99 | 100 | [SimpleType] 101 | [CCode (cname = "xcb_present_notify_t", has_type_id = false)] 102 | public struct Notify { 103 | public Xcb.Window window; 104 | public uint32 serial; 105 | } 106 | 107 | [SimpleType] 108 | [IntegerType (rank = 9)] 109 | [CCode (cname = "xcb_present_query_version_cookie_t", has_type_id = false)] 110 | public struct QueryVersionCookie { 111 | } 112 | 113 | [Compact] 114 | [CCode (cname = "xcb_present_query_version_reply_t", ref_function = "", unref_function = "free")] 115 | public struct QueryVersionReply { 116 | public uint32 major_version; 117 | public uint32 minor_version; 118 | } 119 | 120 | [SimpleType] 121 | [IntegerType (rank = 9)] 122 | [CCode (cname = "xcb_present_query_capabilities_cookie_t", has_type_id = false)] 123 | public struct QueryCapabilitiesCookie { 124 | } 125 | 126 | [Compact] 127 | [CCode (cname = "xcb_present_query_capabilities_reply_t", ref_function = "", unref_function = "free")] 128 | public struct QueryCapabilitiesReply { 129 | public Capability capabilities; 130 | } 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /libzmq.vapi: -------------------------------------------------------------------------------- 1 | /* libzmq.vala 2 | * 3 | * Copyright (C) 2011 Lewis Gunsch 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | * 20 | * Author: 21 | * Lewis Gunsch 22 | */ 23 | 24 | [CCode (lower_case_cprefix = "zmq_", cheader_filename = "zmq.h")] 25 | namespace ZMQ { 26 | [Compact] 27 | [CCode (cprefix = "zmq_", cname = "void", free_function = "zmq_term")] 28 | public class Context { 29 | [CCode (cname = "zmq_init")] 30 | public Context (int io_threads); 31 | } 32 | 33 | [CCode (cprefix = "ZMQ_")] 34 | namespace VERSION { 35 | public const int MAJOR; 36 | public const int MINOR; 37 | public const int PATCH; 38 | 39 | [CCode (cname = "ZMQ_VERSION")] 40 | public const int VERSION; 41 | } 42 | 43 | public static void version (out int major, out int minor, out int patch); 44 | 45 | /* ZMQ error numbers, in addition to POSIX error numbers. */ 46 | [CCode (cname = "EFSM")] 47 | public const int EFSM; 48 | [CCode (cname = "ENOCOMPATPROTO")] 49 | public const int ENOCOMPATPROTO; 50 | [CCode (cname = "ETERM")] 51 | public const int ETERM; 52 | [CCode (cname = "EMTHREAD")] 53 | public const int EMTHREAD; 54 | 55 | public int errno (); 56 | public unowned string strerror (int errnum); 57 | 58 | [CCode (cname = "ZMQ_MAX_VSM_SIZE")] 59 | public const int MAX_VSM_SIZE; 60 | [CCode (cname = "ZMQ_DELIMITER")] 61 | public const int DELIMITER; 62 | [CCode (cname = "ZMQ_VSM")] 63 | public const int VSM; 64 | 65 | [CCode (cname = "zmq_free_fn", type = "void (*)(void *, void *)")] 66 | public delegate void free_fn (void *data); 67 | 68 | [CCode (cprefix = "zmq_msg_", cname = "zmq_msg_t", destroy_function = "zmq_msg_close", copy_function = "NO_IMPLICIT_COPY")] 69 | public struct Msg { 70 | public const uchar MORE; 71 | public const uchar SHARED; 72 | [CCode (cname = "zmq_msg_init")] 73 | public Msg (); 74 | [CCode (cname = "zmq_msg_init_size")] 75 | public Msg.with_size (size_t size); 76 | [CCode (cname = "zmq_msg_init_data")] 77 | public Msg.with_data (owned uint8[] data, free_fn? ffn = null); 78 | [CCode (cname = "zmq_msg_copy", instance_pos = -1)] 79 | private int _copy (ref Msg dest); 80 | [CCode (cname = "zmq_msg_copy_wrapper")] 81 | public Msg copy () { 82 | Msg msg = Msg (); 83 | this._copy (ref msg); 84 | return msg; 85 | } 86 | public Msg clone () { 87 | unowned uint8[] data = (uint8[]) GLib.Memory.dup((void*) this._data (), (uint) this.size ()); 88 | data.length = (int) this.size (); 89 | Msg copy = Msg.with_data (data); 90 | return copy; 91 | } 92 | [CCode (cname = "zmq_msg_data")] 93 | private uint8 *_data (); 94 | public size_t size (); 95 | public uint8[] data { 96 | get { 97 | unowned uint8[] data = (uint8[]) this._data (); 98 | data.length = (int) this.size (); 99 | return data; 100 | } 101 | } 102 | [CCode (instance_pos = -1)] 103 | public int move (ref Msg dest); 104 | } 105 | 106 | [CCode (cname = "int", cprefix = "ZMQ_")] 107 | public enum SocketType { 108 | PAIR, 109 | PUB, 110 | SUB, 111 | REQ, 112 | REP, 113 | DEALER, 114 | ROUTER, 115 | PULL, 116 | PUSH, 117 | XPUB, 118 | XSUB 119 | } 120 | 121 | [CCode (cname = "int", cprefix = "ZMQ_")] 122 | public enum SocketOption { 123 | HWM, 124 | SWAP, 125 | AFFINITY, 126 | IDENTITY, 127 | SUBSCRIBE, 128 | UNSUBSCRIBE, 129 | RATE, 130 | RECOVERY_IVL, 131 | MCAST_LOOP, 132 | SNDBUF, 133 | RCVBUF, 134 | RCVMORE, 135 | FD, 136 | EVENTS, 137 | TYPE, 138 | LINGER, 139 | RECONNECT_IVL, 140 | BACKLOG, 141 | RECOVERY_IVL_MSEC, 142 | RECONNECT_IVL_MAX 143 | } 144 | 145 | [CCode (cname = "int", cprefix = "ZMQ_")] 146 | public enum SendRecvOption { 147 | NOBLOCK, 148 | SNDMORE 149 | } 150 | 151 | [Compact] 152 | [CCode (cprefix = "zmq_", cname = "void", free_function = "zmq_close")] 153 | public class Socket { 154 | [CCode (cname = "zmq_socket")] 155 | public static Socket? create(Context context, SocketType type); 156 | [CCode (simple_generics = true)] 157 | public int setsockopt < T > (SocketOption option, T optval, size_t optvallen); 158 | [CCode (simple_generics = true)] 159 | public int getsockopt < T > (SocketOption option, T optval, size_t optvallen); 160 | public int bind (string addr); 161 | public int connect (string addr); 162 | public int send (ref Msg msg, SendRecvOption flags = 0); 163 | public int recv (ref Msg msg, SendRecvOption flags = 0); 164 | } 165 | 166 | namespace POLL { 167 | [CCode (cname = "ZMQ_POLLIN")] 168 | public const short IN; 169 | [CCode (cname = "ZMQ_POLLOUT")] 170 | public const short OUT; 171 | [CCode (cname = "ZMQ_POLLERR")] 172 | public const short ERR; 173 | 174 | [CCode (cname = "zmq_pollitem_t")] 175 | public struct PollItem { 176 | Socket *socket; 177 | int fd; 178 | short events; 179 | short revents; 180 | } 181 | 182 | [CCode (cname = "zmq_poll")] 183 | public int poll (PollItem[] items, long timeout); 184 | } 185 | 186 | [CCode (cname = "int", cprefix = "ZMQ_")] 187 | public enum Device { 188 | STREAMER, 189 | FORWARDER, 190 | QUEUE; 191 | [CCode (cname = "zmq_device")] 192 | public int device (Socket insocket, Socket outsocket); 193 | } 194 | } -------------------------------------------------------------------------------- /xcb-xinerama.vapi: -------------------------------------------------------------------------------- 1 | /* 2 | * This library is free software; you can redistribute it and/or 3 | * modify it under the terms of the GNU Lesser General Public 4 | * License as published by the Free Software Foundation; either 5 | * version 2.1 of the License, or (at your option) any later version. 6 | * 7 | * This library is distributed in the hope that it will be useful, 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 | * Lesser General Public License for more details. 11 | * 12 | * You should have received a copy of the GNU Lesser General Public 13 | * License along with this library; if not, write to the Free Software 14 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 15 | */ 16 | 17 | using Xcb; 18 | 19 | namespace Xcb { 20 | 21 | [CCode (cprefix = "xcb_xinerama_", cheader_filename = "xcb/xinerama.h")] 22 | namespace Xinerama { 23 | public static Connection get_connection (Xcb.Connection c) { 24 | return (Connection) c; 25 | } 26 | 27 | [Compact] 28 | [CCode (cname = "xcb_connection_t", cprefix = "xcb_xinerama_", unref_function = "")] 29 | public class Connection : Xcb.Connection { 30 | public QueryVersionCookie query_version (uint8 major, uint8 minor); 31 | public QueryVersionCookie query_version_unchecked (uint8 major, uint8 minor); 32 | public QueryVersionReply? query_version_reply (QueryVersionCookie cookie, out GenericError? e = null); 33 | 34 | public GetStateCookie get_state (Xcb.Window window); 35 | public GetStateCookie get_state_unchecked (Xcb.Window window); 36 | public GetStateReply? get_state_reply (GetStateCookie cookie, out GenericError? e = null); 37 | 38 | public GetScreenCountCookie get_screen_count (Xcb.Window window); 39 | public GetScreenCountCookie get_screen_count_unchecked (Xcb.Window window); 40 | public GetScreenCountReply? get_screen_count_reply (GetScreenCountCookie cookie, out GenericError? e = null); 41 | 42 | public GetScreenSizeCookie get_screen_size (Xcb.Window window, uint32 screen); 43 | public GetScreenSizeCookie get_screen_size_unchecked (Xcb.Window window, uint32 screen); 44 | public GetScreenSizeReply? get_screen_size_reply (GetScreenSizeCookie cookie, out GenericError? e = null); 45 | 46 | public IsActiveCookie is_active (); 47 | public IsActiveCookie is_active_unchecked (); 48 | public IsActiveReply? is_active_reply (IsActiveCookie cookie, out GenericError? e = null); 49 | 50 | public QueryScreensCookie query_screens (); 51 | public QueryScreensCookie query_screens_unchecked (); 52 | public QueryScreensReply? query_screens_reply (QueryScreensCookie cookie, out GenericError? e = null); 53 | } 54 | 55 | [SimpleType] 56 | [CCode (cname = "xcb_xinerama_screen_info_t", has_type_id = false)] 57 | public struct ScreenInfo { 58 | public int16 x_org; 59 | public int16 y_org; 60 | public uint16 width; 61 | public uint16 height; 62 | } 63 | 64 | [SimpleType] 65 | [IntegerType (rank = 9)] 66 | [CCode (cname = "xcb_xinerama_query_version_cookie_t", has_type_id = false)] 67 | public struct QueryVersionCookie { 68 | } 69 | 70 | [Compact] 71 | [CCode (cname = "xcb_xinerama_query_version_reply_t", ref_function = "", unref_function = "free")] 72 | public class QueryVersionReply : Xcb.GenericReply { 73 | public uint16 major; 74 | public uint16 minor; 75 | } 76 | 77 | [SimpleType] 78 | [IntegerType (rank = 9)] 79 | [CCode (cname = "xcb_xinerama_get_state_cookie_t", has_type_id = false)] 80 | public struct GetStateCookie { 81 | } 82 | 83 | [Compact] 84 | [CCode (cname = "xcb_xinerama_get_state_reply_t", ref_function = "", unref_function = "free")] 85 | public class GetStateReply : Xcb.GenericReply { 86 | public uint8 state; 87 | public Xcb.Window window; 88 | } 89 | 90 | [SimpleType] 91 | [IntegerType (rank = 9)] 92 | [CCode (cname = "xcb_xinerama_get_screen_count_cookie_t", has_type_id = false)] 93 | public struct GetScreenCountCookie { 94 | } 95 | 96 | [Compact] 97 | [CCode (cname = "xcb_xinerama_get_screen_count_reply_t", ref_function = "", unref_function = "free")] 98 | public class GetScreenCountReply : Xcb.GenericReply { 99 | public uint8 screen_count; 100 | public Xcb.Window window; 101 | } 102 | 103 | [SimpleType] 104 | [IntegerType (rank = 9)] 105 | [CCode (cname = "xcb_xinerama_get_screen_size_cookie_t", has_type_id = false)] 106 | public struct GetScreenSizeCookie { 107 | } 108 | 109 | [Compact] 110 | [CCode (cname = "xcb_xinerama_get_screen_size_reply_t", ref_function = "", unref_function = "free")] 111 | public class GetScreenSizeReply : Xcb.GenericReply { 112 | public uint32 width; 113 | public uint32 height; 114 | public Xcb.Window window; 115 | public uint32 screen; 116 | } 117 | 118 | [SimpleType] 119 | [IntegerType (rank = 9)] 120 | [CCode (cname = "xcb_xinerama_is_active_cookie_t", has_type_id = false)] 121 | public struct IsActiveCookie { 122 | } 123 | 124 | [Compact] 125 | [CCode (cname = "xcb_xinerama_is_active_reply_t", ref_function = "", unref_function = "free")] 126 | public class IsActiveReply : Xcb.GenericReply { 127 | public uint32 state; 128 | } 129 | 130 | [SimpleType] 131 | [IntegerType (rank = 9)] 132 | [CCode (cname = "xcb_xinerama_query_screens_cookie_t", has_type_id = false)] 133 | public struct QueryScreensCookie { 134 | } 135 | 136 | [Compact] 137 | [CCode (cname = "xcb_xinerama_query_screens_reply_t", ref_function = "", unref_function = "free")] 138 | public class QueryScreensReply : Xcb.GenericReply { 139 | private uint32 number; 140 | [CCode (cname = "xcb_xinerama_query_screens_screen_info")] 141 | private ScreenInfo* vala_screen_info (); 142 | public unowned ScreenInfo[] screen_info 143 | { 144 | get { 145 | unowned ScreenInfo[] res = (ScreenInfo[]) vala_screen_info (); 146 | res.length = (int) number; 147 | return res; 148 | } 149 | } 150 | } 151 | } 152 | } 153 | -------------------------------------------------------------------------------- /xkbregistry.vapi: -------------------------------------------------------------------------------- 1 | /* 2 | * Vala bindings for xkbregistry 3 | * Copyright 2022 Corentin Noël 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a 6 | * copy of this software and associated documentation files (the "Software"), 7 | * to deal in the Software without restriction, including without limitation 8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | * and/or sell copies of the Software, and to permit persons to whom the 10 | * Software is furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice (including the next 13 | * paragraph) shall be included in all copies or substantial portions of the 14 | * Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 19 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22 | * DEALINGS IN THE SOFTWARE. 23 | */ 24 | 25 | [CCode (cheader_filename = "xkbcommon/xkbregistry.h", cprefix = "rxkb_", lower_case_cprefix = "rxkb_")] 26 | namespace Rxkb { 27 | [CCode (cname = "struct rxkb_context", ref_function = "rxkb_context_ref", unref_function = "rxkb_context_unref", has_type_id = false)] 28 | [Compact] 29 | public class Context { 30 | public Context (Rxkb.ContextFlags flags); 31 | public void set_log_level (Rxkb.LogLevel level); 32 | public Rxkb.LogLevel get_log_level (); 33 | public bool parse (string ruleset); 34 | public bool parse_default_ruleset (); 35 | public bool include_path_append (string path); 36 | public bool include_path_append_default (); 37 | public void set_log_fn (LogFn log_fn); 38 | public void set_user_data (void* user_data); 39 | public void* get_user_data (); 40 | [CCode (cname = "rxkb_model_first")] 41 | public unowned Rxkb.Model? get_first_model (); 42 | [CCode (cname = "rxkb_layout_first")] 43 | public unowned Rxkb.Layout? get_first_layout (); 44 | [CCode (cname = "rxkb_option_group_first")] 45 | public unowned Rxkb.OptionGroup? get_first_option_group (); 46 | public unowned Rxkb.Context @ref (); 47 | public void unref (); 48 | } 49 | 50 | [CCode (cname = "struct rxkb_model", ref_function = "rxkb_model_ref", unref_function = "rxkb_model_unref", has_type_id = false)] 51 | [Compact] 52 | public class Model { 53 | public unowned Rxkb.Model? next (); 54 | public unowned string get_name (); 55 | public unowned string? get_description (); 56 | public unowned string? get_vendor (); 57 | public Rxkb.Popularity get_popularity (); 58 | public unowned Rxkb.Model @ref (); 59 | public void unref (); 60 | } 61 | 62 | [CCode (cname = "struct rxkb_layout", ref_function = "rxkb_layout_ref", unref_function = "rxkb_layout_unref", has_type_id = false)] 63 | [Compact] 64 | public class Layout { 65 | public unowned Rxkb.Layout? next (); 66 | public unowned string get_name (); 67 | public unowned string? get_description (); 68 | public unowned string? get_variant (); 69 | public unowned string? get_brief (); 70 | [CCode (cname = "rxkb_layout_get_iso639_first")] 71 | public unowned Rxkb.Iso639Code? get_first_iso639 (); 72 | [CCode (cname = "rxkb_layout_get_iso3166_first")] 73 | public unowned Rxkb.Iso3166Code? get_first_iso3166 (); 74 | public unowned Rxkb.Layout @ref (); 75 | public void unref (); 76 | } 77 | 78 | [CCode (cname = "struct rxkb_option_group", ref_function = "rxkb_option_group_ref", unref_function = "rxkb_option_group_unref", has_type_id = false)] 79 | [Compact] 80 | public class OptionGroup { 81 | public unowned Rxkb.OptionGroup? next (); 82 | public unowned string get_name (); 83 | public unowned string? get_description (); 84 | public bool allows_multiple (); 85 | public Rxkb.Popularity get_popularity (); 86 | [CCode (cname = "rxkb_option_first")] 87 | public unowned Rxkb.Option? get_first_option (); 88 | public unowned Rxkb.OptionGroup @ref (); 89 | public void unref (); 90 | } 91 | 92 | [CCode (cname = "struct rxkb_option", ref_function = "rxkb_option_ref", unref_function = "rxkb_option_unref", has_type_id = false)] 93 | [Compact] 94 | public class Option { 95 | public unowned Rxkb.Option? next (); 96 | public unowned string get_name (); 97 | public unowned string? get_description (); 98 | public unowned string? get_brief (); 99 | public Rxkb.Popularity get_popularity (); 100 | public unowned Rxkb.Option @ref (); 101 | public void unref (); 102 | } 103 | 104 | [CCode (cname = "struct rxkb_iso639_code", ref_function = "rxkb_iso639_code_ref", unref_function = "rxkb_iso639_code_unref", has_type_id = false)] 105 | [Compact] 106 | public class Iso639Code { 107 | public unowned Rxkb.Iso639Code? next (); 108 | public unowned string get_code (); 109 | public unowned Rxkb.Iso639Code @ref (); 110 | public void unref (); 111 | } 112 | 113 | [CCode (cname = "struct rxkb_iso3166_code", ref_function = "rxkb_iso3166_code_ref", unref_function = "rxkb_iso3166_code_unref", has_type_id = false)] 114 | [Compact] 115 | public class Iso3166Code { 116 | public unowned Rxkb.Iso3166Code? next (); 117 | public unowned string get_code (); 118 | public unowned Rxkb.Iso3166Code @ref (); 119 | public void unref (); 120 | } 121 | 122 | [CCode (cname = "enum rxkb_context_flags", cprefix = "RXKB_CONTEXT_", has_type_id = false)] 123 | [Flags] 124 | public enum ContextFlags { 125 | NO_FLAGS, 126 | NO_DEFAULT_INCLUDES, 127 | LOAD_EXOTIC_RULES 128 | } 129 | 130 | [CCode (cname = "enum rxkb_popularity", cprefix = "RXKB_POPULARITY_", has_type_id = false)] 131 | public enum Popularity { 132 | STANDARD, 133 | EXOTIC 134 | } 135 | 136 | [CCode (cname = "enum rxkb_log_level", cprefix = "RXKB_LOG_LEVEL_", has_type_id = false)] 137 | public enum LogLevel { 138 | CRITICAL, 139 | ERROR, 140 | WARNING, 141 | INFO, 142 | DEBUG 143 | } 144 | 145 | [CCode (has_target = false, has_typedef = false)] 146 | public delegate void LogFn (Rxkb.Context ctx, Rxkb.LogLevel level, string format, va_list args); 147 | } 148 | -------------------------------------------------------------------------------- /libevent.vapi: -------------------------------------------------------------------------------- 1 | /* libevent Vala Bindings 2 | * Copyright 2010 Evan Nemerson 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | [CCode (cheader_filename = "event2/event.h", lower_case_cprefix = "event_")] 26 | namespace LibEvent { 27 | [Compact, CCode (cname = "struct event_base", cheader_filename = "event2/event.h")] 28 | public class Base { 29 | public Base (); 30 | public Base.with_config (LibEvent.Config cfg); 31 | [CCode (cname = "event_reinit")] 32 | public int reinit (); 33 | public int dispatch (); 34 | public unowned string get_method (); 35 | public int get_features (); 36 | public void set (LibEvent.Event event); 37 | public int loop (LibEvent.LoopFlags flags); 38 | public int loopexit (GLib.TimeVal tv); 39 | public int loopbreak (); 40 | public bool got_exit (); 41 | public bool got_break (); 42 | public int once (LibEvent.Base base, LibEvent.Util.Socket fd, short event, LibEvent.OccuredCallback cb, GLib.TimeVal tv); 43 | public int priority_init (int npriorities); 44 | public unowned GLib.TimeVal init_common_timeout (GLib.TimeVal duration); 45 | public void dump_events (GLib.FileStream file); 46 | } 47 | 48 | [Compact, CCode (cname = "struct event_config")] 49 | public class Config { 50 | public int avoid_method (string method); 51 | public int require_features (int feature); 52 | public int set_flag (int flag); 53 | } 54 | 55 | [Compact, CCode (cname = "struct event", cprefix = "event_")] 56 | public class Event { 57 | public Event (LibEvent.Base base, LibEvent.Util.Socket fd, short event, LibEvent.OccuredCallback cb); 58 | public int assign (LibEvent.Base base, LibEvent.Util.Socket fd, short event, LibEvent.OccuredCallback cb); 59 | public int add (GLib.TimeVal tv); 60 | public int del (); 61 | public int active (int res, short ncalls); 62 | public int pending (LibEvent.Flags what, GLib.TimeVal tv); 63 | public bool initialized (); 64 | public LibEvent.Util.Socket get_fd (); 65 | public LibEvent.Base get_base (); 66 | public int priority_set (int priority); 67 | } 68 | 69 | [CCode (cname = "enum event_method_feature", cprefix = "EV_FEATURE_", has_type_id = false)] 70 | public enum MethodFeature { 71 | ET, 72 | O1, 73 | FDS 74 | } 75 | 76 | [CCode (cname = "enum event_base_config_flag", cprefix = "EVENT_BASE_FLAG_", has_type_id = false)] 77 | public enum BaseConfigFlag { 78 | NOLOCK, 79 | IGNORE_ENV, 80 | STARTUP_IOCP, 81 | NO_CACHE_TIME 82 | } 83 | 84 | [CCode (cname = "int", cprefix = "_EVENT_LOG_", has_type_id = false)] 85 | public enum LogSeverity { 86 | DEBUG, 87 | MSG, 88 | WARN, 89 | ERR, 90 | } 91 | 92 | [Flags, CCode (cname = "int", cprefix = "EVLOOP_")] 93 | public enum LoopFlags { 94 | ONCE, 95 | NONBLOCK 96 | } 97 | 98 | [Flags, CCode (cname = "short", cprefix = "EV_")] 99 | public enum Flags { 100 | TIMEOUT, 101 | READ, 102 | WRITE, 103 | SIGNAL, 104 | PERSIST, 105 | ET 106 | } 107 | 108 | [CCode (cname = "event_log_cb", has_target = false)] 109 | public delegate void LogCallback (LibEvent.LogSeverity severity, string message); 110 | [CCode (cname = "event_fatal_cb", has_target = false)] 111 | public delegate void FatalCallback (int err); 112 | [CCode (cname = "void (*)(evutil_socket_t, short, void *)")] 113 | public delegate void OccuredCallback (LibEvent.Util.Socket socket, short event); 114 | 115 | [CCode (cname = "void *(*)(size_t)")] 116 | public delegate void* MallocFunc (size_t sz); 117 | [CCode (cname = "void *(*)(void *, size_t)")] 118 | public delegate void* ReallocFunc (void* ptr, size_t sz); 119 | [CCode (cname = "void (*)(void *)")] 120 | public delegate void FreeFunc (void* ptr); 121 | 122 | public static unowned string[] get_supported_methods (); 123 | public static void set_log_callback (LibEvent.LogCallback cb); 124 | public static void set_fatal_callback (LibEvent.FatalCallback cb); 125 | public static unowned string get_version (); 126 | public static uint32 get_version_number (); 127 | public static void set_mem_functions (LibEvent.MallocFunc malloc_fn, LibEvent.ReallocFunc realloc_fn, LibEvent.FreeFunc free_fn); 128 | 129 | [CCode (cname ="LIBEVENT_VERSION")] 130 | public const int VERSION; 131 | [CCode (cname ="LIBEVENT_VERSION_NUMBER")] 132 | public const int VERSION_NUMBER; 133 | public const int MAX_PRIORITIES; 134 | 135 | [CCode (lower_case_cprefix = "evutil_")] 136 | namespace Util { 137 | [SimpleType, CCode (cname = "evutil_socket_t")] 138 | public struct Socket { 139 | [CCode (cname = "evutil_socketpair")] 140 | public static int create_pair (int d, int type, int protocol, [CCode (array_length = false)] LibEvent.Util.Socket sv[2]); 141 | [CCode (cname = "evutil_make_socket_nonblocking")] 142 | public int make_nonblocking (); 143 | [CCode (cname = "evutil_make_listen_socket_reuseable")] 144 | public int make_listen_reuseable(); 145 | [CCode (cname = "evutil_make_socket_closeonexec")] 146 | public int make_close_on_exec(); 147 | [CCode (cname = "evutil_closesocket")] 148 | public int close (); 149 | [CCode (cname = "evutil_socket_geterror")] 150 | public int get_error (); 151 | [CCode (cname = "evutil_socket_error_to_string")] 152 | public static unowned string error_to_string (int errcode); 153 | } 154 | } 155 | } 156 | -------------------------------------------------------------------------------- /libudev.vapi: -------------------------------------------------------------------------------- 1 | /* libudev Vala Bindings 2 | * Copyright (c) 2019 Hannes Schulze 3 | * 4 | * This library is free software; you can redistribute it and/or modify it 5 | * under the terms of the GNU Lesser General Public License as published by 6 | * the Free Software Foundation; either version 2.1 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, but 10 | * WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public License 15 | * along with this library; if not, write to the Free Software Foundation, Inc., 16 | * 51 Franklin St, Fifth Floor, Boston, MA 02110, USA 17 | */ 18 | 19 | [CCode (cheader_filename = "libudev.h")] 20 | namespace Udev { 21 | /** 22 | * reads the udev config and system environment 23 | * allows custom logging 24 | */ 25 | [CCode (cname = "struct udev", ref_function = "udev_ref", unref_function = "udev_unref")] 26 | [Compact] 27 | public class Udev { 28 | [CCode (cname = "udev_new")] 29 | public Udev (); 30 | } 31 | 32 | /** 33 | * access to libudev generated lists 34 | */ 35 | [CCode (cname = "struct udev_list_entry")] 36 | [Compact] 37 | public class ListEntry { 38 | public ListEntry? get_next (); 39 | public ListEntry? get_by_name (string name); 40 | public unowned string get_name (); 41 | public unowned string get_value (); 42 | } 43 | 44 | /** 45 | * access to sysfs/kernel devices 46 | */ 47 | [CCode (cname = "struct udev_device", ref_function = "udev_device_ref", unref_function = "udev_device_unref")] 48 | [Compact] 49 | public class Device { 50 | public Device.from_syspath (Udev udev, string syspath); 51 | public Device.from_devnum (Udev udev, char type, Posix.dev_t devnum); 52 | public Device.from_subsystem_sysname (Udev udev, string subsystem, string sysname); 53 | public Device.from_device_id (Udev udev, string id); 54 | public Device.from_environment (Udev udev); 55 | public unowned Udev get_udev (); 56 | 57 | public Device? get_parent (); 58 | public Device? get_parent_with_subsystem_devtype (string subsystem, string devtype); 59 | public unowned string get_devpath (); 60 | public unowned string? get_subsystem (); 61 | public unowned string? get_devtype (); 62 | public unowned string get_syspath (); 63 | public unowned string get_sysname (); 64 | public unowned string get_sysnum (); 65 | public unowned string? get_devnode (); 66 | public int get_is_initialized (); 67 | public ListEntry get_devlinks_list_entry (); 68 | public ListEntry get_properties_list_entry (); 69 | public ListEntry get_tags_list_entry (); 70 | public ListEntry get_sysattr_list_entry (); 71 | public unowned string? get_property_value (string key); 72 | public unowned string? get_driver (); 73 | public Posix.dev_t get_devnum (); 74 | public unowned string? get_action (); 75 | public unowned string? get_sysattr_value (string sysattr); 76 | public int set_sysattr_value (string sysattr, string val); 77 | public int has_tag (string tag); 78 | } 79 | 80 | /** 81 | * access to kernel uevents and udev events 82 | */ 83 | [CCode (cname = "struct udev_monitor", ref_function = "udev_monitor_ref", unref_function = "udev_monitor_unref")] 84 | [Compact] 85 | public class Monitor { 86 | public Monitor.from_netlink (Udev udev, string name); 87 | 88 | public unowned Udev get_udev (); 89 | public int enable_receiving (); 90 | public int set_receive_buffer_size (int size); 91 | public int get_fd (); 92 | public Device? receive_device (); 93 | public int filter_add_match_subsystem_devtype (string subsystem, string devtype); 94 | public int filter_add_match_tag (string tag); 95 | public int filter_update (); 96 | public int filter_remove (); 97 | } 98 | 99 | /** 100 | * search sysfs for specific devices and provide a sorted list 101 | */ 102 | [CCode (cname = "struct udev_enumerate", ref_function = "udev_enumerate_ref", unref_function = "udev_enumerate_unref")] 103 | [Compact] 104 | public class Enumerate { 105 | public Enumerate (Udev udev); 106 | public unowned Udev get_udev (); 107 | public int add_match_subsystem (string subsystem); 108 | public int add_nomatch_subsystem (string subsystem); 109 | public int add_match_sysattr (string sysattr, string value); 110 | public int add_nomatch_sysattr (string sysattr, string value); 111 | public int add_match_property (string property, string value); 112 | public int add_match_sysname (string sysname); 113 | public int add_match_tag (string tag); 114 | public int add_match_parent (Device parent); 115 | public int add_match_is_initialized (); 116 | public int add_syspath (string syspath); 117 | public int scan_devices (); 118 | public int scan_subsystems (); 119 | public ListEntry get_list_entry (); 120 | } 121 | 122 | /** 123 | * access to the currently running udev events 124 | */ 125 | [CCode (cname = "struct udev_queue", ref_function = "udev_queue_ref", unref_function = "udev_queue_unref")] 126 | [Compact] 127 | public class Queue { 128 | public unowned Udev get_udev (); 129 | public Queue (Udev udev); 130 | public int get_udev_is_active (); 131 | public int get_queue_is_empty (); 132 | public int get_fd (); 133 | public int flush (); 134 | } 135 | 136 | /** 137 | * access to the static hardware properties database 138 | */ 139 | [CCode (cname = "struct udev_hwdb", ref_function = "udev_hwdb_ref", unref_function = "udev_hwdb_unref")] 140 | [Compact] 141 | public class Hwdb { 142 | public Hwdb (Udev udev); 143 | public ListEntry get_properties_list_entry (string modalias, uint flags); 144 | } 145 | 146 | /** 147 | * udev specific utilities 148 | */ 149 | [CCode (cname = "udev_util")] 150 | [Compact] 151 | public class Util { 152 | public static int encode_string (string str, string str_enc, size_t len); 153 | } 154 | } 155 | -------------------------------------------------------------------------------- /SDL2_image.vapi: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2016-2020 SDL2 VAPI Authors 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | * 24 | * Authors: 25 | * Mario Daniel Ruiz Saavedra 26 | * Gontzal Uriarte 27 | * Pedro H. Lara Campos 28 | */ 29 | 30 | [CCode (cheader_filename = "SDL2/SDL_image.h")] 31 | namespace SDLImage { 32 | //! Defines 33 | 34 | [CCode (cname = "IMG_InitFlags", cprefix = "IMG_INIT_")] 35 | public enum InitFlags { 36 | JPG, 37 | PNG, 38 | TIF, 39 | WEBP, 40 | [CCode (cname = "IMG_INIT_JPG|IMG_INIT_PNG|IMG_INIT_TIF|IMG_INIT_WEBP")] 41 | ALL 42 | } 43 | 44 | //! General 45 | 46 | [CCode (cname = "IMG_Linked_Version")] 47 | public static unowned SDL.Version? linked (); 48 | 49 | [CCode (cname = "IMG_Init")] 50 | public static int init (int flags); 51 | 52 | [CCode (cname = "IMG_Quit")] 53 | public static void quit (); 54 | 55 | //! Loading 56 | 57 | [CCode (cname = "IMG_Load")] 58 | public static SDL.Video.Surface? load (string file); 59 | 60 | [CCode (cname = "IMG_Load_RW")] 61 | public static SDL.Video.Surface? load_rw (SDL.RWops src, bool freesrc = false); 62 | 63 | [CCode (cname = "IMG_LoadTyped_RW")] 64 | public static SDL.Video.Surface? load_rw_typed (SDL.RWops src, bool freesrc, string type); 65 | 66 | [CCode (cname = "IMG_LoadTexture")] 67 | public static SDL.Video.Texture? load_texture (SDL.Video.Renderer renderer, string file); 68 | 69 | [CCode (cname = "IMG_LoadTexture_RW")] 70 | public static SDL.Video.Texture? load_texture_rw (SDL.Video.Renderer renderer, SDL.RWops src, bool freesrc = false); 71 | 72 | [CCode (cname = "IMG_LoadTextureTyped_RW")] 73 | public static SDL.Video.Texture? load_texture_rw_typed (SDL.Video.Renderer renderer, SDL.RWops src, bool freesrc, string type); 74 | 75 | [CCode (cname = "IMG_LoadCUR_RW")] 76 | public static SDL.Video.Surface? load_cur (SDL.RWops src); 77 | 78 | [CCode (cname = "IMG_LoadICO_RW")] 79 | public static SDL.Video.Surface? load_ico (SDL.RWops src); 80 | 81 | [CCode (cname = "IMG_LoadBMP_RW")] 82 | public static SDL.Video.Surface? load_bmp (SDL.RWops src); 83 | 84 | [CCode (cname = "IMG_LoadPNM_RW")] 85 | public static SDL.Video.Surface? load_pnm (SDL.RWops src); 86 | 87 | [CCode (cname = "IMG_LoadXPM_RW")] 88 | public static SDL.Video.Surface? load_xpm (SDL.RWops src); 89 | 90 | [CCode (cname = "IMG_LoadXCF_RW")] 91 | public static SDL.Video.Surface? load_xcf (SDL.RWops src); 92 | 93 | [CCode (cname = "IMG_LoadPCX_RW")] 94 | public static SDL.Video.Surface? load_pcx (SDL.RWops src); 95 | 96 | [CCode (cname = "IMG_LoadGIF_RW")] 97 | public static SDL.Video.Surface? load_gif (SDL.RWops src); 98 | 99 | [CCode (cname = "IMG_LoadJPG_RW")] 100 | public static SDL.Video.Surface? load_jpg (SDL.RWops src); 101 | 102 | [CCode (cname = "IMG_LoadTIF_RW")] 103 | public static SDL.Video.Surface? load_tif (SDL.RWops src); 104 | 105 | [CCode (cname = "IMG_LoadPNG_RW")] 106 | public static SDL.Video.Surface? load_png (SDL.RWops src); 107 | 108 | [CCode (cname = "IMG_LoadTGA_RW")] 109 | public static SDL.Video.Surface? load_tga (SDL.RWops src); 110 | 111 | [CCode (cname = "IMG_LoadLBM_RW")] 112 | public static SDL.Video.Surface? load_lbm (SDL.RWops src); 113 | 114 | [CCode (cname = "IMG_LoadXV_RW")] 115 | public static SDL.Video.Surface? load_xv (SDL.RWops src); 116 | 117 | [CCode (cname = "IMG_LoadWEBP_RW")] 118 | public static SDL.Video.Surface? load_webp (SDL.RWops src); 119 | 120 | [CCode (cname = "IMG_ReadXPMFromArray")] 121 | public static SDL.Video.Surface? read_xpm ([CCode (array_length = false)] string[] xpmdata); 122 | 123 | [CCode (cname = "IMG_SavePNG")] 124 | public static int save_as_png (SDL.Video.Surface surface, string file); 125 | 126 | [CCode (cname = "IMG_SavePNG_RW")] 127 | public static int save_as_png_rw (SDL.Video.Surface surface, SDL.RWops dst, bool freedst); 128 | 129 | [CCode (cname = "IMG_SaveJPG")] 130 | public static int save_as_jpg (SDL.Video.Surface surface, string file, int quality); 131 | 132 | [CCode (cname = "IMG_SaveJPG_RW")] 133 | public static int save_as_jpg_rw (SDL.Video.Surface surface, SDL.RWops dst, bool freedst, int quality); 134 | 135 | //!Info 136 | 137 | [CCode (cname = "IMG_isCUR")] 138 | public static bool is_cur (SDL.RWops src); 139 | 140 | [CCode (cname = "IMG_isICO")] 141 | public static bool is_ico (SDL.RWops src); 142 | 143 | [CCode (cname = "IMG_isBMP")] 144 | public static bool is_bmp (SDL.RWops src); 145 | 146 | [CCode (cname = "IMG_isPNM")] 147 | public static bool is_pnm (SDL.RWops src); 148 | 149 | [CCode (cname = "IMG_isXPM")] 150 | public static bool is_xpm (SDL.RWops src); 151 | 152 | [CCode (cname = "IMG_isXCF")] 153 | public static bool is_xcf (SDL.RWops src); 154 | 155 | [CCode (cname = "IMG_isPCX")] 156 | public static bool is_pcx (SDL.RWops src); 157 | 158 | [CCode (cname = "IMG_isGIF")] 159 | public static bool is_gif (SDL.RWops src); 160 | 161 | [CCode (cname = "IMG_isJPG")] 162 | public static bool is_jpg (SDL.RWops src); 163 | 164 | [CCode (cname = "IMG_isTIF")] 165 | public static bool is_tif (SDL.RWops src); 166 | 167 | [CCode (cname = "IMG_isPNG")] 168 | public static bool is_png (SDL.RWops src); 169 | 170 | [CCode (cname = "IMG_isLBM")] 171 | public static bool is_lbm (SDL.RWops src); 172 | 173 | [CCode (cname = "IMG_isXV")] 174 | public static bool is_xv (SDL.RWops src); 175 | 176 | [CCode (cname = "IMG_isWEBP")] 177 | public static bool is_webp (SDL.RWops src); 178 | } // SDLImage 179 | -------------------------------------------------------------------------------- /sasl2.vapi: -------------------------------------------------------------------------------- 1 | /* Cyrus SASL2 Vala Bindings 2 | * Copyright 2019 Jelmer Vernooij 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | [CCode (cheader_filename = "sasl/sasl.h", cprefix="", lower_case_cprefix=""), Compact] 26 | namespace Sasl2 { 27 | [Compact, CCode(cname="sasl_conn_t", lower_case_cprefix="sasl_", free_function="sasl_dispose")] 28 | public class Connection { 29 | public Result client_step( 30 | [CCode (array_length_type = "uint")] uint8[] serverin, 31 | out Interact prompt_need, 32 | [CCode (array_length_type = "uint")] out uint8[] clientout); 33 | 34 | public Result client_start( 35 | string mechlist, out Interact prompt_need, 36 | [CCode (array_length_type = "uint")] out uint8[] clientout, out string mech); 37 | 38 | public Result listmech( 39 | string user, string prefix, string sep, string suffix, 40 | out string result, out uint plen, out uint pcount); 41 | 42 | public Result setprop(Property propnum, void *value); 43 | public Result getprop(Property propnum, out void *value); 44 | 45 | public Result encode( 46 | [CCode (array_length_type = "uint")] uint8[] input, 47 | [CCode (array_length_type = "uint")] out uint8[] output); 48 | 49 | public Result decode( 50 | [CCode (array_length_type = "uint")] uint8[] input, 51 | [CCode (array_length_type = "uint")] out uint8[] output); 52 | 53 | public string errdetail(); 54 | 55 | [PrintfFormat] 56 | public void seterror(uint flags, string format, ...); 57 | 58 | public int idle(); 59 | } 60 | 61 | [CCode (cname = "sasl_errstring")] 62 | public string errstring(int saslerr, string? langlist, out string outlang); 63 | 64 | [CCode (cname = "sasl_version")] 65 | public void version(out string implementation, out int version); 66 | 67 | [CCode (cname = "sasl_version_info")] 68 | public void version_info( 69 | out string implementation, 70 | out string version_string, 71 | out int version_major, 72 | out int version_minor, 73 | out int version_step, 74 | out int version_patch); 75 | 76 | [CCode (cname = "sasl_client_init")] 77 | public Result client_init([CCode(array_length=false)] Callback[]? callback); 78 | 79 | [CCode (cname = "sasl_client_done")] 80 | public void client_done(); 81 | 82 | [CCode (cname = "sasl_client_new")] 83 | public Result client_new( 84 | string service, string serverFQDN, 85 | string? iplocalport, string? ipremoteport, 86 | [CCode(array_length=false)] Callback[]? prompt_supp, uint flags, 87 | out Connection pconn); 88 | 89 | [CCode (cname = "sasl_callback_t", destroy_function = "")] 90 | public struct Callback { 91 | public CallbackId id; 92 | [CCode (delegate_target_cname = "context")] 93 | public unowned T proc; 94 | void *context; 95 | } 96 | 97 | [CCode (cname = "sasl_interact_t", destroy_function = "")] 98 | public struct Interact { 99 | public uint id; 100 | public string challenge; 101 | public string prompt; 102 | public string defresult; 103 | [CCode (array_length_type = "uint")] public void* result; 104 | } 105 | 106 | // Flags for sasl_server_new and sasl_client_new 107 | public int SASL_SUCCESS_DATA; 108 | public int SASL_NEED_PROXY; 109 | public int SASL_NEED_HTTP; 110 | 111 | // Errors 112 | [CCode (cname = "int", cprefix = "SASL_")] 113 | public enum Result { 114 | CONTINUE, 115 | OK, 116 | FAIL, 117 | NOMEM, 118 | BUFOVER, 119 | NOMECH, 120 | BADPROT, 121 | NOTDONE, 122 | BADPARAM, 123 | TRYAGAIN, 124 | BADMAC, 125 | NOTINIT, 126 | 127 | INTERACT, 128 | BADSERV, 129 | WRONGMECH, 130 | 131 | BADAUTH, 132 | NOAUTHZ, 133 | TOOWEAK, 134 | ENCRYPT, 135 | TRANS, 136 | 137 | EXPIRED, 138 | DISABLED, 139 | NOUSER, 140 | BADVERS, 141 | UNAVAIL, 142 | NOVERIFY, 143 | 144 | PWLOCK, 145 | NOCHANGE, 146 | WEAKPASS, 147 | NOUSERPASS, 148 | NEED_OLD_PASSWD, 149 | 150 | CONSTRAINT_VIOLAT, 151 | 152 | BADBINDING, 153 | CONFIGERR, 154 | 155 | MECHNAMEMAX, 156 | } 157 | 158 | // Properties 159 | [CCode (cname="int", cprefix="SASL_")] 160 | public enum Property { 161 | USERNAME, 162 | SSF, 163 | MAXOUTBUF, 164 | DEFUSERREALM, 165 | GETOPTCTX, 166 | CALLBACK, 167 | IPLOCALPORT, 168 | IPREMOTEPORT, 169 | PLUGERR, 170 | DELEGATEDCREDS, 171 | 172 | SERVICE, 173 | SERVERFQDN, 174 | AUTHSOURCE, 175 | MECHNAME, 176 | AUTHUSER, 177 | APPNAME, 178 | GSS_CREDS, 179 | GSS_PEER_NAME, 180 | GSS_LOCAL_NAME, 181 | CHANNEL_BINDING, 182 | HTTP_REQUEST, 183 | } 184 | 185 | // Callback ids 186 | [CCode (cname = "sasl_getsimple_t", has_target = false)] 187 | public delegate Result GetSimpleFunc(void *context, CallbackId cb, [CCode (array_length_type = "uint")] out uint8[] result); 188 | 189 | [CCode (cname = "int", cprefix="SASL_CB_")] 190 | public enum CallbackId { 191 | LIST_END, 192 | USER, 193 | AUTHNAME, 194 | LANGUAGE, 195 | NONCE, 196 | PASS, 197 | ECHOPROMPT, 198 | NOECHOPROMPT, 199 | GETREALM, 200 | PROXY_POLICY, 201 | } 202 | 203 | [CCode (cname = "sasl_secret_t", destroy_function="", copy_function="")] 204 | public struct Secret { 205 | [CCode (array_length_cname = "len", array_length_type="ulong")] 206 | uint8[] data; 207 | } 208 | [CCode (cname = "sasl_getsecret_t", has_target = false)] 209 | public delegate Result GetSecretFunc(Connection conn, void *context, CallbackId cb, out Secret? secret); 210 | } 211 | -------------------------------------------------------------------------------- /xcb-shape.vapi: -------------------------------------------------------------------------------- 1 | /* 2 | * This library is free software; you can redistribute it and/or 3 | * modify it under the terms of the GNU Lesser General Public 4 | * License as published by the Free Software Foundation; either 5 | * version 2.1 of the License, or (at your option) any later version. 6 | * 7 | * This library is distributed in the hope that it will be useful, 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 | * Lesser General Public License for more details. 11 | * 12 | * You should have received a copy of the GNU Lesser General Public 13 | * License along with this library; if not, write to the Free Software 14 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 15 | */ 16 | 17 | using Xcb; 18 | 19 | namespace Xcb { 20 | 21 | [CCode (cprefix = "xcb_shape_", cheader_filename = "xcb/shape.h")] 22 | namespace Shape { 23 | public static Connection get_connection (Xcb.Connection c) { 24 | return (Connection) c; 25 | } 26 | 27 | [Compact] 28 | [CCode (cname = "xcb_connection_t", cprefix = "xcb_shape_", unref_function = "")] 29 | public class Connection : Xcb.Connection { 30 | public QueryVersionCookie query_version (); 31 | public QueryVersionCookie query_version_unchecked (); 32 | public QueryVersionReply? query_version_reply (QueryVersionCookie cookie, out Xcb.GenericError? e = null); 33 | 34 | public VoidCookie rectangles_checked (Op operation, Kind destination_kind, uint8 ordering, Xcb.Window destination_window, int16 x_offset, int16 y_offset, [CCode (array_length_pos = 6.9, array_length_type = "uint32_t")] Xcb.Rectangle[] rectangles); 35 | public VoidCookie rectangles (Op operation, Kind destination_kind, uint8 ordering, Xcb.Window destination_window, int16 x_offset, int16 y_offset, [CCode (array_length_pos = 6.9, array_length_type = "uint32_t")] Xcb.Rectangle[] rectangles); 36 | 37 | public VoidCookie shape_mask_checked (Op operation, Kind destination_kind, uint8 ordering, Xcb.Window destination_window, int16 x_offset, int16 y_offset, Xcb.Pixmap source_bitmap); 38 | public VoidCookie shape_mask (Op operation, Kind destination_kind, uint8 ordering, Xcb.Window destination_window, int16 x_offset, int16 y_offset, Xcb.Pixmap source_bitmap); 39 | 40 | public VoidCookie shape_combine_checked (Op operation, Kind destination_kind, Kind source_kind, Xcb.Window destination_window, int16 x_offset, int16 y_offset, Xcb.Window source_window); 41 | public VoidCookie shape_combine (Op operation, Kind destination_kind, Kind source_kind, Xcb.Window destination_window, int16 x_offset, int16 y_offset, Xcb.Window source_window); 42 | 43 | public VoidCookie shape_offset_checked (Kind destination_kind, Xcb.Window destination_window, int16 x_offset, int16 y_offset); 44 | public VoidCookie shape_offset (Kind destination_kind, Xcb.Window destination_window, int16 x_offset, int16 y_offset); 45 | 46 | public QueryExtentsCookie query_extents (Xcb.Window destination_window); 47 | public QueryExtentsCookie query_extents_unchecked (Xcb.Window destination_window); 48 | public QueryExtentsReply query_extents_reply (QueryExtentsCookie cookie, out Xcb.GenericError? e = null); 49 | 50 | public VoidCookie select_input_checked (Xcb.Window destination_window, bool enable); 51 | public VoidCookie select_input (Xcb.Window destination_window, bool enable); 52 | 53 | public InputSelectedCookie input_selected (Xcb.Window destination_window); 54 | public InputSelectedCookie input_selected_unchecked (Xcb.Window destination_window); 55 | public InputSelectedReply input_selected_reply (InputSelectedCookie cookie, out Xcb.GenericError? e = null); 56 | 57 | public GetRectanglesCookie get_rectangles (Xcb.Window window, Kind source_kind); 58 | public GetRectanglesCookie get_rectangles_unchecked (Xcb.Window window, Kind source_kind); 59 | public GetRectanglesReply get_rectangles_reply (GetRectanglesCookie cookie, out Xcb.GenericError? e = null); 60 | } 61 | 62 | [SimpleType] 63 | [CCode (cname = "xcb_shape_op_t", has_type_id = false)] 64 | public struct Op : uint8 { 65 | } 66 | 67 | [SimpleType] 68 | [CCode (cname = "xcb_shape_kind_t", has_type_id = false)] 69 | public struct Kind : uint8 { 70 | } 71 | 72 | [CCode (cname = "xcb_shape_so_t", has_type_id = false)] 73 | public enum SO // FIXME: Does this replace Op? 74 | { 75 | SET, 76 | UNION, 77 | INTERSECT, 78 | SUBTRACT, 79 | INVERT 80 | } 81 | 82 | [CCode (cname = "xcb_shape_sk_t", has_type_id = false)] 83 | public enum SK // FIXME: Does this replace Kind? 84 | { 85 | BOUNDING, 86 | CLIP, 87 | INPUT 88 | } 89 | 90 | [SimpleType] 91 | [IntegerType (rank = 9)] 92 | [CCode (cname = "xcb_shape_query_version_cookie_t", has_type_id = false)] 93 | public struct QueryVersionCookie { 94 | } 95 | 96 | [Compact] 97 | [CCode (cname = "xcb_shape_query_version_reply_t", ref_function = "", unref_function = "free")] 98 | public struct QueryVersionReply { 99 | public uint16 major_version; 100 | public uint16 minor_version; 101 | } 102 | 103 | [SimpleType] 104 | [IntegerType (rank = 9)] 105 | [CCode (cname = "xcb_shape_query_extents_cookie_t", has_type_id = false)] 106 | public struct QueryExtentsCookie { 107 | } 108 | 109 | [Compact] 110 | [CCode (cname = "xcb_shape_query_extents_reply_t", ref_function = "", unref_function = "free")] 111 | public struct QueryExtentsReply { 112 | public bool bounding_shaped; 113 | public bool clip_shaped; 114 | public uint16 bounding_shape_extents_x; 115 | public uint16 bounding_shape_extents_y; 116 | public uint16 bounding_shape_extents_width; 117 | public uint16 bounding_shape_extents_height; 118 | public uint16 clip_shape_extents_x; 119 | public uint16 clip_shape_extents_y; 120 | public uint16 clip_shape_extents_width; 121 | public uint16 clip_shape_extents_height; 122 | } 123 | 124 | [SimpleType] 125 | [IntegerType (rank = 9)] 126 | [CCode (cname = "xcb_shape_input_selected_cookie_t", has_type_id = false)] 127 | public struct InputSelectedCookie { 128 | } 129 | 130 | [Compact] 131 | [CCode (cname = "xcb_shape_input_selected_reply_t", ref_function = "", unref_function = "free")] 132 | public struct InputSelectedReply { 133 | public bool enabled; 134 | } 135 | 136 | [SimpleType] 137 | [IntegerType (rank = 9)] 138 | [CCode (cname = "xcb_shape_get_rectangles_cookie_t", has_type_id = false)] 139 | public struct GetRectanglesCookie { 140 | } 141 | 142 | [Compact] 143 | [CCode (cname = "xcb_shape_get_rectangles_reply_t", ref_function = "", unref_function = "free")] 144 | public struct GetRectanglesReply { 145 | private uint8 ordering; // FIXME: What type? 146 | private uint32 rectangles_len; 147 | [CCode (cname = "xcb_shape_get_rectangles_rectangles")] 148 | private Xcb.Rectangle* vala_rectangles (); 149 | public Xcb.Rectangle[] rectangles 150 | { 151 | get { 152 | unowned Xcb.Rectangle[] res = (Xcb.Rectangle[]) vala_rectangles (); 153 | res.length = (int) rectangles_len; 154 | return res; 155 | } 156 | } 157 | } 158 | } 159 | } 160 | -------------------------------------------------------------------------------- /portmidi.vapi: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2013 Roman Soumin 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions 7 | are met: 8 | 9 | - Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | - Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in 13 | the documentation and/or other materials provided with the 14 | distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 19 | FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 20 | COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 22 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 24 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 26 | ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | [CCode (cprefix = "Pm", lower_case_cprefix = "", cheader_filename = "portmidi.h")] 31 | namespace PortMidi { 32 | 33 | public struct DeviceID: int {} 34 | public struct Timestamp: long {} 35 | 36 | [CCode (cname = "pmNoDevice")] 37 | public const DeviceID NO_DEVICE; 38 | 39 | [Compact] 40 | public class DeviceInfo { 41 | [CCode (cname = "Pm_GetDeviceInfo")] 42 | public static unowned DeviceInfo from_id(DeviceID id); 43 | [CCode (cname = "structVersion")] 44 | public int struct_version; 45 | public string interf; 46 | public string name; 47 | public bool input; 48 | public bool output; 49 | public bool opened; 50 | } 51 | 52 | public enum Error { 53 | [CCode (cname = "FALSE")] FALSE, 54 | [CCode (cname = "TRUE")] TRUE, 55 | [CCode (cname = "pmNoError")] NO_ERROR, 56 | [CCode (cname = "pmNoData")] NO_DATA, 57 | [CCode (cname = "pmGotData")] GOT_DATA, 58 | [CCode (cname = "pmHostError")] HOST_ERROR, 59 | [CCode (cname = "pmInvalidDeviceId")] INVALID_DEVICE_ID, 60 | [CCode (cname = "pmInsufficientMemory")] INSUFFICIENT_MEMORY, 61 | [CCode (cname = "pmBufferTooSmall")] BUFFER_TOO_SMALL, 62 | [CCode (cname = "pmBufferOverflow")] BUFFER_OVERFLOW, 63 | [CCode (cname = "pmBadPtr")] BAD_PTR, 64 | [CCode (cname = "pmBadData")] BAD_DATA, 65 | [CCode (cname = "pmInternalError")] INTERNAL_ERROR, 66 | [CCode (cname = "pmBufferMaxSize")] BUFFER_MAX_SIZE 67 | } 68 | 69 | public struct Message: long { 70 | [CCode (cname = "Pm_Message")] 71 | public Message(int status, int data1, int data2); 72 | [CCode (cname = "Pm_MessageStatus")] 73 | public int status(); 74 | [CCode (cname = "Pm_MessageData1")] 75 | public int data1(); 76 | [CCode (cname = "Pm_MessageData2")] 77 | public int data2(); 78 | } 79 | 80 | public struct Event { 81 | Message message; 82 | Timestamp timestamp; 83 | } 84 | 85 | [Compact] 86 | [CCode (free_function = "Pm_Close")] 87 | class Stream { 88 | public struct Filters: ulong {} 89 | 90 | [CCode (cname = "PM_FILT_ACTIVE")] 91 | public const Filters FILT_ACTIVE; 92 | [CCode (cname = "PM_FILT_SYSEX")] 93 | public const Filters FILT_SYSEX; 94 | [CCode (cname = "PM_FILT_CLOCK")] 95 | public const Filters FILT_CLOCK; 96 | [CCode (cname = "PM_FILT_PLAY")] 97 | public const Filters FILT_PLAY; 98 | [CCode (cname = "PM_FILT_TICK")] 99 | public const Filters FILT_TICK; 100 | [CCode (cname = "PM_FILT_FD")] 101 | public const Filters FILT_FD; 102 | [CCode (cname = "PM_FILT_UNDEFINED")] 103 | public const Filters FILT_UNDEFINED; 104 | [CCode (cname = "PM_FILT_RESET")] 105 | public const Filters FILT_RESET; 106 | [CCode (cname = "PM_FILT_REALTIME")] 107 | public const Filters FILT_REALTIME; 108 | [CCode (cname = "PM_FILT_NOTE")] 109 | public const Filters FILT_NOTE; 110 | [CCode (cname = "PM_FILT_CHANNEL_AFTERTOUCH")] 111 | public const Filters FILT_CHANNEL_AFTERTOUCH; 112 | [CCode (cname = "PM_FILT_POLY_AFTERTOUCH")] 113 | public const Filters FILT_POLY_AFTERTOUCH; 114 | [CCode (cname = "PM_FILT_AFTERTOUCH")] 115 | public const Filters FILT_AFTERTOUCH; 116 | [CCode (cname = "PM_FILT_PROGRAM")] 117 | public const Filters PM_FILT_PROGRAM; 118 | [CCode (cname = "PM_FILT_CONTROL")] 119 | public const Filters FILT_CONTROL; 120 | [CCode (cname = "PM_FILT_PITCHBEND")] 121 | public const Filters FILT_PITCHBEND; 122 | [CCode (cname = "PM_FILT_MTC")] 123 | public const Filters FILT_MTC; 124 | [CCode (cname = "PM_FILT_SONG_POSITION")] 125 | public const Filters FILT_SONG_POSITION; 126 | [CCode (cname = "PM_FILT_SONG_SELECT")] 127 | public const Filters FILT_SONG_SELECT; 128 | [CCode (cname = "PM_FILT_TUNE")] 129 | public const Filters FILT_TUNE; 130 | [CCode (cname = "PM_FILT_SYSTEMCOMMON")] 131 | public const Filters FILT_SYSTEMCOMMON; 132 | 133 | public delegate Timestamp TimeProc(); 134 | 135 | [CCode (cname = "Pm_OpenInput")] 136 | public static Error open_input(out Stream stream, 137 | DeviceID inputDevice, 138 | void* inputDriverInfo, 139 | long bufferSize, 140 | TimeProc? time_proc); 141 | 142 | [CCode (cname = "Pm_OpenOutput")] 143 | public static Error open_output(out Stream stream, 144 | DeviceID outputDevice, 145 | void* outputDriverInfo, 146 | long bufferSize, 147 | TimeProc? time_proc, 148 | long latency); 149 | 150 | [CCode (cname = "Pm_HasHostError")] 151 | bool has_host_error(); 152 | 153 | [CCode (cname = "Pm_SetFilter")] 154 | public Error set_filter(Filters filters); 155 | 156 | [CCode (cname = "Pm_SetChannelMask")] 157 | public Error set_channel_mask(int mask); 158 | 159 | [CCode (cname = "Pm_Abort")] 160 | public Error abort(); 161 | 162 | [CCode (cname = "Pm_Read")] 163 | public int read(Event[] buffer); 164 | 165 | [CCode (cname = "Pm_Poll")] 166 | public Error poll(); 167 | 168 | [CCode (cname = "Pm_Write")] 169 | public Error write(Event[] buffer); 170 | 171 | [CCode (cname = "Pm_WriteShort")] 172 | public Error write_short(Timestamp when, long msg); 173 | 174 | [CCode (cname = "Pm_WriteSysEx")] 175 | public Error write_sys_ex(Timestamp when, string msg); 176 | } 177 | 178 | 179 | [CCode (cname = "Pm_Initialize")] 180 | public Error initialize(); 181 | [CCode (cname = "Pm_Terminate")] 182 | public Error terminate(); 183 | [CCode (cname = "Pm_GetErrorText")] 184 | public string get_error_text(Error errorNum); 185 | [CCode (cname = "Pm_CountDevices")] 186 | public int count_devices(); 187 | [CCode (cname = "Pm_GetDefaultInputDeviceID")] 188 | public DeviceID get_default_input_device_id(); 189 | [CCode (cname = "Pm_GetDefaultOutputDeviceID")] 190 | public DeviceID get_default_output_device_id(); 191 | [CCode (cname = "Pm_Channel")] 192 | public int channel_mask(uint channel); 193 | } 194 | -------------------------------------------------------------------------------- /sensors.vapi: -------------------------------------------------------------------------------- 1 | /* sensors.vapi 2 | * 3 | * Copyright (C) 2011 Nikolay Orlyuk 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2.1 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | * 19 | * Author: 20 | * Nikolay Orlyuk 21 | */ 22 | 23 | 24 | [CCode (lower_case_cprefix = "sensors_", cheader_filename = "sensors/sensors.h")] 25 | namespace Sensors { 26 | 27 | [CCode (cname = "libsensors_version")] 28 | public const string version; 29 | 30 | [CCode (cname = "SENSORS_API_VERSION")] 31 | public const int api; 32 | 33 | 34 | /* Data structures */ 35 | 36 | [CCode (cname = "sensors_feature_type", cprefix = "SENSORS_FEATURE_")] 37 | public enum FeatureType { 38 | IN, 39 | FAN, 40 | TEMP, 41 | POWER, 42 | ENERGY, 43 | CURR, 44 | HUMIDITY, 45 | MAX_MAIN, 46 | VID, 47 | INTRUSION, 48 | BEEP_ENABLE, 49 | UNKNOWN 50 | } 51 | 52 | [CCode (cname = "sensors_subfeature_type", cprefix = "SENSORS_SUBFEATURE_")] 53 | public enum SubFeatureType { 54 | IN_INPUT, 55 | IN_MIN, 56 | IN_MAX, 57 | IN_LCRIT, 58 | IN_CRIT, 59 | IN_ALARM, 60 | IN_MIN_ALARM, 61 | IN_MAX_ALARM, 62 | IN_BEEP, 63 | IN_LCRIT_ALARM, 64 | IN_CRIT_ALARM, 65 | 66 | FAN_INPUT, 67 | FAN_MIN, 68 | FAN_ALARM, 69 | FAN_FAULT, 70 | FAN_DIV, 71 | FAN_BEEP, 72 | FAN_PULSES, 73 | 74 | TEMP_INPUT, 75 | TEMP_MAX, 76 | TEMP_MAX_HYST, 77 | TEMP_MIN, 78 | TEMP_CRIT, 79 | TEMP_CRIT_HYST, 80 | TEMP_LCRIT, 81 | TEMP_EMERGENCY, 82 | TEMP_EMERGENCY_HYST, 83 | TEMP_ALARM, 84 | TEMP_MAX_ALARM, 85 | TEMP_MIN_ALARM, 86 | TEMP_CRIT_ALARM, 87 | TEMP_FAULT, 88 | TEMP_TYPE, 89 | TEMP_OFFSET, 90 | TEMP_BEEP, 91 | TEMP_EMERGENCY_ALARM, 92 | TEMP_LCRIT_ALARM, 93 | 94 | POWER_AVERAGE, 95 | POWER_AVERAGE_HIGHEST, 96 | POWER_AVERAGE_LOWEST, 97 | POWER_INPUT, 98 | POWER_INPUT_HIGHEST, 99 | POWER_INPUT_LOWEST, 100 | POWER_CAP, 101 | POWER_CAP_HYST, 102 | POWER_MAX, 103 | POWER_CRIT, 104 | POWER_AVERAGE_INTERVAL, 105 | POWER_ALARM, 106 | POWER_CAP_ALARM, 107 | POWER_MAX_ALARM, 108 | POWER_CRIT_ALARM, 109 | 110 | ENERGY_INPUT, 111 | 112 | CURR_INPUT, 113 | CURR_MIN, 114 | CURR_MAX, 115 | CURR_LCRIT, 116 | CURR_CRIT, 117 | CURR_ALARM, 118 | CURR_MIN_ALARM, 119 | CURR_MAX_ALARM, 120 | CURR_BEEP, 121 | CURR_LCRIT_ALARM, 122 | CURR_CRIT_ALARM, 123 | 124 | HUMIDITY_INPUT, 125 | 126 | VID, 127 | 128 | INTRUSION_ALARM, 129 | INTRUSION_BEEP, 130 | 131 | BEEP_ENABLE, 132 | 133 | UNKNOWN 134 | } 135 | 136 | [CCode (cprefix = "SENSORS_BUS_TYPE_")] 137 | public enum BusType { 138 | ANY, 139 | I2C, 140 | ISA, 141 | PCI, 142 | SPI, 143 | VIRTUAL, 144 | ACPI, 145 | HID 146 | } 147 | 148 | [CCode (cname = "SENSORS_BUS_NR_ANY")] 149 | public const short bus_nr_any; 150 | 151 | [CCode (cname = "SENSORS_BUS_NR_IGNORE")] 152 | public const short bus_nr_ignore; 153 | 154 | /* Note Feature and SubFeature refs to objects that cleaned up somewhere else */ 155 | [CCode (cname = "sensors_feature", ref_function = "", unref_function = "")] 156 | public class Feature { 157 | public unowned string name; 158 | public int number; 159 | public FeatureType type; 160 | } 161 | 162 | [CCode (cname = "sensors_subfeature", ref_function = "", unref_function = "")] 163 | public class SubFeature { 164 | public unowned string name; // I guess it should be const in library 165 | public int number; 166 | public SubFeatureType type; 167 | public int mapping; 168 | public uint flags; 169 | } 170 | 171 | [CCode (cname = "sensors_bus_id", lower_case_cprefix = "sensors_")] 172 | public struct BusId { 173 | public BusType type; 174 | public short nr; 175 | 176 | public unowned string get_adapter_name(); 177 | } 178 | 179 | /* ChipName and features enumeration 180 | Note: chips have no copy implementation, so no cast from (unowned) to (owned) 181 | */ 182 | [CCode (cname = "sensors_chip_name", lower_case_cprefix = "sensors_", lower_case_csuffix = "_chip_name", destroy_function = "sensors_free_chip_name")] 183 | public struct ChipName { 184 | [CCode (default_value = "SENSORS_CHIP_NAME_PREFIX_ANY")] 185 | public string prefix; 186 | public BusId bus; 187 | [CCode (default_value = "SENSORS_CHIP_NAME_ADDR_ANY")] 188 | public int addr; 189 | public string path; 190 | 191 | [CCode (cname = "sensors_parse_chip_name", instance_pos = -1)] 192 | public ChipName(string orig_name); 193 | 194 | [CCode (cname = "sensors_parse_chip_name", instance_pos = -1)] 195 | public int parse(string orig_name); 196 | 197 | [CCode (cname = "sensors_snprintf_chip_name", instance_pos = -1)] 198 | public int snprintf(char[] buf); 199 | 200 | public Feature? get_features(ref int nr); 201 | 202 | [CCode (cname = "sensors_get_all_subfeatures")] 203 | public SubFeature? get_subfeatures(Feature feature, ref int nr); 204 | 205 | public string get_label(Feature feature); 206 | 207 | public string? to_string() 208 | { 209 | int n; 210 | { 211 | char buf[128]; 212 | n = snprintf(buf); 213 | if (n < 0 ) return null; 214 | if (n <= buf.length) return (string)buf; 215 | } 216 | 217 | // for rare cases 218 | var bigbuf = new char[n]; 219 | n = snprintf(bigbuf); 220 | if (n < 0 ) return null; 221 | if (n <= bigbuf.length) return (string)bigbuf; 222 | 223 | return null; 224 | } 225 | } 226 | 227 | 228 | /* Library initialization and clean-up */ 229 | public int init(Posix.FILE? config = null); 230 | 231 | public int init_filename(string name) 232 | { return init(Posix.FILE.open(name, "r")); } 233 | 234 | public void cleanup(); 235 | 236 | public unowned ChipName? get_detected_chips(ChipName? match, ref int nr); 237 | 238 | public string get_label(ChipName name, Feature feature); 239 | public int get_value(ChipName name, int subfeat_nr, out double value); 240 | public int set_value(ChipName name, int subfeat_nr, double value); 241 | 242 | /* Error decoding */ 243 | [CCode (cheader_filename = "sensors/error.h")] 244 | public unowned string strerror(int errnum); 245 | } 246 | -------------------------------------------------------------------------------- /leveldb.vapi: -------------------------------------------------------------------------------- 1 | /* LevelDB Vala Bindings 2 | * Copyright 2012 Evan Nemerson 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | [CCode (cheader_filename = "leveldb/c.h")] 26 | namespace LevelDB { 27 | [Compact, CCode (cname = "leveldb_t", lower_case_cprefix = "leveldb_", free_function = "leveldb_close")] 28 | public class Database { 29 | [CCode (cname = "leveldb_open")] 30 | public Database (LevelDB.Options options, string name, out string? err); 31 | 32 | public LevelDB.Iterator create_iterator (LevelDB.ReadOptions options); 33 | public LevelDB.Snapshot create_snapshot (); 34 | public void delete (LevelDB.WriteOptions options, [CCode (array_length_type = "size_t")] uint8[] key, out string? err); 35 | [CCode (cname = "leveldb_get", array_length_pos = 2.9, array_length_type = "size_t")] 36 | public uint8[]? get (LevelDB.ReadOptions options, [CCode (array_length_type = "size_t")] uint8[] key, out string? err); 37 | [CCode (cname = "leveldb_property_value")] 38 | public string get_property_value (string propname); 39 | public void put (LevelDB.WriteOptions options, [CCode (array_length_type = "size_t")] uint8[] key, [CCode (array_length_type = "size_t")] uint8[] val, out string? err); 40 | public void write (LevelDB.WriteOptions options, LevelDB.WriteBatch batch, out string? err); 41 | 42 | [CCode (cname = "leveldb_destroy_db")] 43 | public static void destroy (string name, out string? err); 44 | [CCode (cname = "leveldb_repair_db")] 45 | public static void repair (string name, out string? err); 46 | } 47 | 48 | [Compact, CCode (cname = "leveldb_cache_t", free_function = "leveldb_cache_destroy")] 49 | public class Cache { 50 | private Cache (); 51 | [CCode (cname = "leveldb_cache_create_lru")] 52 | public Cache.lru (size_t capacity); 53 | } 54 | 55 | [CCode (instance_pos = 0.1)] 56 | public delegate int CompareFunc ([CCode (array_length_type = "size_t")] uint8[] a, [CCode (array_length_type = "size_t")] uint8[] b); 57 | 58 | [CCode (has_target = false)] 59 | public delegate string NameFunc (); 60 | 61 | [Compact, CCode (cname = "leveldb_comparator_t", free_function = "leveldb_comparator_destroy")] 62 | public class Comparator { 63 | [CCode (cname = "leveldb_comparator_create")] 64 | public Comparator ([CCode (delegate_target_pos = 0.1, type = "int (*)(void*,const char*,size_t,const char*,size_t)")] owned LevelDB.CompareFunc compare, [CCode (type = "const char* (*)(void*)")] LevelDB.NameFunc name); 65 | } 66 | 67 | [CCode (cname = "int", has_type_id = false)] 68 | public enum Compression { 69 | [CCode (cname = "leveldb_no_compression")] 70 | NONE, 71 | [CCode (cname = "leveldb_snappy_compression")] 72 | SNAPPY 73 | } 74 | 75 | [Compact, CCode (cname = "leveldb_env_t", free_function = "leveldb_env_destroy")] 76 | public class Environment { 77 | private Environment (); 78 | [CCode (cname = "leveldb_create_default_env")] 79 | public Environment.default (); 80 | } 81 | 82 | [Compact, CCode (cname = "leveldb_iterator_t", lower_case_cprefix = "leveldb_iter_", free_function = "leveldb_iter_destroy")] 83 | public class Iterator { 84 | public bool valid (); 85 | public void seek_to_first (); 86 | public void seek_to_last (); 87 | public void seek ([CCode (type = "const char*", array_length_type = "size_t")] uint8[] k); 88 | public void next (); 89 | public void prev (); 90 | [CCode (array_length_type = "size_t")] 91 | public uint8[] key (); 92 | [CCode (array_length_type = "size_t")] 93 | public uint8[] value (); 94 | public void get_error (out string? err); 95 | } 96 | 97 | [Compact, CCode (cname = "leveldb_logger_t")] 98 | public class Logger { 99 | private Logger (); 100 | } 101 | 102 | [Compact, CCode (cname = "leveldb_options_t", lower_case_cprefix = "leveldb_options_", free_function = "leveldb_options_destroy")] 103 | public class Options { 104 | [CCode (cname = "leveldb_options_create")] 105 | public Options (); 106 | 107 | public void set_comparator (LevelDB.Comparator comparator); 108 | public void set_create_if_missing (bool compare_if_missing); 109 | public void set_error_if_exists (bool error_if_exists); 110 | public void set_paranoid_checks (bool paranoid_checks); 111 | public void set_env (LevelDB.Environment env); 112 | public void set_info_log (LevelDB.Logger info_log); 113 | public void set_write_buffer (size_t write_buffer); 114 | public void set_max_open_files (int max_open_files); 115 | public void set_cache (LevelDB.Cache cache); 116 | public void set_block_size (size_t block_size); 117 | public void set_block_restart_interval (int block_restart_interval); 118 | public void set_compression (LevelDB.Compression compression); 119 | } 120 | 121 | [Compact, CCode (cname = "leveldb_readoptions_t", lower_case_cprefix = "leveldb_readoptions_", free_function = "leveldb_readoptions_destroy")] 122 | public class ReadOptions { 123 | [CCode (cname = "leveldb_readoptions_create")] 124 | public ReadOptions (); 125 | 126 | public void set_fill_cache (bool fill_cache); 127 | public void set_snapshot (LevelDB.Snapshot snapshot); 128 | public void set_verify_checksums (bool verify_checksums); 129 | } 130 | 131 | [Compact, CCode (cname = "leveldb_snapshot_t", free_function = "leveldb_release_snapshot")] 132 | public class Snapshot { 133 | [CCode (cname = "leveldb_create_snapshot")] 134 | public Snapshot (LevelDB.Database db); 135 | } 136 | 137 | [Compact, CCode (cname = "leveldb_writeoptions_t", lower_case_cprefix = "leveldb_writeoptions_", free_function = "leveldb_writeoptions_destroy")] 138 | public class WriteOptions { 139 | [CCode (cname = "leveldb_writeoptions_create")] 140 | public WriteOptions (); 141 | 142 | public void set_sync (bool sync); 143 | } 144 | 145 | [Compact, CCode (cname = "leveldb_writebatch_t", free_function = "leveldb_writebatch_destroy", lower_case_cprefix = "leveldb_writebatch_")] 146 | public class WriteBatch { 147 | [CCode (cname = "leveldb_writebatch_create")] 148 | public WriteBatch (); 149 | 150 | [CCode (has_target = false, simple_generics = true)] 151 | public delegate void PutFunc (T state, [CCode (array_length_type = "size_t")] uint8[] key, [CCode (array_length_type = "size_t")] uint8[] val); 152 | [CCode (has_target = false, simple_generics = true)] 153 | public delegate void DeleteFunc (T state, [CCode (array_length_type = "size_t")] uint8[] key); 154 | 155 | public void clear (); 156 | public void delete ([CCode (array_length_type = "size_t")] uint8[] key); 157 | [CCode (simple_generics = true)] 158 | public void iterate (T state, LevelDB.WriteBatch.PutFunc put, LevelDB.WriteBatch.DeleteFunc delete); 159 | public void put ([CCode (array_length_type = "size_t")] uint8[] key, [CCode (array_length_type = "size_t")] uint8[] val); 160 | [CCode (cname = "leveldb_write", instance_pos = 2.5)] 161 | public void write (LevelDB.Database db, LevelDB.WriteOptions options, out string? err); 162 | } 163 | } 164 | -------------------------------------------------------------------------------- /libcolumbus.vapi: -------------------------------------------------------------------------------- 1 | /* libcolumbus Vala Bindings 2 | * Copyright 2016 Daniel 'grindhold' Brendle 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | [CCode (lower_case_cprefix = "col_", cheader_filename = "columbus1/columbus.h")] 26 | namespace Columbus { 27 | [Compact, CCode (cname = "ColWord", free_function = "col_word_delete")] 28 | /** 29 | * Used to label fields in {@link Columbus.Document}s 30 | */ 31 | public class Word { 32 | /** 33 | * Creates a new Word. Supply the name as string parameter. 34 | */ 35 | public Word (string utf8_word); 36 | 37 | /** 38 | * Returns the size of the given word 39 | */ 40 | public size_t length (); 41 | 42 | /** 43 | * Reads the stored string into the supplied buffer 44 | */ 45 | public void as_utf8 (uint8[] buffer); 46 | } 47 | 48 | [Compact, CCode (cname = "ColDocument", free_function = "col_document_delete")] 49 | /** 50 | * A document is a collection of one or more text-fields, labelled 51 | * with one {@link Columbus.Word} each. 52 | */ 53 | public class Document { 54 | /** 55 | * Creates a Document with the given (unique) id. 56 | */ 57 | public Document (int64 id); 58 | 59 | /** 60 | * Returns this document's id 61 | */ 62 | public int64 get_id (); 63 | 64 | /** 65 | * Assings some text to this document and labels it with 66 | * the given field_name 67 | */ 68 | public void add_text (Word field_name, string text_as_utf8); 69 | } 70 | 71 | [Compact, CCode (cname = "ColMatcher", free_function = "col_matcher_delete")] 72 | /** 73 | * The matcher class let's you execute queries against indexed 74 | * data. 75 | */ 76 | public class Matcher { 77 | /** 78 | * Creates a new Matcher 79 | */ 80 | public Matcher (); 81 | 82 | /** 83 | * Indexes the supplied Corpus 84 | */ 85 | public void index (Corpus c); 86 | 87 | /** 88 | * Executes a query against the index data with 89 | * the search term supplied as the first parameter 90 | * Returns a MatchResults object. 91 | */ 92 | public MatchResults match (string query_as_utf8); 93 | 94 | /** 95 | * Returns the matcher's {@link ErrorValues} object 96 | */ 97 | public ErrorValues get_error_values (); 98 | 99 | /** 100 | * Returns the matcher's {@link IndexWeights} object 101 | */ 102 | public IndexWeights get_index_weights (); 103 | } 104 | 105 | [Compact, CCode (cname = "ColMatchResults", free_function = "col_match_results_delete")] 106 | /** 107 | * Represents the hits that occured when a query against an index 108 | * has been executed. Each potential matchresult is enumerated 109 | * from 0 to n. 110 | */ 111 | public class MatchResults { 112 | /** 113 | * Creates a new MatchResults object 114 | */ 115 | public MatchResults (); 116 | 117 | /** 118 | * Returns the size of the MatchResults. Use it to iterate 119 | * over the searchresults together with the methods {@link MatchResults.get_id} 120 | * and {@link MatchResults.get_relevancy} 121 | */ 122 | public size_t size (); 123 | 124 | /** 125 | * Returns the id of the Document related to match with the 126 | * number i. 127 | */ 128 | public int64 get_id (size_t i); 129 | 130 | /** 131 | * Returns the calculated relevancy of the match with number i. 132 | * HERE BE DRAGONS: the c-api is broken here. the bug is known 133 | * details at: [[https://bugs.launchpad.net/libcolumbus/+bug/1622424]] 134 | */ 135 | public double get_relevancy (size_t i); 136 | } 137 | 138 | [Compact, CCode (cname = "ColCorpus", free_function = "col_corpus_delete")] 139 | /** 140 | * A corpus is a collection of documents that are to be indexed together 141 | */ 142 | public class Corpus { 143 | /** 144 | * Creates a new Corpus 145 | */ 146 | public Corpus (); 147 | 148 | /** 149 | * Adds the given document to the Corpus in order to make 150 | * it indexable 151 | */ 152 | public void add_document (Document d); 153 | } 154 | 155 | /* 156 | * These objects are implicitly created inside Columbus.Matcher classes 157 | * and apparently get destroyed along them. The C-API of libcolumbus does 158 | * not supply any unref/delete/destructor function, so I assume it gets 159 | * freed automatically when the corresponding matcher is being deleted. 160 | */ 161 | [Compact, CCode(cname = "ColIndexWeights", free_function = "")] 162 | /** 163 | * Used to manipulate the weight of the fields of documents. 164 | * 165 | * Useful if you e.g. search a collection of address records phone numbers, 166 | * you can make the phone-number field more relevant than the postal code 167 | * so you get more useful output even if the postal code would match the 168 | * phone number the user searched for. 169 | * You cannot access this class directly. Access it though 170 | * {@link Columbus.Matcher.get_index_weights()} 171 | */ 172 | public class IndexWeights { 173 | /** 174 | * Set the weight of a specific word (name of a field in a) {@link Columbus.Document} 175 | */ 176 | public void set_weight (Word field, double new_weight); 177 | 178 | /** 179 | * Returns the current weight of the given field. 180 | */ 181 | public double get_weight (Word field); 182 | } 183 | 184 | [SimpleType, CCode(cname = "ColErrorValues")] 185 | /** 186 | * This is your interface to adjust the error-checking-algorithms of 187 | * a {@link Columbus.Matcher}. 188 | */ 189 | public struct ErrorValues { 190 | /** 191 | * Tells the matcher to take accent-errors and keyboard-errors 192 | * into account. 193 | * 194 | * An accent error is a non matching accent on a letter. E.g. when 195 | * someone searched for "pâte" but actually meant to find "pâté" (which 196 | * is pretty delicious french food btw) 197 | * A keyboard error is, when some wanted to type a "J" and instead typed 198 | * a "K". Those two are directly beneath each other on your standard 199 | * QWERTY/QWERTZ keyboard. 200 | */ 201 | public void add_standard_errors (); 202 | 203 | /** 204 | * Attempt to scan for substrings instead of full-word matching 205 | */ 206 | public void set_substring_mode (); 207 | } 208 | } 209 | -------------------------------------------------------------------------------- /alure.vapi: -------------------------------------------------------------------------------- 1 | /* 2 | * Alure1 binding for Vala 3 | * 4 | * Copyright 2020-2021 Anton "Vuvk" Shcherbatykh 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | * this software and associated documentation files (the "Software"), to deal in 8 | * the Software without restriction, including without limitation the rights to 9 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | * the Software, and to permit persons to whom the Software is furnished to do so, 11 | * subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | */ 23 | 24 | [CCode (cprefix = "", lower_case_cprefix = "", cheader_filename = "AL/alure.h")] 25 | namespace Alure 26 | { 27 | [CCode (cname = "alureGetVersion")] 28 | public void get_version (out AL.Uint major, out AL.Uint minor); 29 | [CCode (cname = "alureGetErrorString")] 30 | public unowned string? get_error_string (); 31 | 32 | [CCode (cname = "alureGetDeviceNames", array_length = false)] 33 | public unowned string?[] get_device_names (bool all, out ALC.Sizei count); 34 | [CCode (cname = "alureFreeDeviceNames")] 35 | public void free_device_names ([CCode (array_length = false)] string?[] names); 36 | 37 | [CCode (cname = "alureInitDevice")] 38 | public bool init_device (string? name = null, [CCode (array_length = false)] ALC.Int[]? attribs = null); 39 | [CCode (cname = "alureShutdownDevice")] 40 | public bool shutdown_device (); 41 | 42 | [CCode (cname = "alureGetSampleFormat")] 43 | public AL.Enum get_sample_format (AL.Uint channels, AL.Uint bits, AL.Uint float_bits); 44 | 45 | [CCode (cname = "alureSleep")] 46 | public bool sleep (AL.Float duration); 47 | 48 | [CCode (cname = "alureStreamSizeIsMicroSec")] 49 | public bool stream_size_is_microsec (bool useus); 50 | 51 | [CCode (cname = "alureCreateBufferFromFile")] 52 | public AL.Uint create_buffer_from_file (string fname); 53 | [CCode (cname = "alureCreateBufferFromMemory")] 54 | public AL.Uint create_buffer_from_memory (AL.Ubyte[] data); 55 | [CCode (cname = "alureBufferDataFromFile")] 56 | public bool buffer_data_from_file (string fname, AL.Uint buffer); 57 | [CCode (cname = "alureBufferDataFromMemory")] 58 | public bool buffer_data_from_memory (AL.Ubyte[] fdata, AL.Uint buffer); 59 | 60 | [CCode (instance_pos = 0.1, has_typedef = false)] 61 | public delegate AL.Uint CreateStreamCallback ([CCode (array_length = false)] AL.Ubyte[] data, AL.Uint bytes); 62 | 63 | [Compact] 64 | [CCode (cname = "alureStream", has_type_id = false, free_function = "")] 65 | public class Stream { 66 | [CCode (cname = "alureCreateStreamFromFile")] 67 | public Stream.from_file (string fname, AL.Sizei chunk_length, AL.Sizei num_bufs = 0, [CCode (array_length = false)] AL.Uint[]? bufs = null); 68 | 69 | [CCode (cname = "alureCreateStreamFromMemory")] 70 | public Stream.from_memory (AL.Ubyte[] data, AL.Sizei chunk_length, AL.Sizei num_bufs = 0, [CCode (array_length = false)] AL.Uint[]? bufs = null); 71 | 72 | [CCode (cname = "alureCreateStreamFromStaticMemory")] 73 | public Stream.from_static_memory (AL.Ubyte[] data, AL.Sizei chunk_length, AL.Sizei num_bufs = 0, [CCode (array_length = false)] AL.Uint[]? bufs = null); 74 | 75 | [CCode (cname = "alureCreateStreamFromCallback")] 76 | public Stream.from_callback (CreateStreamCallback callback, AL.Enum format, AL.Uint samplerate, AL.Sizei chunk_length, AL.Sizei num_bufs = 0, [CCode (array_length = false)] AL.Uint[]? bufs = null); 77 | 78 | [CCode (cname = "alureGetStreamLength")] 79 | public int64 get_length (); 80 | 81 | [CCode (cname = "alureGetStreamFrequency")] 82 | public AL.Sizei get_frequency (); 83 | 84 | [CCode (cname = "alureBufferDataFromStream")] 85 | public AL.Sizei buffer_data (AL.Sizei num_bufs, [CCode (array_length = false)]AL.Uint[] bufs); 86 | 87 | [CCode (cname = "alureRewindStream")] 88 | public bool rewind (); 89 | 90 | [CCode (cname = "alureSetStreamOrder")] 91 | public bool set_order (AL.Uint order); 92 | 93 | [CCode (cname = "alureSetStreamPatchset")] 94 | public bool set_patchset (string patchset); 95 | 96 | /** you must destroy stream manually! */ 97 | [CCode (cname = "alureDestroyStream")] 98 | public bool destroy (AL.Sizei num_bufs = 0, [CCode (array_length = false)] AL.Uint[]? bufs = null); 99 | } 100 | 101 | [CCode (cname = "alureUpdate")] 102 | public void update (); 103 | [CCode (cname = "alureUpdateInterval")] 104 | public bool update_interval (AL.Float interval); 105 | 106 | [CCode (has_target = false, has_typedef = false)] 107 | public delegate void Callback (void* userdata, AL.Uint source); 108 | 109 | [CCode (cname = "alurePlaySourceStream")] 110 | public bool play_source_stream (AL.Uint source, Stream stream, AL.Sizei num_bufs, AL.Sizei loopcount, Callback eos_callback, void* userdata = null); 111 | [CCode (cname = "alurePlaySource")] 112 | public bool play_source (AL.Uint source, Callback callback, void* userdata = null); 113 | [CCode (cname = "alureStopSource")] 114 | public bool stop_source (AL.Uint source, bool run_callback); 115 | [CCode (cname = "alurePauseSource")] 116 | public bool pause_source (AL.Uint source); 117 | [CCode (cname = "alureResumeSource")] 118 | public bool resume_source (AL.Uint source); 119 | 120 | [CCode (has_target = false, has_typedef = false)] 121 | public delegate void* OpenFileCallback (string name); 122 | [CCode (has_target = false, has_typedef = false)] 123 | public delegate void* OpenMemCallback ([CCode (array_length_type = "uint")] AL.Ubyte[] buffer); 124 | [CCode (has_target = false, has_typedef = false)] 125 | public delegate AL.Boolean GetFormatCallback (void* instance, out AL.Enum format, out AL.Uint samplerate, out AL.Uint blocksize); 126 | [CCode (has_target = false, has_typedef = false)] 127 | public delegate AL.Uint DecodeCallback (void* instance, [CCode (array_length = false)] AL.Ubyte[] data, AL.Uint bytes); 128 | [CCode (has_target = false, has_typedef = false)] 129 | public delegate AL.Boolean RewindCallback (void* instance); 130 | [CCode (has_target = false, has_typedef = false)] 131 | public delegate void CloseCallback (void* instance); 132 | 133 | [CCode (cname = "alureInstallDecodeCallbacks")] 134 | public bool install_decode_callbacks ( 135 | int index, 136 | OpenFileCallback open_file_callback, 137 | OpenMemCallback open_mem_callback, 138 | GetFormatCallback get_format_callback, 139 | DecodeCallback decode_callback, 140 | RewindCallback rewind_callback, 141 | CloseCallback close_callback 142 | ); 143 | 144 | [CCode (cname = "int", has_type_id = false, cheader_filename = "stdio.h")] 145 | public enum Seek { 146 | SET = 0, 147 | CUR = -1, 148 | END = -2 149 | } 150 | 151 | [CCode (has_target = false, has_typedef = false)] 152 | public delegate void* OpenCallback (string filename, AL.Uint mode = 0); 153 | [CCode (has_target = false, has_typedef = false)] 154 | public delegate AL.Sizei ReadCallback (void* handle, [CCode (array_length = false)] AL.Ubyte[] buf, AL.Uint bytes); 155 | [CCode (has_target = false, has_typedef = false)] 156 | public delegate AL.Sizei WriteCallback (void* handle, [CCode (array_length = false)] AL.Ubyte[] buf, AL.Uint bytes); 157 | [CCode (has_target = false, has_typedef = false)] 158 | public delegate int64 SeekCallback (void* handle, int64 offset, Seek whence); 159 | 160 | [CCode (cname = "alureSetIOCallbacks")] 161 | public bool set_io_callbacks ( 162 | OpenCallback open_callback, 163 | CloseCallback close_callback, 164 | ReadCallback read_callback, 165 | WriteCallback write_callback, 166 | SeekCallback seek_callback 167 | ); 168 | 169 | [CCode (cname = "alureGetProcAddress")] 170 | public void* get_proc_address (string funcname); 171 | } 172 | -------------------------------------------------------------------------------- /espeak.vapi: -------------------------------------------------------------------------------- 1 | /* Espeak Vala Bindings 2 | * Copyright 2020 Daniel 'grindhold' Brendle 3 | * 4 | * Permission is hereby granted, free of charge, to any person 5 | * obtaining a copy of this software and associated documentation 6 | * files (the "Software"), to deal in the Software without 7 | * restriction, including without limitation the rights to use, copy, 8 | * modify, merge, publish, distribute, sublicense, and/or sell copies 9 | * of the Software, and to permit persons to whom the Software is 10 | * furnished to do so, subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be 13 | * included in all copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 17 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 19 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 20 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | /** 25 | * Espeak voice synthesis library 26 | * 27 | * Example: 28 | * 29 | * {{{ 30 | * public static void main(string[] argv) { 31 | * Espeak.initialize(Espeak.AudioOutput.PLAYBACK, 0, null, 0); 32 | * string input = "Hello World"; 33 | * Espeak.synth(input, input.length+1, 0, Espeak.PositionType.CHARACTER, 0, Espeak.CHARS_AUTO, null, null); 34 | * Espeak.synchronize(); 35 | * Espeak.terminate(); 36 | * } 37 | * }}} 38 | * Compile with: --pkg espeak -X -lespeak 39 | */ 40 | [CCode (cprefix = "espeak", lower_case_cprefix = "espeak_", cheader_filename = "espeak/speak_lib.h")] 41 | namespace Espeak { 42 | [CCode (cname = "espeak_EVENT_TYPE", cprefix = "espeakEVENT_")] 43 | public enum EventType { 44 | LIST_TERMINATED, 45 | WORD, 46 | SENTENCE = 2, // Start of sentence 47 | MARK = 3, // Mark 48 | PLAY = 4, // Audio element 49 | END = 5, // End of sentence or clause 50 | MSG_TERMINATED = 6, // End of message 51 | PHONEME = 7, // Phoneme, if enabled in espeak_Initialize() 52 | SAMPLERATE = 8 // internal use, set sample rate 53 | } 54 | 55 | [CCode (cname = "espeak_EVENT")] 56 | public struct Event { 57 | public EventType type; 58 | public uint unique_identifier; 59 | public int text_position; 60 | public int length; 61 | public int audio_position; 62 | public int sample; 63 | public void* user_data; 64 | [CCode (cname = "id.number")] 65 | public int id_number; 66 | [CCode (cname = "id.name")] 67 | public unowned string id_name; 68 | [CCode (cname = "id.string")] 69 | public char id_string[8]; 70 | } 71 | 72 | [CCode (cname = "espeak_POSITION_TYPE", cprefix = "POS_")] 73 | public enum PositionType { 74 | CHARACTER, 75 | WORD, 76 | SENTENCE 77 | } 78 | 79 | [CCode (cname = "espeak_AUDIO_OUTPUT", cprefix = "AUDIO_OUTPUT_")] 80 | public enum AudioOutput { 81 | PLAYBACK, 82 | RETRIEVAL, 83 | SYNCHRONOUS, 84 | SYNCH_PLAYBACK 85 | } 86 | 87 | [CCode (cname = "espeak_ERROR", cprefix = "EE_")] 88 | public enum Error { 89 | OK, 90 | INTERNAL_ERROR, 91 | BUFFER_FULL, 92 | NOT_FOUND 93 | } 94 | 95 | public const int INITIALIZE_PHONEME_EVENTS; 96 | public const int INITIALIZE_PHONEME_IPA; 97 | public const int INITIALIZE_DONT_EXIT; 98 | 99 | 100 | [CCode (cname = "espeak_Initialize")] 101 | public int initialize (AudioOutput output, int buflength, string? path, int options); 102 | 103 | [CCode (cname = "t_espeak_callback", has_target = false)] 104 | public delegate int Callback (short* s, int i, Event e); 105 | 106 | [CCode (cname = "espeak_SetSynthCallback")] 107 | public void set_synth_callback (Callback synth_callback); 108 | 109 | [CCode (cname = "vala_t_espeak_uri_callback", has_target = false, has_typedef = false)] 110 | public delegate int UriCallback (int i, string s1, string s2); 111 | 112 | [CCode (cname = "espeak_SetUriCallback")] 113 | public void set_uri_callback (UriCallback uri_callback); 114 | 115 | [CCode (cname = "espeakCHARS_AUTO")] 116 | public const int CHARS_AUTO; 117 | [CCode (cname = "espeakCHARS_UTF8")] 118 | public const int CHARS_UTF8; 119 | [CCode (cname = "espeakCHARS_8BIT")] 120 | public const int CHARS_8BIT; 121 | [CCode (cname = "espeakCHARS_WCHAR")] 122 | public const int CHARS_WCHAR; 123 | [CCode (cname = "espeakCHARS_16BIT")] 124 | public const int CHARS_16BIT; 125 | 126 | public const int SSML; 127 | public const int PHONEMES; 128 | public const int ENDPAUSE; 129 | public const int KEEP_NAMEDATA; 130 | 131 | [CCode (cname = "espeak_Synth")] 132 | public Error synth (void* text, size_t size, uint position, PositionType position_type, uint end_position, uint flags, out uint unique_identifier, out void* user_data); 133 | 134 | [CCode (cname = "espeak_SynthMark")] 135 | public Error synth_mark (void* text, size_t size, string index_mark, uint end_position, uint flags, uint* unique_identifier, void* user_data); 136 | 137 | [CCode (cname = "espeak_Key")] 138 | public Error key (string key_name); 139 | 140 | [CCode (cname = "espeak_Char")] 141 | public Error @char (int16 character); 142 | 143 | [CCode (cname = "espeak_PARAMETER", cprefix = "espeak")] 144 | public enum Parameter { 145 | SILENCE, 146 | RATE, 147 | VOLUME, 148 | PITCH, 149 | RANGE, 150 | PUNCTUATION, 151 | CAPITALS, 152 | WORDGAP, 153 | OPTIONS, 154 | INTONATION, 155 | RESERVED1, 156 | RESERVED2, 157 | EMPHASIS, 158 | LINELENGTH, 159 | VOICETYPE, 160 | [CCode (cname = "N_SPEECHPARAM")] 161 | N_SPEECH_PARAM 162 | } 163 | 164 | [CCode (cname = "espeak_PUNCT_TYPE", cprefix = "espeakPUNKT_")] 165 | public enum PunctType { 166 | NONE, 167 | ALL, 168 | SOME 169 | } 170 | 171 | [CCode (cname = "espeak_SetParameter")] 172 | public Error set_parameter (Parameter parameter, int @value, int relative); 173 | 174 | [CCode (cname = "espeak_GetParameter")] 175 | public Error get_parameter (Parameter parameter, int current); 176 | 177 | [CCode (cname = "espeak_SetPunctuationList")] 178 | public Error set_punctuation_list (ref int16 punctlist); 179 | 180 | [CCode (cname = "espeak_SetPhonemeTrace")] 181 | public void set_phoneme_trace (int @value, out GLib.FileStream stream); 182 | 183 | [CCode (cname = "espeak_TextToPhonemes")] 184 | public string text_to_phonemes (void** textptr,int textmode, int phonememode); 185 | 186 | [CCode (cname = "espeak_CompileDictionary")] 187 | public void compile_dictionary (string path, GLib.FileStream log, int flags); 188 | 189 | [CCode (cname = "espeak_VOICE")] 190 | public struct Voice { 191 | unowned string name; 192 | unowned string languages; 193 | unowned string identifier; 194 | uchar gender; 195 | uchar age; 196 | uchar variant; 197 | uchar xxl; 198 | int score; 199 | void* spare; 200 | } 201 | 202 | [CCode (cname = "espeak_ListVoices", array_length = false, array_null_terminated = true)] 203 | public (unowned Voice?)[] list_voices (Voice? voice_spec); 204 | 205 | [CCode (cname = "espeak_SetVoiceByName")] 206 | public Error set_voice_by_name (string name); 207 | 208 | [CCode (cname = "espeak_SetVoiceByProperties")] 209 | public Error set_voice_by_properties (Voice? voice_spec); 210 | 211 | [CCode (cname = "espeak_GetCurrentVoice")] 212 | public unowned Voice? get_current_voice (); 213 | 214 | [CCode (cname = "espeak_Cancel")] 215 | public Error cancel (); 216 | 217 | [CCode (cname = "espeak_IsPlaying")] 218 | public int is_playing (); 219 | 220 | [CCode (cname = "espeak_Synchronize")] 221 | public Error synchronize (); 222 | 223 | [CCode (cname = "espeak_Terminate")] 224 | public Error terminate (); 225 | 226 | [CCode (cname = "espeak_Info")] 227 | public string info (out string path_data); 228 | } 229 | -------------------------------------------------------------------------------- /libgsasl.vapi: -------------------------------------------------------------------------------- 1 | /* libgsasl.vapi 2 | * 3 | * Copyright (C) 2013 Evan Nemerson 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public License 7 | * as published by the Free Software Foundation; either version 2.1 of 8 | * the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, but 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 18 | * 02110-1301 USA 19 | * 20 | * Authors: 21 | * Evan Nemerson 22 | */ 23 | 24 | [CCode (cheader_filename = "gsasl.h")] 25 | namespace Gsasl { 26 | namespace Version { 27 | [CCode (cname = "GSASL_VERSION")] 28 | public const string STRING; 29 | public const int MAJOR; 30 | public const int MINOR; 31 | public const int PATCH; 32 | public const int NUMBER; 33 | 34 | [CCode (cname = "gsasl_check_version")] 35 | public static unowned string check (string req_version); 36 | } 37 | 38 | public const int MIN_MECHANISM_SIZE; 39 | public const int MAX_MECHANISM_SIZE; 40 | public const string VALID_MECHANISM_CHARACTERS; 41 | 42 | [CCode (cname = "Gsasl_rc", cprefix = "GSASL_", has_type_id = false)] 43 | public enum Result { 44 | OK, 45 | NEEDS_MORE, 46 | UNKNOWN_MECHANISM, 47 | MECHANISM_CALLED_TOO_MANY_TIMES, 48 | MALLOC_ERROR, 49 | BASE64_ERROR, 50 | CRYPTO_ERROR, 51 | SASLPREP_ERROR, 52 | MECHANISM_PARSE_ERROR, 53 | AUTHENTICATION_ERROR, 54 | INTEGRITY_ERROR, 55 | NO_CLIENT_CODE, 56 | NO_SERVER_CODE, 57 | NO_CALLBACK, 58 | NO_ANONYMOUS_TOKEN, 59 | NO_AUTHID, 60 | NO_AUTHZID, 61 | NO_PASSWORD, 62 | NO_PASSCODE, 63 | NO_PIN, 64 | NO_SERVICE, 65 | NO_HOSTNAME, 66 | NO_CB_TLS_UNIQUE, 67 | NO_SAML20_IDP_IDENTIFIER, 68 | NO_SAML20_REDIRECT_URL, 69 | NO_OPENID20_REDIRECT_URL, 70 | GSSAPI_RELEASE_BUFFER_ERROR, 71 | GSSAPI_IMPORT_NAME_ERROR, 72 | GSSAPI_INIT_SEC_CONTEXT_ERROR, 73 | GSSAPI_ACCEPT_SEC_CONTEXT_ERROR, 74 | GSSAPI_UNWRAP_ERROR, 75 | GSSAPI_WRAP_ERROR, 76 | GSSAPI_ACQUIRE_CRED_ERROR, 77 | GSSAPI_DISPLAY_NAME_ERROR, 78 | GSSAPI_UNSUPPORTED_PROTECTION_ERROR, 79 | KERBEROS_V5_INIT_ERROR, 80 | KERBEROS_V5_INTERNAL_ERROR, 81 | SHISHI_ERROR, 82 | SECURID_SERVER_NEED_ADDITIONAL_PASSCODE, 83 | SECURID_SERVER_NEED_NEW_PIN, 84 | GSSAPI_ENCAPSULATE_TOKEN_ERROR, 85 | GSSAPI_DECAPSULATE_TOKEN_ERROR, 86 | GSSAPI_INQUIRE_MECH_FOR_SASLNAME_ERROR, 87 | GSSAPI_TEST_OID_SET_MEMBER_ERROR, 88 | GSSAPI_RELEASE_OID_SET_ERROR; 89 | 90 | [CCode (cname = "gsasl_strerror_name")] 91 | public unowned string to_string (); 92 | [CCode (cname = "gsasl_strerror")] 93 | public unowned string description (); 94 | } 95 | 96 | [CCode (cname = "Gsasl_qop", cprefix = "GSASL_QOP_", has_type_id = false)] 97 | public enum QualityOfProtection { 98 | AUTH, 99 | [CCode (cname = "GSASL_QOP_AUTH")] 100 | AUTHENTICATION, 101 | AUTH_INT, 102 | [CCode (cname = "GSASL_QOP_AUTH_INT")] 103 | AUTHENTICATION_INTEGRITY, 104 | AUTH_INT_CONF, 105 | [CCode (cname = "GSASL_QOP_AUTH_INT_CONF")] 106 | AUTHENTICATION_INTEGRITY_CONFIDENTIALITY 107 | } 108 | 109 | [CCode (cname = "Gsasl_cipher", has_type_id = false)] 110 | public enum Cipher { 111 | DES, 112 | 3DES, 113 | RC4, 114 | RC4_40, 115 | RC4_56, 116 | AES 117 | } 118 | 119 | [Flags, CCode (cname = "Gsasl_saslprep_flags", cprefix = "GSASL_", has_type_id = false)] 120 | public enum PrepFlags { 121 | ALLOW_UNASSIGNED 122 | } 123 | 124 | [Compact] 125 | [CCode (cname = "Gsasl", lower_case_cprefix = "gsasl_", free_function = "gsasl_done", has_copy_function = false)] 126 | public class Context { 127 | private Context (); 128 | public static Gsasl.Result init (out Gsasl.Context ctx); 129 | [CCode (cname = "gsasl_callback_set")] 130 | public void set_callback (Gsasl.Callback cb); 131 | [CCode (cname = "gsasl_callback")] 132 | public Gsasl.Callback get_callback (Gsasl.Property prop); 133 | 134 | public void* callback_hook { 135 | [CCode (cname = "gsasl_callback_hook_set")] get; 136 | [CCode (cname = "gsasl_callback_hook_get")] set; 137 | } 138 | [CCode (cname = "gsasl_callback_hook_get")] 139 | public void* get_callback_hook (); 140 | [CCode (cname = "gsasl_callback_hook_set")] 141 | public void set_callback_hook (void* hook); 142 | 143 | public Gsasl.Result client_mechlist (out string mechlist); 144 | public Gsasl.Result client_support_p (string name); 145 | public unowned string? client_suggest_mechanism (string mechlist); 146 | 147 | public Gsasl.Result server_mechlist (out string mechlist); 148 | public Gsasl.Result server_support_p (string name); 149 | 150 | public Gsasl.Result client_start (string mech, out Session? session); 151 | public Gsasl.Result server_start (string mech, out Session? session); 152 | } 153 | 154 | [Compact] 155 | [CCode (cname = "Gsasl_session", lower_case_cprefix = "gsasl_", free_function = "gsasl_finish", has_copy_function = false)] 156 | public class Session { 157 | public void* hook { 158 | [CCode (cname = "gsasl_session_hook_set")] get; 159 | [CCode (cname = "gsasl_session_hook_get")] set; 160 | } 161 | [CCode (cname = "gsasl_session_hook_get")] 162 | public void* get_hook (); 163 | [CCode (cname = "gsasl_session_hook_set")] 164 | public void set_hook (void* hook); 165 | 166 | [CCode (cname = "gsasl_property_set")] 167 | public void set_property (Gsasl.Property prop, string data); 168 | [CCode (cname = "gsasl_property_set_raw")] 169 | public void set_property_raw (Gsasl.Property prop, string data, size_t len); 170 | [CCode (cname = "gsasl_property_get")] 171 | public unowned string get_property (Gsasl.Property prop); 172 | [CCode (cname = "gsasl_property_fast")] 173 | public unowned string get_property_fast (Gsasl.Property prop); 174 | 175 | public Gsasl.Result step ([CCode (array_length_type = "size_t")] uint[] input, [CCode (array_length_type = "size_t")] out uint8[] output); 176 | public Gsasl.Result step64 (string? b64input, out string b64output); 177 | 178 | public Gsasl.Result encode ([CCode (array_length_type = "size_t")] uint8[] input, [CCode (array_length_type = "size_t")] out uint8[] output); 179 | public Gsasl.Result decode ([CCode (array_length_type = "size_t")] uint8[] input, [CCode (array_length_type = "size_t")] out uint8[] output); 180 | 181 | public unowned string mechanism_name (); 182 | } 183 | 184 | [CCode (cname = "Gsasl_property", cprefix = "GSASL_", has_type_id = false)] 185 | public enum Property { 186 | AUTHID, 187 | AUTHZID, 188 | PASSWORD, 189 | ANONYMOUS_TOKEN, 190 | SERVICE, 191 | HOSTNAME, 192 | GSSAPI_DISPLAY_NAME, 193 | PASSCODE, 194 | SUGGESTED_PIN, 195 | PIN, 196 | REALM, 197 | DIGEST_MD5_HASHED_PASSWORD, 198 | QOPS, 199 | QOP, 200 | SCRAM_ITER, 201 | SCRAM_SALT, 202 | SCRAM_SALTED_PASSWORD, 203 | CB_TLS_UNIQUE, 204 | SAML20_IDP_IDENTIFIER, 205 | SAML20_REDIRECT_URL, 206 | OPENID20_REDIRECT_URL, 207 | OPENID20_OUTCOME_DATA, 208 | SAML20_AUTHENTICATE_IN_BROWSER, 209 | OPENID20_AUTHENTICATE_IN_BROWSER, 210 | VALIDATE_SIMPLE, 211 | VALIDATE_EXTERNAL, 212 | VALIDATE_ANONYMOUS, 213 | VALIDATE_GSSAPI, 214 | VALIDATE_SECURID, 215 | VALIDATE_SAML20, 216 | VALIDATE_OPENID20 217 | } 218 | 219 | [CCode (cname = "Gsasl_callback_function", has_target = false)] 220 | public delegate Gsasl.Result Callback (Gsasl.Context ctx, Gsasl.Session sctx, Gsasl.Property prop); 221 | 222 | [CCode (cname = "gsasl_saslprep")] 223 | public static Gsasl.Result prep (string in, Gsasl.PrepFlags flags, out string @out, out Gsasl.Result stringpreprc = null); 224 | 225 | public static Gsasl.Result simple_getpass (string filename, string username, out string key); 226 | public static Gsasl.Result base64_to ([CCode (array_length_type = "size_t")] uint[] in, [CCode (array_length_type = "size_t")] out uint8[] @out); 227 | public static Gsasl.Result base64_from ([CCode (array_length_type = "size_t")] uint[] in, [CCode (array_length_type = "size_t")] out uint8[] @out); 228 | public static Gsasl.Result nonce ([CCode (array_length_type = "size_t")] uint8[] data); 229 | public static Gsasl.Result md5 ([CCode (array_length_type = "size_t")] uint8[] in, out uint8 @out[16]); 230 | public static Gsasl.Result hmac_md5 ([CCode (array_length_type = "size_t")] uint8[] key, [CCode (array_length_type = "size_t")] uint8[] in, uint8 outhash[16]); 231 | public static Gsasl.Result sha1 ([CCode (array_length_type = "size_t")] uint8[] in, [CCode (array_length = false)] out uint8 @out[20]); 232 | public static Gsasl.Result hmac_sha1 ([CCode (array_length_type = "size_t")] uint8[] key, [CCode (array_length_type = "size_t")] uint8[] in, [CCode (array_length = false)] out uint8 outhash[20]); 233 | } 234 | --------------------------------------------------------------------------------