[Fuse-for-macosx-commits] SF.net SVN: fuse-for-macosx:[691] trunk
Brought to you by:
fredm
From: <fr...@us...> - 2012-10-29 12:01:43
|
Revision: 691 http://fuse-for-macosx.svn.sourceforge.net/fuse-for-macosx/?rev=691&view=rev Author: fredm Date: 2012-10-29 12:01:33 +0000 (Mon, 29 Oct 2012) Log Message: ----------- Bring the libspectrum.h generator scripts up to date. Modified Paths: -------------- trunk/FuseGenerator/generate.pl trunk/FuseImporter/generate.pl trunk/fuse/fusepb/generate.pl trunk/libspectrum/generate.pl Modified: trunk/FuseGenerator/generate.pl =================================================================== --- trunk/FuseGenerator/generate.pl 2012-10-07 11:05:44 UTC (rev 690) +++ trunk/FuseGenerator/generate.pl 2012-10-29 12:01:33 UTC (rev 691) @@ -25,11 +25,12 @@ #define TRUE (!FALSE) #endif -typedef char gchar; +typedef char gchar; typedef int gint; typedef long glong; typedef gint gboolean; typedef unsigned int guint; +typedef unsigned long gulong; typedef const void * gconstpointer; typedef void * gpointer; @@ -47,80 +48,89 @@ gconstpointer b); -GSList WIN32_DLL *g_slist_insert_sorted (GSList *list, +WIN32_DLL GSList *g_slist_insert_sorted (GSList *list, gpointer data, GCompareFunc func); -GSList WIN32_DLL *g_slist_insert (GSList *list, +WIN32_DLL GSList *g_slist_insert (GSList *list, gpointer data, gint position); -GSList WIN32_DLL *g_slist_append (GSList *list, +WIN32_DLL GSList *g_slist_append (GSList *list, gpointer data); -GSList WIN32_DLL *g_slist_prepend (GSList *list, +WIN32_DLL GSList *g_slist_prepend (GSList *list, gpointer data); -GSList WIN32_DLL *g_slist_remove (GSList *list, +WIN32_DLL GSList *g_slist_remove (GSList *list, gpointer data); -GSList WIN32_DLL *g_slist_delete_link (GSList *list, +WIN32_DLL GSList *g_slist_last (GSList *list); + +WIN32_DLL GSList *g_slist_reverse (GSList *list); + +WIN32_DLL GSList *g_slist_delete_link (GSList *list, GSList *link); -guint WIN32_DLL g_slist_length (GSList *list); +WIN32_DLL guint g_slist_length (GSList *list); -void WIN32_DLL g_slist_foreach (GSList *list, +WIN32_DLL void g_slist_foreach (GSList *list, GFunc func, gpointer user_data); -void WIN32_DLL g_slist_free (GSList *list); +WIN32_DLL void g_slist_free (GSList *list); -GSList WIN32_DLL *g_slist_last (GSList *list); - -GSList WIN32_DLL *g_slist_reverse (GSList *list); - -GSList WIN32_DLL *g_slist_nth (GSList *list, +WIN32_DLL GSList *g_slist_nth (GSList *list, guint n); -GSList WIN32_DLL * g_slist_find_custom (GSList *list, +WIN32_DLL GSList *g_slist_find_custom (GSList *list, gpointer data, GCompareFunc func ); -gint WIN32_DLL g_slist_position (GSList *list, +WIN32_DLL gint g_slist_position (GSList *list, GSList *llink); typedef struct _GHashTable GHashTable; typedef guint (*GHashFunc) (gconstpointer key); +typedef void (*GHFunc) (gpointer key, + gpointer value, + gpointer user_data); + typedef gboolean (*GHRFunc) (gpointer key, gpointer value, gpointer user_data); -gint WIN32_DLL g_int_equal (gconstpointer v, +WIN32_DLL gint g_int_equal (gconstpointer v, gconstpointer v2); -guint WIN32_DLL g_int_hash (gconstpointer v); -gint WIN32_DLL g_str_equal (gconstpointer v, +WIN32_DLL guint g_int_hash (gconstpointer v); + +WIN32_DLL gint g_str_equal (gconstpointer v, gconstpointer v2); -guint WIN32_DLL g_str_hash (gconstpointer v); +WIN32_DLL guint g_str_hash (gconstpointer v); -GHashTable WIN32_DLL *g_hash_table_new (GHashFunc hash_func, +WIN32_DLL GHashTable *g_hash_table_new (GHashFunc hash_func, GCompareFunc key_compare_func); -void WIN32_DLL g_hash_table_destroy (GHashTable *hash_table); +WIN32_DLL void g_hash_table_destroy (GHashTable *hash_table); -void WIN32_DLL g_hash_table_insert (GHashTable *hash_table, +WIN32_DLL void g_hash_table_insert (GHashTable *hash_table, gpointer key, gpointer value); -gpointer WIN32_DLL g_hash_table_lookup (GHashTable *hash_table, +WIN32_DLL gpointer g_hash_table_lookup (GHashTable *hash_table, gconstpointer key); -guint WIN32_DLL g_hash_table_foreach_remove (GHashTable *hash_table, +WIN32_DLL void g_hash_table_foreach (GHashTable *hash_table, + GHFunc func, + gpointer user_data); + +WIN32_DLL guint g_hash_table_foreach_remove (GHashTable *hash_table, GHRFunc func, gpointer user_data); -guint WIN32_DLL g_hash_table_size (GHashTable *hash_table); +WIN32_DLL guint g_hash_table_size (GHashTable *hash_table); typedef struct _GArray GArray; @@ -134,21 +144,24 @@ size_t allocated; }; -GArray* WIN32_DLL g_array_new( gboolean zero_terminated, gboolean clear, - guint element_size ); +WIN32_DLL GArray* g_array_new( gboolean zero_terminated, gboolean clear, + guint element_size ); #define g_array_append_val(a,v) g_array_append_vals( a, &(v), 1 ); -GArray* WIN32_DLL g_array_append_vals( GArray *array, gconstpointer data, guint len ); +WIN32_DLL GArray* g_array_append_vals( GArray *array, gconstpointer data, guint len ); #define g_array_index(a,t,i) (*(((t*)a->data)+i)) -GArray* WIN32_DLL g_array_set_size( GArray *array, guint length ); +WIN32_DLL GArray* g_array_set_size( GArray *array, guint length ); +WIN32_DLL gchar* g_array_free( GArray *array, gboolean free_segment ); #include <TargetConditionals.h> - + #ifdef TARGET_RT_64_BIT #define GINT_TO_POINTER(i) ((gpointer) (glong)(i)) #define GPOINTER_TO_INT(p) ((gint) (glong)(p)) +#define GPOINTER_TO_UINT(p) ((guint) (gulong)(p)) #else #define GINT_TO_POINTER(i) ((gpointer) (i)) #define GPOINTER_TO_INT(p) ((gint) (p)) +#define GPOINTER_TO_UINT(p) ((guint) (p)) #endif CODE } @@ -177,18 +190,18 @@ WIN32_DLL libspectrum_error libspectrum_zlib_inflate( const libspectrum_byte *gzptr, size_t gzlength, - libspectrum_byte **outptr, size_t *outlength ); + libspectrum_byte **outptr, size_t *outlength ); WIN32_DLL libspectrum_error libspectrum_zlib_compress( const libspectrum_byte *data, size_t length, - libspectrum_byte **gzptr, size_t *gzlength ); + libspectrum_byte **gzptr, size_t *gzlength ); CODE } if( /LIBSPECTRUM_SNAP_ACCESSORS/ ) { - open( DATAFILE, "< $ENV{SRCROOT}/libspectrum/snap_accessors.txt" ) or die "Couldn't open `$ENV{SRCROOT}/libspectrum/snap_accessors.txt': $!"; + open( DATAFILE, '<' . "$ENV{SRCROOT}/libspectrum/snap_accessors.txt" ) or die "Couldn't open `$ENV{SRCROOT}/libspectrum/snap_accessors.txt': $!"; $_ = ''; while( <DATAFILE> ) { @@ -199,23 +212,23 @@ my $return_type; if( $type =~ /^(.*)\*/ ) { - $return_type = "$1 WIN32_DLL *"; + $return_type = "WIN32_DLL $1 *"; } else { - $return_type = "$type WIN32_DLL"; + $return_type = "WIN32_DLL $type"; } if( $indexed ) { print << "CODE"; $return_type libspectrum_snap_$name( libspectrum_snap *snap, int idx ); -void WIN32_DLL libspectrum_snap_set_$name( libspectrum_snap *snap, int idx, $type $name ); +WIN32_DLL void libspectrum_snap_set_$name( libspectrum_snap *snap, int idx, $type $name ); CODE } else { print << "CODE"; $return_type libspectrum_snap_$name( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_$name( libspectrum_snap *snap, $type $name ); +WIN32_DLL void libspectrum_snap_set_$name( libspectrum_snap *snap, $type $name ); CODE } @@ -224,7 +237,7 @@ if( /LIBSPECTRUM_TAPE_ACCESSORS/ ) { - open( DATAFILE, "< $ENV{SRCROOT}/libspectrum/tape_accessors.txt" ) + open( DATAFILE, '<' . "$ENV{SRCROOT}/libspectrum/tape_accessors.txt" ) or die "Couldn't open `$ENV{SRCROOT}/libspectrum/tape_accessors.txt': $!"; $_ = ''; @@ -241,23 +254,23 @@ my $return_type; if( $type =~ /^(.*)\*/ ) { - $return_type = "$1 WIN32_DLL *"; + $return_type = "WIN32_DLL $1 *"; } else { - $return_type = "$type WIN32_DLL"; + $return_type = "WIN32_DLL $type"; } if( $indexed ) { print << "CODE"; $return_type libspectrum_tape_block_$name( libspectrum_tape_block *block, size_t idx ); -libspectrum_error WIN32_DLL libspectrum_tape_block_set_$name( libspectrum_tape_block *block, $type \*$name ); +WIN32_DLL libspectrum_error libspectrum_tape_block_set_$name( libspectrum_tape_block *block, $type \*$name ); CODE } else { print << "CODE"; $return_type libspectrum_tape_block_$name( libspectrum_tape_block *block ); -libspectrum_error WIN32_DLL libspectrum_tape_block_set_$name( libspectrum_tape_block *block, $type $name ); +WIN32_DLL libspectrum_error libspectrum_tape_block_set_$name( libspectrum_tape_block *block, $type $name ); CODE } Modified: trunk/FuseImporter/generate.pl =================================================================== --- trunk/FuseImporter/generate.pl 2012-10-07 11:05:44 UTC (rev 690) +++ trunk/FuseImporter/generate.pl 2012-10-29 12:01:33 UTC (rev 691) @@ -25,11 +25,12 @@ #define TRUE (!FALSE) #endif -typedef char gchar; +typedef char gchar; typedef int gint; typedef long glong; typedef gint gboolean; typedef unsigned int guint; +typedef unsigned long gulong; typedef const void * gconstpointer; typedef void * gpointer; @@ -47,80 +48,89 @@ gconstpointer b); -GSList WIN32_DLL *g_slist_insert_sorted (GSList *list, +WIN32_DLL GSList *g_slist_insert_sorted (GSList *list, gpointer data, GCompareFunc func); -GSList WIN32_DLL *g_slist_insert (GSList *list, +WIN32_DLL GSList *g_slist_insert (GSList *list, gpointer data, gint position); -GSList WIN32_DLL *g_slist_append (GSList *list, +WIN32_DLL GSList *g_slist_append (GSList *list, gpointer data); -GSList WIN32_DLL *g_slist_prepend (GSList *list, +WIN32_DLL GSList *g_slist_prepend (GSList *list, gpointer data); -GSList WIN32_DLL *g_slist_remove (GSList *list, +WIN32_DLL GSList *g_slist_remove (GSList *list, gpointer data); -GSList WIN32_DLL *g_slist_delete_link (GSList *list, +WIN32_DLL GSList *g_slist_last (GSList *list); + +WIN32_DLL GSList *g_slist_reverse (GSList *list); + +WIN32_DLL GSList *g_slist_delete_link (GSList *list, GSList *link); -guint WIN32_DLL g_slist_length (GSList *list); +WIN32_DLL guint g_slist_length (GSList *list); -void WIN32_DLL g_slist_foreach (GSList *list, +WIN32_DLL void g_slist_foreach (GSList *list, GFunc func, gpointer user_data); -void WIN32_DLL g_slist_free (GSList *list); +WIN32_DLL void g_slist_free (GSList *list); -GSList WIN32_DLL *g_slist_last (GSList *list); - -GSList WIN32_DLL *g_slist_reverse (GSList *list); - -GSList WIN32_DLL *g_slist_nth (GSList *list, +WIN32_DLL GSList *g_slist_nth (GSList *list, guint n); -GSList WIN32_DLL * g_slist_find_custom (GSList *list, +WIN32_DLL GSList *g_slist_find_custom (GSList *list, gpointer data, GCompareFunc func ); -gint WIN32_DLL g_slist_position (GSList *list, +WIN32_DLL gint g_slist_position (GSList *list, GSList *llink); typedef struct _GHashTable GHashTable; typedef guint (*GHashFunc) (gconstpointer key); +typedef void (*GHFunc) (gpointer key, + gpointer value, + gpointer user_data); + typedef gboolean (*GHRFunc) (gpointer key, gpointer value, gpointer user_data); -gint WIN32_DLL g_int_equal (gconstpointer v, +WIN32_DLL gint g_int_equal (gconstpointer v, gconstpointer v2); -guint WIN32_DLL g_int_hash (gconstpointer v); -gint WIN32_DLL g_str_equal (gconstpointer v, +WIN32_DLL guint g_int_hash (gconstpointer v); + +WIN32_DLL gint g_str_equal (gconstpointer v, gconstpointer v2); -guint WIN32_DLL g_str_hash (gconstpointer v); +WIN32_DLL guint g_str_hash (gconstpointer v); -GHashTable WIN32_DLL *g_hash_table_new (GHashFunc hash_func, +WIN32_DLL GHashTable *g_hash_table_new (GHashFunc hash_func, GCompareFunc key_compare_func); -void WIN32_DLL g_hash_table_destroy (GHashTable *hash_table); +WIN32_DLL void g_hash_table_destroy (GHashTable *hash_table); -void WIN32_DLL g_hash_table_insert (GHashTable *hash_table, +WIN32_DLL void g_hash_table_insert (GHashTable *hash_table, gpointer key, gpointer value); -gpointer WIN32_DLL g_hash_table_lookup (GHashTable *hash_table, +WIN32_DLL gpointer g_hash_table_lookup (GHashTable *hash_table, gconstpointer key); -guint WIN32_DLL g_hash_table_foreach_remove (GHashTable *hash_table, +WIN32_DLL void g_hash_table_foreach (GHashTable *hash_table, + GHFunc func, + gpointer user_data); + +WIN32_DLL guint g_hash_table_foreach_remove (GHashTable *hash_table, GHRFunc func, gpointer user_data); -guint WIN32_DLL g_hash_table_size (GHashTable *hash_table); +WIN32_DLL guint g_hash_table_size (GHashTable *hash_table); typedef struct _GArray GArray; @@ -134,21 +144,24 @@ size_t allocated; }; -GArray* WIN32_DLL g_array_new( gboolean zero_terminated, gboolean clear, - guint element_size ); +WIN32_DLL GArray* g_array_new( gboolean zero_terminated, gboolean clear, + guint element_size ); #define g_array_append_val(a,v) g_array_append_vals( a, &(v), 1 ); -GArray* WIN32_DLL g_array_append_vals( GArray *array, gconstpointer data, guint len ); +WIN32_DLL GArray* g_array_append_vals( GArray *array, gconstpointer data, guint len ); #define g_array_index(a,t,i) (*(((t*)a->data)+i)) -GArray* WIN32_DLL g_array_set_size( GArray *array, guint length ); +WIN32_DLL GArray* g_array_set_size( GArray *array, guint length ); +WIN32_DLL gchar* g_array_free( GArray *array, gboolean free_segment ); #include <TargetConditionals.h> - + #ifdef TARGET_RT_64_BIT #define GINT_TO_POINTER(i) ((gpointer) (glong)(i)) #define GPOINTER_TO_INT(p) ((gint) (glong)(p)) +#define GPOINTER_TO_UINT(p) ((guint) (gulong)(p)) #else #define GINT_TO_POINTER(i) ((gpointer) (i)) #define GPOINTER_TO_INT(p) ((gint) (p)) +#define GPOINTER_TO_UINT(p) ((guint) (p)) #endif CODE } @@ -177,18 +190,18 @@ WIN32_DLL libspectrum_error libspectrum_zlib_inflate( const libspectrum_byte *gzptr, size_t gzlength, - libspectrum_byte **outptr, size_t *outlength ); + libspectrum_byte **outptr, size_t *outlength ); WIN32_DLL libspectrum_error libspectrum_zlib_compress( const libspectrum_byte *data, size_t length, - libspectrum_byte **gzptr, size_t *gzlength ); + libspectrum_byte **gzptr, size_t *gzlength ); CODE } if( /LIBSPECTRUM_SNAP_ACCESSORS/ ) { - open( DATAFILE, "< $ENV{SRCROOT}/libspectrum/snap_accessors.txt" ) or die "Couldn't open `$ENV{SRCROOT}/libspectrum/snap_accessors.txt': $!"; + open( DATAFILE, '<' . "$ENV{SRCROOT}/libspectrum/snap_accessors.txt" ) or die "Couldn't open `$ENV{SRCROOT}/libspectrum/snap_accessors.txt': $!"; $_ = ''; while( <DATAFILE> ) { @@ -199,23 +212,23 @@ my $return_type; if( $type =~ /^(.*)\*/ ) { - $return_type = "$1 WIN32_DLL *"; + $return_type = "WIN32_DLL $1 *"; } else { - $return_type = "$type WIN32_DLL"; + $return_type = "WIN32_DLL $type"; } if( $indexed ) { print << "CODE"; $return_type libspectrum_snap_$name( libspectrum_snap *snap, int idx ); -void WIN32_DLL libspectrum_snap_set_$name( libspectrum_snap *snap, int idx, $type $name ); +WIN32_DLL void libspectrum_snap_set_$name( libspectrum_snap *snap, int idx, $type $name ); CODE } else { print << "CODE"; $return_type libspectrum_snap_$name( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_$name( libspectrum_snap *snap, $type $name ); +WIN32_DLL void libspectrum_snap_set_$name( libspectrum_snap *snap, $type $name ); CODE } @@ -224,7 +237,7 @@ if( /LIBSPECTRUM_TAPE_ACCESSORS/ ) { - open( DATAFILE, "< $ENV{SRCROOT}/libspectrum/tape_accessors.txt" ) + open( DATAFILE, '<' . "$ENV{SRCROOT}/libspectrum/tape_accessors.txt" ) or die "Couldn't open `$ENV{SRCROOT}/libspectrum/tape_accessors.txt': $!"; $_ = ''; @@ -241,23 +254,23 @@ my $return_type; if( $type =~ /^(.*)\*/ ) { - $return_type = "$1 WIN32_DLL *"; + $return_type = "WIN32_DLL $1 *"; } else { - $return_type = "$type WIN32_DLL"; + $return_type = "WIN32_DLL $type"; } if( $indexed ) { print << "CODE"; $return_type libspectrum_tape_block_$name( libspectrum_tape_block *block, size_t idx ); -libspectrum_error WIN32_DLL libspectrum_tape_block_set_$name( libspectrum_tape_block *block, $type \*$name ); +WIN32_DLL libspectrum_error libspectrum_tape_block_set_$name( libspectrum_tape_block *block, $type \*$name ); CODE } else { print << "CODE"; $return_type libspectrum_tape_block_$name( libspectrum_tape_block *block ); -libspectrum_error WIN32_DLL libspectrum_tape_block_set_$name( libspectrum_tape_block *block, $type $name ); +WIN32_DLL libspectrum_error libspectrum_tape_block_set_$name( libspectrum_tape_block *block, $type $name ); CODE } Modified: trunk/fuse/fusepb/generate.pl =================================================================== --- trunk/fuse/fusepb/generate.pl 2012-10-07 11:05:44 UTC (rev 690) +++ trunk/fuse/fusepb/generate.pl 2012-10-29 12:01:33 UTC (rev 691) @@ -25,11 +25,12 @@ #define TRUE (!FALSE) #endif -typedef char gchar; +typedef char gchar; typedef int gint; typedef long glong; typedef gint gboolean; typedef unsigned int guint; +typedef unsigned long gulong; typedef const void * gconstpointer; typedef void * gpointer; @@ -47,80 +48,89 @@ gconstpointer b); -GSList WIN32_DLL *g_slist_insert_sorted (GSList *list, +WIN32_DLL GSList *g_slist_insert_sorted (GSList *list, gpointer data, GCompareFunc func); -GSList WIN32_DLL *g_slist_insert (GSList *list, +WIN32_DLL GSList *g_slist_insert (GSList *list, gpointer data, gint position); -GSList WIN32_DLL *g_slist_append (GSList *list, +WIN32_DLL GSList *g_slist_append (GSList *list, gpointer data); -GSList WIN32_DLL *g_slist_prepend (GSList *list, +WIN32_DLL GSList *g_slist_prepend (GSList *list, gpointer data); -GSList WIN32_DLL *g_slist_remove (GSList *list, +WIN32_DLL GSList *g_slist_remove (GSList *list, gpointer data); -GSList WIN32_DLL *g_slist_delete_link (GSList *list, +WIN32_DLL GSList *g_slist_last (GSList *list); + +WIN32_DLL GSList *g_slist_reverse (GSList *list); + +WIN32_DLL GSList *g_slist_delete_link (GSList *list, GSList *link); -guint WIN32_DLL g_slist_length (GSList *list); +WIN32_DLL guint g_slist_length (GSList *list); -void WIN32_DLL g_slist_foreach (GSList *list, +WIN32_DLL void g_slist_foreach (GSList *list, GFunc func, gpointer user_data); -void WIN32_DLL g_slist_free (GSList *list); +WIN32_DLL void g_slist_free (GSList *list); -GSList WIN32_DLL *g_slist_last (GSList *list); - -GSList WIN32_DLL *g_slist_reverse (GSList *list); - -GSList WIN32_DLL *g_slist_nth (GSList *list, +WIN32_DLL GSList *g_slist_nth (GSList *list, guint n); -GSList WIN32_DLL * g_slist_find_custom (GSList *list, +WIN32_DLL GSList *g_slist_find_custom (GSList *list, gpointer data, GCompareFunc func ); -gint WIN32_DLL g_slist_position (GSList *list, +WIN32_DLL gint g_slist_position (GSList *list, GSList *llink); typedef struct _GHashTable GHashTable; typedef guint (*GHashFunc) (gconstpointer key); +typedef void (*GHFunc) (gpointer key, + gpointer value, + gpointer user_data); + typedef gboolean (*GHRFunc) (gpointer key, gpointer value, gpointer user_data); -gint WIN32_DLL g_int_equal (gconstpointer v, +WIN32_DLL gint g_int_equal (gconstpointer v, gconstpointer v2); -guint WIN32_DLL g_int_hash (gconstpointer v); -gint WIN32_DLL g_str_equal (gconstpointer v, +WIN32_DLL guint g_int_hash (gconstpointer v); + +WIN32_DLL gint g_str_equal (gconstpointer v, gconstpointer v2); -guint WIN32_DLL g_str_hash (gconstpointer v); +WIN32_DLL guint g_str_hash (gconstpointer v); -GHashTable WIN32_DLL *g_hash_table_new (GHashFunc hash_func, +WIN32_DLL GHashTable *g_hash_table_new (GHashFunc hash_func, GCompareFunc key_compare_func); -void WIN32_DLL g_hash_table_destroy (GHashTable *hash_table); +WIN32_DLL void g_hash_table_destroy (GHashTable *hash_table); -void WIN32_DLL g_hash_table_insert (GHashTable *hash_table, +WIN32_DLL void g_hash_table_insert (GHashTable *hash_table, gpointer key, gpointer value); -gpointer WIN32_DLL g_hash_table_lookup (GHashTable *hash_table, +WIN32_DLL gpointer g_hash_table_lookup (GHashTable *hash_table, gconstpointer key); -guint WIN32_DLL g_hash_table_foreach_remove (GHashTable *hash_table, +WIN32_DLL void g_hash_table_foreach (GHashTable *hash_table, + GHFunc func, + gpointer user_data); + +WIN32_DLL guint g_hash_table_foreach_remove (GHashTable *hash_table, GHRFunc func, gpointer user_data); -guint WIN32_DLL g_hash_table_size (GHashTable *hash_table); +WIN32_DLL guint g_hash_table_size (GHashTable *hash_table); typedef struct _GArray GArray; @@ -134,21 +144,24 @@ size_t allocated; }; -GArray* WIN32_DLL g_array_new( gboolean zero_terminated, gboolean clear, - guint element_size ); +WIN32_DLL GArray* g_array_new( gboolean zero_terminated, gboolean clear, + guint element_size ); #define g_array_append_val(a,v) g_array_append_vals( a, &(v), 1 ); -GArray* WIN32_DLL g_array_append_vals( GArray *array, gconstpointer data, guint len ); +WIN32_DLL GArray* g_array_append_vals( GArray *array, gconstpointer data, guint len ); #define g_array_index(a,t,i) (*(((t*)a->data)+i)) -GArray* WIN32_DLL g_array_set_size( GArray *array, guint length ); +WIN32_DLL GArray* g_array_set_size( GArray *array, guint length ); +WIN32_DLL gchar* g_array_free( GArray *array, gboolean free_segment ); #include <TargetConditionals.h> - + #ifdef TARGET_RT_64_BIT #define GINT_TO_POINTER(i) ((gpointer) (glong)(i)) #define GPOINTER_TO_INT(p) ((gint) (glong)(p)) +#define GPOINTER_TO_UINT(p) ((guint) (gulong)(p)) #else #define GINT_TO_POINTER(i) ((gpointer) (i)) #define GPOINTER_TO_INT(p) ((gint) (p)) +#define GPOINTER_TO_UINT(p) ((guint) (p)) #endif CODE } @@ -177,18 +190,26 @@ WIN32_DLL libspectrum_error libspectrum_zlib_inflate( const libspectrum_byte *gzptr, size_t gzlength, - libspectrum_byte **outptr, size_t *outlength ); + libspectrum_byte **outptr, size_t *outlength ); WIN32_DLL libspectrum_error libspectrum_zlib_compress( const libspectrum_byte *data, size_t length, - libspectrum_byte **gzptr, size_t *gzlength ); + libspectrum_byte **gzptr, size_t *gzlength ); + +/* we support files compressed with bz2 */ +#define LIBSPECTRUM_SUPPORTS_BZ2_COMPRESSION (1) + + +/* we support files wav files */ +#define LIBSPECTRUM_SUPPORTS_AUDIOFILE (1) + CODE } if( /LIBSPECTRUM_SNAP_ACCESSORS/ ) { - open( DATAFILE, "< $ENV{SRCROOT}/libspectrum/snap_accessors.txt" ) or die "Couldn't open `$ENV{SRCROOT}/libspectrum/snap_accessors.txt': $!"; + open( DATAFILE, '<' . "$ENV{SRCROOT}/libspectrum/snap_accessors.txt" ) or die "Couldn't open `$ENV{SRCROOT}/libspectrum/snap_accessors.txt': $!"; $_ = ''; while( <DATAFILE> ) { @@ -199,23 +220,23 @@ my $return_type; if( $type =~ /^(.*)\*/ ) { - $return_type = "$1 WIN32_DLL *"; + $return_type = "WIN32_DLL $1 *"; } else { - $return_type = "$type WIN32_DLL"; + $return_type = "WIN32_DLL $type"; } if( $indexed ) { print << "CODE"; $return_type libspectrum_snap_$name( libspectrum_snap *snap, int idx ); -void WIN32_DLL libspectrum_snap_set_$name( libspectrum_snap *snap, int idx, $type $name ); +WIN32_DLL void libspectrum_snap_set_$name( libspectrum_snap *snap, int idx, $type $name ); CODE } else { print << "CODE"; $return_type libspectrum_snap_$name( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_$name( libspectrum_snap *snap, $type $name ); +WIN32_DLL void libspectrum_snap_set_$name( libspectrum_snap *snap, $type $name ); CODE } @@ -224,7 +245,7 @@ if( /LIBSPECTRUM_TAPE_ACCESSORS/ ) { - open( DATAFILE, "< $ENV{SRCROOT}/libspectrum/tape_accessors.txt" ) + open( DATAFILE, '<' . "$ENV{SRCROOT}/libspectrum/tape_accessors.txt" ) or die "Couldn't open `$ENV{SRCROOT}/libspectrum/tape_accessors.txt': $!"; $_ = ''; @@ -241,23 +262,23 @@ my $return_type; if( $type =~ /^(.*)\*/ ) { - $return_type = "$1 WIN32_DLL *"; + $return_type = "WIN32_DLL $1 *"; } else { - $return_type = "$type WIN32_DLL"; + $return_type = "WIN32_DLL $type"; } if( $indexed ) { print << "CODE"; $return_type libspectrum_tape_block_$name( libspectrum_tape_block *block, size_t idx ); -libspectrum_error WIN32_DLL libspectrum_tape_block_set_$name( libspectrum_tape_block *block, $type \*$name ); +WIN32_DLL libspectrum_error libspectrum_tape_block_set_$name( libspectrum_tape_block *block, $type \*$name ); CODE } else { print << "CODE"; $return_type libspectrum_tape_block_$name( libspectrum_tape_block *block ); -libspectrum_error WIN32_DLL libspectrum_tape_block_set_$name( libspectrum_tape_block *block, $type $name ); +WIN32_DLL libspectrum_error libspectrum_tape_block_set_$name( libspectrum_tape_block *block, $type $name ); CODE } Modified: trunk/libspectrum/generate.pl =================================================================== --- trunk/libspectrum/generate.pl 2012-10-07 11:05:44 UTC (rev 690) +++ trunk/libspectrum/generate.pl 2012-10-29 12:01:33 UTC (rev 691) @@ -25,11 +25,12 @@ #define TRUE (!FALSE) #endif -typedef char gchar; +typedef char gchar; typedef int gint; typedef long glong; typedef gint gboolean; typedef unsigned int guint; +typedef unsigned long gulong; typedef const void * gconstpointer; typedef void * gpointer; @@ -47,80 +48,89 @@ gconstpointer b); -GSList WIN32_DLL *g_slist_insert_sorted (GSList *list, +WIN32_DLL GSList *g_slist_insert_sorted (GSList *list, gpointer data, GCompareFunc func); -GSList WIN32_DLL *g_slist_insert (GSList *list, +WIN32_DLL GSList *g_slist_insert (GSList *list, gpointer data, gint position); -GSList WIN32_DLL *g_slist_append (GSList *list, +WIN32_DLL GSList *g_slist_append (GSList *list, gpointer data); -GSList WIN32_DLL *g_slist_prepend (GSList *list, +WIN32_DLL GSList *g_slist_prepend (GSList *list, gpointer data); -GSList WIN32_DLL *g_slist_remove (GSList *list, +WIN32_DLL GSList *g_slist_remove (GSList *list, gpointer data); -GSList WIN32_DLL *g_slist_delete_link (GSList *list, +WIN32_DLL GSList *g_slist_last (GSList *list); + +WIN32_DLL GSList *g_slist_reverse (GSList *list); + +WIN32_DLL GSList *g_slist_delete_link (GSList *list, GSList *link); -guint WIN32_DLL g_slist_length (GSList *list); +WIN32_DLL guint g_slist_length (GSList *list); -void WIN32_DLL g_slist_foreach (GSList *list, +WIN32_DLL void g_slist_foreach (GSList *list, GFunc func, gpointer user_data); -void WIN32_DLL g_slist_free (GSList *list); +WIN32_DLL void g_slist_free (GSList *list); -GSList WIN32_DLL *g_slist_last (GSList *list); - -GSList WIN32_DLL *g_slist_reverse (GSList *list); - -GSList WIN32_DLL *g_slist_nth (GSList *list, +WIN32_DLL GSList *g_slist_nth (GSList *list, guint n); -GSList WIN32_DLL * g_slist_find_custom (GSList *list, +WIN32_DLL GSList *g_slist_find_custom (GSList *list, gpointer data, GCompareFunc func ); -gint WIN32_DLL g_slist_position (GSList *list, +WIN32_DLL gint g_slist_position (GSList *list, GSList *llink); typedef struct _GHashTable GHashTable; typedef guint (*GHashFunc) (gconstpointer key); +typedef void (*GHFunc) (gpointer key, + gpointer value, + gpointer user_data); + typedef gboolean (*GHRFunc) (gpointer key, gpointer value, gpointer user_data); -gint WIN32_DLL g_int_equal (gconstpointer v, +WIN32_DLL gint g_int_equal (gconstpointer v, gconstpointer v2); -guint WIN32_DLL g_int_hash (gconstpointer v); -gint WIN32_DLL g_str_equal (gconstpointer v, +WIN32_DLL guint g_int_hash (gconstpointer v); + +WIN32_DLL gint g_str_equal (gconstpointer v, gconstpointer v2); -guint WIN32_DLL g_str_hash (gconstpointer v); +WIN32_DLL guint g_str_hash (gconstpointer v); -GHashTable WIN32_DLL *g_hash_table_new (GHashFunc hash_func, +WIN32_DLL GHashTable *g_hash_table_new (GHashFunc hash_func, GCompareFunc key_compare_func); -void WIN32_DLL g_hash_table_destroy (GHashTable *hash_table); +WIN32_DLL void g_hash_table_destroy (GHashTable *hash_table); -void WIN32_DLL g_hash_table_insert (GHashTable *hash_table, +WIN32_DLL void g_hash_table_insert (GHashTable *hash_table, gpointer key, gpointer value); -gpointer WIN32_DLL g_hash_table_lookup (GHashTable *hash_table, +WIN32_DLL gpointer g_hash_table_lookup (GHashTable *hash_table, gconstpointer key); -guint WIN32_DLL g_hash_table_foreach_remove (GHashTable *hash_table, +WIN32_DLL void g_hash_table_foreach (GHashTable *hash_table, + GHFunc func, + gpointer user_data); + +WIN32_DLL guint g_hash_table_foreach_remove (GHashTable *hash_table, GHRFunc func, gpointer user_data); -guint WIN32_DLL g_hash_table_size (GHashTable *hash_table); +WIN32_DLL guint g_hash_table_size (GHashTable *hash_table); typedef struct _GArray GArray; @@ -134,21 +144,24 @@ size_t allocated; }; -GArray* WIN32_DLL g_array_new( gboolean zero_terminated, gboolean clear, - guint element_size ); +WIN32_DLL GArray* g_array_new( gboolean zero_terminated, gboolean clear, + guint element_size ); #define g_array_append_val(a,v) g_array_append_vals( a, &(v), 1 ); -GArray* WIN32_DLL g_array_append_vals( GArray *array, gconstpointer data, guint len ); +WIN32_DLL GArray* g_array_append_vals( GArray *array, gconstpointer data, guint len ); #define g_array_index(a,t,i) (*(((t*)a->data)+i)) -GArray* WIN32_DLL g_array_set_size( GArray *array, guint length ); +WIN32_DLL GArray* g_array_set_size( GArray *array, guint length ); +WIN32_DLL gchar* g_array_free( GArray *array, gboolean free_segment ); #include <TargetConditionals.h> - + #ifdef TARGET_RT_64_BIT #define GINT_TO_POINTER(i) ((gpointer) (glong)(i)) #define GPOINTER_TO_INT(p) ((gint) (glong)(p)) +#define GPOINTER_TO_UINT(p) ((guint) (gulong)(p)) #else #define GINT_TO_POINTER(i) ((gpointer) (i)) #define GPOINTER_TO_INT(p) ((gint) (p)) +#define GPOINTER_TO_UINT(p) ((guint) (p)) #endif CODE } @@ -161,7 +174,8 @@ if( /LIBSPECTRUM_SIGNATURE_PARAMETERS/ ) { - $_ = "/* Signature parameters not stored as libgcrypt is not present */\n"; + $_ = "/* Signature parameters not stored as libgcrypt is not present */ +"; } @@ -176,18 +190,26 @@ WIN32_DLL libspectrum_error libspectrum_zlib_inflate( const libspectrum_byte *gzptr, size_t gzlength, - libspectrum_byte **outptr, size_t *outlength ); + libspectrum_byte **outptr, size_t *outlength ); WIN32_DLL libspectrum_error libspectrum_zlib_compress( const libspectrum_byte *data, size_t length, - libspectrum_byte **gzptr, size_t *gzlength ); + libspectrum_byte **gzptr, size_t *gzlength ); + +/* we support files compressed with bz2 */ +#define LIBSPECTRUM_SUPPORTS_BZ2_COMPRESSION (1) + + +/* we support files wav files */ +#define LIBSPECTRUM_SUPPORTS_AUDIOFILE (1) + CODE } if( /LIBSPECTRUM_SNAP_ACCESSORS/ ) { - open( DATAFILE, "< $ENV{SRCROOT}/libspectrum/snap_accessors.txt" ) or die "Couldn't open `$ENV{SRCROOT}/libspectrum/snap_accessors.txt': $!"; + open( DATAFILE, '<' . "$ENV{SRCROOT}/libspectrum/snap_accessors.txt" ) or die "Couldn't open `$ENV{SRCROOT}/libspectrum/snap_accessors.txt': $!"; $_ = ''; while( <DATAFILE> ) { @@ -198,23 +220,23 @@ my $return_type; if( $type =~ /^(.*)\*/ ) { - $return_type = "$1 WIN32_DLL *"; + $return_type = "WIN32_DLL $1 *"; } else { - $return_type = "$type WIN32_DLL"; + $return_type = "WIN32_DLL $type"; } if( $indexed ) { print << "CODE"; $return_type libspectrum_snap_$name( libspectrum_snap *snap, int idx ); -void WIN32_DLL libspectrum_snap_set_$name( libspectrum_snap *snap, int idx, $type $name ); +WIN32_DLL void libspectrum_snap_set_$name( libspectrum_snap *snap, int idx, $type $name ); CODE } else { print << "CODE"; $return_type libspectrum_snap_$name( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_$name( libspectrum_snap *snap, $type $name ); +WIN32_DLL void libspectrum_snap_set_$name( libspectrum_snap *snap, $type $name ); CODE } @@ -223,7 +245,7 @@ if( /LIBSPECTRUM_TAPE_ACCESSORS/ ) { - open( DATAFILE, "< $ENV{SRCROOT}/libspectrum/tape_accessors.txt" ) + open( DATAFILE, '<' . "$ENV{SRCROOT}/libspectrum/tape_accessors.txt" ) or die "Couldn't open `$ENV{SRCROOT}/libspectrum/tape_accessors.txt': $!"; $_ = ''; @@ -240,23 +262,23 @@ my $return_type; if( $type =~ /^(.*)\*/ ) { - $return_type = "$1 WIN32_DLL *"; + $return_type = "WIN32_DLL $1 *"; } else { - $return_type = "$type WIN32_DLL"; + $return_type = "WIN32_DLL $type"; } if( $indexed ) { print << "CODE"; $return_type libspectrum_tape_block_$name( libspectrum_tape_block *block, size_t idx ); -libspectrum_error WIN32_DLL libspectrum_tape_block_set_$name( libspectrum_tape_block *block, $type \*$name ); +WIN32_DLL libspectrum_error libspectrum_tape_block_set_$name( libspectrum_tape_block *block, $type \*$name ); CODE } else { print << "CODE"; $return_type libspectrum_tape_block_$name( libspectrum_tape_block *block ); -libspectrum_error WIN32_DLL libspectrum_tape_block_set_$name( libspectrum_tape_block *block, $type $name ); +WIN32_DLL libspectrum_error libspectrum_tape_block_set_$name( libspectrum_tape_block *block, $type $name ); CODE } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |