[vala-extra-vapis/wip/openal: 40/40] Some fixes




commit 9480a15feaa8e03422baf51b2c2f0929f77b4395
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Wed Apr 14 09:42:03 2021 +0200

    Some fixes

 alure.vapi  | 14 +++++++-------
 openal.vapi |  7 +++----
 physfs.vapi | 47 ++++++++++++++++++++++++-----------------------
 3 files changed, 34 insertions(+), 34 deletions(-)
---
diff --git a/alure.vapi b/alure.vapi
index 7317623..922f11a 100644
--- a/alure.vapi
+++ b/alure.vapi
@@ -57,8 +57,8 @@ namespace Alure
        [CCode (cname = "alureBufferDataFromMemory")]
        public bool buffer_data_from_memory (AL.Ubyte[] fdata, AL.Uint buffer);
 
-       [CCode (has_target = false, has_typedef = false)]
-       public delegate AL.Uint CreateStreamCallback (void* userdata, [CCode (array_length = false)] 
AL.Ubyte[] data, AL.Uint bytes);
+       [CCode (instance_pos = 0.1, has_typedef = false)]
+       public delegate AL.Uint CreateStreamCallback ([CCode (array_length = false)] AL.Ubyte[] data, AL.Uint 
bytes);
 
        [Compact]
        [CCode (cname = "alureStream", has_type_id = false, free_function = "")]
@@ -120,13 +120,13 @@ namespace Alure
        [CCode (has_target = false, has_typedef = false)]
        public delegate void* OpenFileCallback (string name);
        [CCode (has_target = false, has_typedef = false)]
-       public delegate void* OpenMemCallback (AL.Ubyte[] buffer);
+       public delegate void* OpenMemCallback ([CCode (array_length_type = "uint")] AL.Ubyte[] buffer);
        [CCode (has_target = false, has_typedef = false)]
-       public delegate bool GetFormatCallback (void* instance, out AL.Enum format, out AL.Uint samplerate, 
out AL.Uint blocksize);
+       public delegate AL.Boolean GetFormatCallback (void* instance, out AL.Enum format, out AL.Uint 
samplerate, out AL.Uint blocksize);
        [CCode (has_target = false, has_typedef = false)]
-       public delegate AL.Uint DecodeCallback (void* instance, [CCode (array_length = false)]AL.Ubyte[] 
data, AL.Uint bytes);
+       public delegate AL.Uint DecodeCallback (void* instance, [CCode (array_length = false)] AL.Ubyte[] 
data, AL.Uint bytes);
        [CCode (has_target = false, has_typedef = false)]
-       public delegate bool RewindCallback (void* instance);
+       public delegate AL.Boolean RewindCallback (void* instance);
        [CCode (has_target = false, has_typedef = false)]
        public delegate void CloseCallback (void* instance);
 
@@ -141,7 +141,7 @@ namespace Alure
                CloseCallback close_callback
        );
 
-       [CCode (cname = "int", has_type_id = false)]
+       [CCode (cname = "int", has_type_id = false, cheader_filename = "stdio.h")]
        public enum Seek {
                SET = 0,
                CUR = -1,
diff --git a/openal.vapi b/openal.vapi
index 9b16535..c7536e9 100644
--- a/openal.vapi
+++ b/openal.vapi
@@ -24,6 +24,7 @@
 namespace AL
 {
        // 8-bit boolean
+       [BooleanType]
        [CCode (cname = "ALboolean", has_type_id = false)]
        public struct Boolean : int8 {}
 
@@ -73,7 +74,7 @@ namespace AL
 
        // void type (for opaque pointers only)
        [CCode (cname = "ALvoid", has_type_id = false)]
-       public struct ALvoid {}
+       public struct @void {}
 
        /** "no distance model" or "no buffer" */
        [CCode (cname = "AL_NONE")]
@@ -549,9 +550,7 @@ namespace AL
        [CCode (cname = "alGetEnumValue")]
        public Enum get_enum_value (string ename);
 
-       [Compact]
-       [CCode (has_type_id = false)]
-       public class Listener {
+       namespace Listener {
                /** Set Listener parameters */
                [CCode (cname = "alListenerf")]
                public static void set_paramf (Enum param, Float value);
diff --git a/physfs.vapi b/physfs.vapi
index 347a967..08eb181 100644
--- a/physfs.vapi
+++ b/physfs.vapi
@@ -30,10 +30,10 @@ namespace PHYSFS
        */
        [CCode (cname = "PHYSFS_ArchiveInfo", has_type_id = false)]
        public struct ArchiveInfo {
-               public string extension; /**< Archive file extension: "ZIP", for example. */
-               public string description; /**< Human-readable archive description. */
-               public string author;   /**< Person who did support for this archive. */
-               public string url;              /**< URL related to this archive */
+               public unowned string extension; /**< Archive file extension: "ZIP", for example. */
+               public unowned string description; /**< Human-readable archive description. */
+               public unowned string author;   /**< Person who did support for this archive. */
+               public unowned string url;              /**< URL related to this archive */
                [CCode (cname = "supportsSymlinks")]
                public bool supports_symlinks;  /**< non-zero if archive offers symbolic links. */
        }
@@ -74,7 +74,7 @@ namespace PHYSFS
        * Get a list of supported archive types.
        */
        [CCode (cname = "PHYSFS_supportedArchiveTypes", array_length = false)]
-       public unowned ArchiveInfo*[] supported_archive_types ();
+       public unowned ArchiveInfo?[] supported_archive_types ();
 
        /**
        * void PHYSFS_freeList (void* listVar)
@@ -630,15 +630,15 @@ namespace PHYSFS
        */
        [CCode (cname = "PHYSFS_Allocator", has_type_id = false)]
        public struct Allocator {
-               [CCode (cname = "init")]
+               [CCode (cname = "Init")]
                public InitFunc init_func;      /**< Initialize. Can be NULL. Zero on failure. */
-               [CCode (cname = "deinit")]
+               [CCode (cname = "Deinit")]
                public DeinitFunc deinit_func; /**< Deinitialize your allocator. Can be NULL. */
-               [CCode (cname = "malloc")]
+               [CCode (cname = "Malloc")]
                public MallocFunc malloc_func; /**< Allocate like malloc (). */
-               [CCode (cname = "realloc")]
+               [CCode (cname = "Realloc")]
                public ReallocFunc realloc_func; /**< Reallocate like realloc (). */
-               [CCode (cname = "free")]
+               [CCode (cname = "Free")]
                public FreeFunc free_func;              /**< Free memory from Malloc or Realloc. */
        }
 
@@ -646,6 +646,7 @@ namespace PHYSFS
        * int PHYSFS_setAllocator (const PHYSFS_Allocator *allocator)
        * Hook your own allocation routines into PhysicsFS.
        */
+       [CCode (cname = "PHYSFS_setAllocator")]
        public bool set_allocator (Allocator* allocator);
 
        /**
@@ -666,36 +667,36 @@ namespace PHYSFS
        * PHYSFS_StringCallback
        * Function signature for callbacks that report strings.
        */
-       [CCode (cname = "PHYSFS_StringCallback", has_target = false, has_typedef = false)]
-       public delegate void StringCallback (void* data, string str);
+       [CCode (cname = "PHYSFS_StringCallback", instance_pos = 0.1)]
+       public delegate void StringCallback (string str);
 
        /**
        * PHYSFS_EnumFilesCallback
        * Function signature for callbacks that enumerate files.
        */
-       [CCode (cname = "PHYSFS_EnumFilesCallback", has_target = false, has_typedef = false)]
-       public delegate void EnumFilesCallback (void* data, string origdir, string fname);
+       [CCode (cname = "PHYSFS_EnumFilesCallback", instance_pos = 0.1)]
+       public delegate void EnumFilesCallback (string origdir, string fname);
 
        /**
        * void PHYSFS_getCdRomDirsCallback (PHYSFS_StringCallback c, void* d)
        * Enumerate CD-ROM directories, using an application-defined callback.
        */
        [CCode (cname = "PHYSFS_getCdRomDirsCallback")]
-       public void get_cdrom_dirs_callback (StringCallback c, void* d);
+       public void get_cdrom_dirs_callback (StringCallback c);
 
        /**
        * void PHYSFS_getSearchPathCallback (PHYSFS_StringCallback c, void* d)
        * Enumerate the search path, using an application-defined callback.
        */
        [CCode (cname = "PHYSFS_getSearchPathCallback")]
-       public void get_search_path_callback (StringCallback c, void* d);
+       public void get_search_path_callback (StringCallback c);
 
        /**
        * void PHYSFS_enumerateFilesCallback (const char *dir, PHYSFS_EnumFilesCallback c, void* d)
        * Get a file listing of a search path's directory, using an application-defined callback.
        */
        [CCode (cname = "PHYSFS_enumerateFilesCallback")]
-       public void enumerate_files_callback (string dir, EnumFilesCallback c, void* d);
+       public void enumerate_files_callback (string dir, EnumFilesCallback c);
 
        /**
        * void PHYSFS_utf8FromUcs4 (const uint32 *src, char *dst, uint64 len)
@@ -777,8 +778,8 @@ namespace PHYSFS
        * PHYSFS_EnumerateCallback
        * Function signature for callbacks that enumerate and return results.
        */
-       [CCode (has_target = false, has_typedef = false)]
-       public delegate EnumerateCallbackResult EnumerateCallback (void* data, string origdir, string fname);
+       [CCode (cname = "PHYSFS_EnumerateCallback", instance_pos = 0.1)]
+       public delegate EnumerateCallbackResult EnumerateCallback (string origdir, string fname);
 
        /**
        * int PHYSFS_enumerate (const char *dir, PHYSFS_EnumerateCallback c, void* d)
@@ -944,7 +945,7 @@ namespace PHYSFS
        * Add an archive, contained in a memory buffer, to the search path.
        */
        [CCode (cname = "PHYSFS_mountMemory")]
-       public bool mount_memory ([CCode (array_length = false)] uint8[] buf, MemoryDel? del, string new_dir, 
string mount_point, bool append_to_path);
+       public bool mount_memory (uint8[] buf, MemoryDel? del, string new_dir, string mount_point, bool 
append_to_path);
 
        /**
        * PHYSFS_ErrorCode
@@ -1014,8 +1015,8 @@ namespace PHYSFS
 
        [CCode (has_target = false, has_typedef = false)]
        public delegate void* ArchiverOpenArchiveFunc (Io* io, string name, bool for_write, int* claimed);
-       [CCode (has_target = false, has_typedef = false)]
-       public delegate EnumerateCallbackResult ArchiverEnumerateFunc (void* opaque, string dirname, 
EnumerateCallback cb, string origdir, void* callbackdata);
+       [CCode (has_typedef = false)]
+       public delegate EnumerateCallbackResult ArchiverEnumerateFunc (void* opaque, string dirname, 
EnumerateCallback cb, string origdir);
        [CCode (has_target = false, has_typedef = false)]
        public delegate Io* ArchiverOpenReadFunc (void* opaque, string fnm);
        [CCode (has_target = false, has_typedef = false)]
@@ -1055,7 +1056,7 @@ namespace PHYSFS
                /**
                * List all files in (dirname).
                */
-               [CCode (cname = "enumerate")]
+               [CCode (cname = "enumerate", delegate_target = false)]
                public ArchiverEnumerateFunc enumerate_func;
 
                /**


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]