From: <fr...@us...> - 2021-03-06 22:40:48
|
This is an automated email from the git hooks/post-receive-user script. fredm pushed a commit to branch master in repository libspectrum. View the commit online: https://sourceforge.net/p/fuse-emulator/libspectrum/ci/da6be4186477de4a1b74a283b8cd5c0d527015d5/ The following commit(s) were added to refs/heads/master by this push: new da6be41 Hide all symbols except the ones in the public API da6be41 is described below commit da6be4186477de4a1b74a283b8cd5c0d527015d5 Author: Alberto Garcia <be...@ig...> AuthorDate: Sun Mar 7 09:40:14 2021 +1100 Hide all symbols except the ones in the public API --- ChangeLog | 2 + Makefile.am | 2 +- doc/libspectrum.txt | 2 +- generate.pl.in | 16 +- internals.h | 1 + libspectrum.h.in | 420 ++++++++++++++++++++++++++-------------------------- make-perl.c | 166 ++++++++++++--------- tape.c | 2 +- 8 files changed, 322 insertions(+), 289 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1f00adc..d065190 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,8 @@ * Various minor bug fixes/improvements: * Fix PZX handling on big endian systems (Alberto Garcia). + * Hide all symbols except the ones in the public API (Alberto + Garcia). * Run tests on 'make check' invocation (Alberto Garcia). 2021-02-27 Philip Kendall <phi...@sh...> diff --git a/Makefile.am b/Makefile.am index 4d47afc..9fb8e77 100644 --- a/Makefile.am +++ b/Makefile.am @@ -95,7 +95,7 @@ noinst_DATA = # PKG_INSTALLDIR in configure.ac. pkgconfig_DATA = libspectrum.pc -AM_CFLAGS = -DLIBSPECTRUM_EXPORTS +AM_CFLAGS = -DLIBSPECTRUM_EXPORTS -fvisibility=hidden make-perl$(EXEEXT): $(srcdir)/make-perl.c config.h $(AM_V_CC)$(CC_FOR_BUILD) -I. -o $@ $< diff --git a/doc/libspectrum.txt b/doc/libspectrum.txt index af8ef8b..714d95d 100644 --- a/doc/libspectrum.txt +++ b/doc/libspectrum.txt @@ -1023,7 +1023,7 @@ libspectrum_tape_peek_next_block( libspectrum_tape *tape ) Get the next block on the tape, but don't move the tape along or initialise the block. -libspectrum_tape_block WIN32_DLL * +libspectrum_tape_block LIBSPECTRUM_API * libspectrum_tape_peek_last_block( libspectrum_tape *tape ) Get the last block on the tape, but don't move the tape along or diff --git a/generate.pl.in b/generate.pl.in index 68e7fd7..5d4a8bc 100644 --- a/generate.pl.in +++ b/generate.pl.in @@ -34,23 +34,23 @@ if( /LIBSPECTRUM_SNAP_ACCESSORS/ ) { my $return_type; if( $type =~ /^(.*)\*/ ) { - $return_type = "WIN32_DLL $1 *"; + $return_type = "LIBSPECTRUM_API $1 *"; } else { - $return_type = "WIN32_DLL $type"; + $return_type = "LIBSPECTRUM_API $type"; } if( $indexed ) { print << "CODE"; $return_type libspectrum_snap_$name( libspectrum_snap *snap, int idx ); -WIN32_DLL void libspectrum_snap_set_$name( libspectrum_snap *snap, int idx, $type $name ); +LIBSPECTRUM_API void libspectrum_snap_set_$name( libspectrum_snap *snap, int idx, $type $name ); CODE } else { print << "CODE"; $return_type libspectrum_snap_$name( libspectrum_snap *snap ); -WIN32_DLL void libspectrum_snap_set_$name( libspectrum_snap *snap, $type $name ); +LIBSPECTRUM_API void libspectrum_snap_set_$name( libspectrum_snap *snap, $type $name ); CODE } @@ -76,23 +76,23 @@ if( /LIBSPECTRUM_TAPE_ACCESSORS/ ) { my $return_type; if( $type =~ /^(.*)\*/ ) { - $return_type = "WIN32_DLL $1 *"; + $return_type = "LIBSPECTRUM_API $1 *"; } else { - $return_type = "WIN32_DLL $type"; + $return_type = "LIBSPECTRUM_API $type"; } if( $indexed ) { print << "CODE"; $return_type libspectrum_tape_block_$name( libspectrum_tape_block *block, size_t idx ); -WIN32_DLL libspectrum_error libspectrum_tape_block_set_$name( libspectrum_tape_block *block, $type \*$name ); +LIBSPECTRUM_API 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 ); -WIN32_DLL libspectrum_error libspectrum_tape_block_set_$name( libspectrum_tape_block *block, $type $name ); +LIBSPECTRUM_API libspectrum_error libspectrum_tape_block_set_$name( libspectrum_tape_block *block, $type $name ); CODE } diff --git a/internals.h b/internals.h index 2d474be..2f0c4e8 100644 --- a/internals.h +++ b/internals.h @@ -190,6 +190,7 @@ libspectrum_sp_read( libspectrum_snap *snap, libspectrum_error libspectrum_szx_read( libspectrum_snap *snap, const libspectrum_byte *buffer, size_t buffer_length ); +LIBSPECTRUM_API /* FIXME: we shouldn't export this but test/szx.c is using it */ libspectrum_error libspectrum_szx_write( libspectrum_buffer *buffer, int *out_flags, libspectrum_snap *snap, libspectrum_creator *creator, diff --git a/libspectrum.h.in b/libspectrum.h.in index bee106c..8c11f44 100644 --- a/libspectrum.h.in +++ b/libspectrum.h.in @@ -51,21 +51,25 @@ extern "C" { #endif /* #ifndef WIN32_LEAN_AND_MEAN */ #ifdef LIBSPECTRUM_EXPORTS -#define WIN32_DLL __declspec( dllexport ) +#define LIBSPECTRUM_API __declspec( dllexport ) #else /* #ifdef LIBSPECTRUM_EXPORTS */ -#define WIN32_DLL __declspec( dllimport ) +#define LIBSPECTRUM_API __declspec( dllimport ) #endif /* #ifdef LIBSPECTRUM_EXPORTS */ #else /* #ifdef _WIN32 */ -#define WIN32_DLL +#ifdef LIBSPECTRUM_EXPORTS +#define LIBSPECTRUM_API __attribute__ ((visibility ("default"))) +#else +#define LIBSPECTRUM_API +#endif #endif /* #ifdef _WIN32 */ #ifdef __GNUC__ #define DEPRECATED __attribute__((deprecated)) #else /* #ifdef __GNUC__ */ -#define DEPRECATED +#define DEPRECATED #endif /* #ifdef __GNUC__ */ LIBSPECTRUM_INCLUDE_GCRYPT @@ -105,23 +109,23 @@ LIBSPECTRUM_CAPABILITIES /* Initialisation */ -WIN32_DLL libspectrum_error libspectrum_init( void ); -WIN32_DLL void libspectrum_end( void ); +LIBSPECTRUM_API libspectrum_error libspectrum_init( void ); +LIBSPECTRUM_API void libspectrum_end( void ); /* Version checking */ -WIN32_DLL int libspectrum_check_version( const char *version ); -WIN32_DLL const char *libspectrum_version( void ); -WIN32_DLL const char *libspectrum_gcrypt_version( void ); +LIBSPECTRUM_API int libspectrum_check_version( const char *version ); +LIBSPECTRUM_API const char *libspectrum_version( void ); +LIBSPECTRUM_API const char *libspectrum_gcrypt_version( void ); /* Error handling */ typedef libspectrum_error (*libspectrum_error_function_t)( libspectrum_error error, const char *format, va_list ap ); -extern WIN32_DLL libspectrum_error_function_t libspectrum_error_function; +extern LIBSPECTRUM_API libspectrum_error_function_t libspectrum_error_function; -WIN32_DLL libspectrum_error +LIBSPECTRUM_API libspectrum_error libspectrum_default_error_function( libspectrum_error error, const char *format, va_list ap ); @@ -139,14 +143,14 @@ typedef struct libspectrum_mem_vtable_t { libspectrum_free_fn_t free; } libspectrum_mem_vtable_t; -WIN32_DLL void* libspectrum_malloc( size_t size ); -WIN32_DLL void* libspectrum_malloc_n( size_t nmemb, size_t size ); -WIN32_DLL void* libspectrum_malloc0_n( size_t nmemb, size_t size ); -WIN32_DLL void* libspectrum_realloc( void *ptr, size_t size ); -WIN32_DLL void* libspectrum_realloc_n( void *ptr, size_t nmemb, size_t size ); -WIN32_DLL void libspectrum_free( void *ptr ); +LIBSPECTRUM_API void* libspectrum_malloc( size_t size ); +LIBSPECTRUM_API void* libspectrum_malloc_n( size_t nmemb, size_t size ); +LIBSPECTRUM_API void* libspectrum_malloc0_n( size_t nmemb, size_t size ); +LIBSPECTRUM_API void* libspectrum_realloc( void *ptr, size_t size ); +LIBSPECTRUM_API void* libspectrum_realloc_n( void *ptr, size_t nmemb, size_t size ); +LIBSPECTRUM_API void libspectrum_free( void *ptr ); -WIN32_DLL void libspectrum_mem_set_vtable( libspectrum_mem_vtable_t *table ); +LIBSPECTRUM_API void libspectrum_mem_set_vtable( libspectrum_mem_vtable_t *table ); #define libspectrum_new( type, count ) \ ( ( type * ) libspectrum_malloc_n( (count), sizeof( type ) ) ) @@ -186,7 +190,7 @@ typedef enum libspectrum_id_t { /* Below here, present only in 0.2.0 and later */ - LIBSPECTRUM_ID_TAPE_WARAJEVO, /* Warajevo-style .tap tape image */ + LIBSPECTRUM_ID_TAPE_WARAJEVO, /* Warajevo-style .tap tape image */ LIBSPECTRUM_ID_SNAPSHOT_PLUSD, /* DISCiPLE/+D snapshot */ LIBSPECTRUM_ID_SNAPSHOT_SP, /* .sp snapshot */ @@ -307,64 +311,64 @@ typedef enum libspectrum_class_t { typedef struct libspectrum_buffer libspectrum_buffer; -WIN32_DLL libspectrum_buffer* +LIBSPECTRUM_API libspectrum_buffer* libspectrum_buffer_alloc( void ); -WIN32_DLL void +LIBSPECTRUM_API void libspectrum_buffer_reallocate( libspectrum_buffer *buffer, size_t new_size ); -WIN32_DLL void +LIBSPECTRUM_API void libspectrum_buffer_free( libspectrum_buffer *buffer ); -WIN32_DLL int +LIBSPECTRUM_API int libspectrum_buffer_is_empty( const libspectrum_buffer *buffer ); -WIN32_DLL int +LIBSPECTRUM_API int libspectrum_buffer_is_not_empty( const libspectrum_buffer *buffer ); -WIN32_DLL void +LIBSPECTRUM_API void libspectrum_buffer_write_byte( libspectrum_buffer *buffer, libspectrum_byte data ); -WIN32_DLL void +LIBSPECTRUM_API void libspectrum_buffer_write_word( libspectrum_buffer *buffer, libspectrum_word data ); -WIN32_DLL void +LIBSPECTRUM_API void libspectrum_buffer_write_dword( libspectrum_buffer *buffer, libspectrum_dword data ); -WIN32_DLL void +LIBSPECTRUM_API void libspectrum_buffer_write_buffer( libspectrum_buffer *dest, const libspectrum_buffer *src ); -WIN32_DLL void +LIBSPECTRUM_API void libspectrum_buffer_write( libspectrum_buffer *buffer, const void *data, size_t size ); -WIN32_DLL void +LIBSPECTRUM_API void libspectrum_buffer_set( libspectrum_buffer *buffer, libspectrum_byte value, size_t size ); -WIN32_DLL size_t +LIBSPECTRUM_API size_t libspectrum_buffer_get_data_size( const libspectrum_buffer *buffer ); -WIN32_DLL libspectrum_byte* +LIBSPECTRUM_API libspectrum_byte* libspectrum_buffer_get_data( const libspectrum_buffer *buffer ); -WIN32_DLL void +LIBSPECTRUM_API void libspectrum_buffer_clear( libspectrum_buffer *buffer ); -WIN32_DLL void +LIBSPECTRUM_API void libspectrum_buffer_append( libspectrum_byte **buffer, size_t *length, libspectrum_byte **ptr, const libspectrum_buffer *src ); -WIN32_DLL libspectrum_error +LIBSPECTRUM_API libspectrum_error libspectrum_identify_file( libspectrum_id_t *type, const char *filename, const unsigned char *buffer, size_t length ); -WIN32_DLL libspectrum_error +LIBSPECTRUM_API libspectrum_error libspectrum_identify_file_with_class( libspectrum_id_t *type, libspectrum_class_t *libspectrum_class, const char *filename, const unsigned char *buffer, size_t length ); -WIN32_DLL libspectrum_error +LIBSPECTRUM_API libspectrum_error libspectrum_identify_file_raw( libspectrum_id_t *type, const char *filename, const unsigned char *buffer, size_t length ); -WIN32_DLL libspectrum_error +LIBSPECTRUM_API libspectrum_error libspectrum_identify_class( libspectrum_class_t *libspectrum_class, libspectrum_id_t type ); @@ -403,122 +407,122 @@ typedef enum libspectrum_machine { } libspectrum_machine; -WIN32_DLL const char* libspectrum_machine_name( libspectrum_machine type ); +LIBSPECTRUM_API const char* libspectrum_machine_name( libspectrum_machine type ); /* The various capabilities of the different machines */ -extern WIN32_DLL const int +extern LIBSPECTRUM_API const int LIBSPECTRUM_MACHINE_CAPABILITY_AY; /* AY-3-8192 */ -extern WIN32_DLL const int +extern LIBSPECTRUM_API const int LIBSPECTRUM_MACHINE_CAPABILITY_128_MEMORY; /* 128-style memory paging */ -extern WIN32_DLL const int +extern LIBSPECTRUM_API const int LIBSPECTRUM_MACHINE_CAPABILITY_PLUS3_MEMORY; /* +3-style memory paging */ -extern WIN32_DLL const int +extern LIBSPECTRUM_API const int LIBSPECTRUM_MACHINE_CAPABILITY_PLUS3_DISK; /* +3-style disk drive */ -extern WIN32_DLL const int +extern LIBSPECTRUM_API const int LIBSPECTRUM_MACHINE_CAPABILITY_TIMEX_MEMORY; /* Timex-style memory paging */ -extern WIN32_DLL const int +extern LIBSPECTRUM_API const int LIBSPECTRUM_MACHINE_CAPABILITY_TIMEX_VIDEO; /* Timex-style video modes */ -extern WIN32_DLL const int +extern LIBSPECTRUM_API const int LIBSPECTRUM_MACHINE_CAPABILITY_TRDOS_DISK; /* TRDOS-style disk drive */ -extern WIN32_DLL const int +extern LIBSPECTRUM_API const int LIBSPECTRUM_MACHINE_CAPABILITY_TIMEX_DOCK; /* T[SC]2068-style cartridge port */ -extern WIN32_DLL const int +extern LIBSPECTRUM_API const int LIBSPECTRUM_MACHINE_CAPABILITY_SINCLAIR_JOYSTICK; /* Sinclair-style joystick ports */ -extern WIN32_DLL const int +extern LIBSPECTRUM_API const int LIBSPECTRUM_MACHINE_CAPABILITY_KEMPSTON_JOYSTICK; /* Kempston-style joystick ports */ -extern WIN32_DLL const int +extern LIBSPECTRUM_API const int LIBSPECTRUM_MACHINE_CAPABILITY_SCORP_MEMORY; /* Scorpion-style memory paging */ -extern WIN32_DLL const int +extern LIBSPECTRUM_API const int LIBSPECTRUM_MACHINE_CAPABILITY_EVEN_M1; /* M1 cycles always start on even tstate counts */ -extern WIN32_DLL const int +extern LIBSPECTRUM_API const int LIBSPECTRUM_MACHINE_CAPABILITY_SE_MEMORY; /* SE-style memory paging */ -extern WIN32_DLL const int +extern LIBSPECTRUM_API const int LIBSPECTRUM_MACHINE_CAPABILITY_NTSC; /* NTSC display */ -extern WIN32_DLL const int +extern LIBSPECTRUM_API const int LIBSPECTRUM_MACHINE_CAPABILITY_PENT512_MEMORY; /* Pentagon 512 memory paging */ -extern WIN32_DLL const int +extern LIBSPECTRUM_API const int LIBSPECTRUM_MACHINE_CAPABILITY_PENT1024_MEMORY; /* Pentagon 1024 memory paging */ /* Get the capabilities of a machine */ -WIN32_DLL int libspectrum_machine_capabilities( libspectrum_machine type ); +LIBSPECTRUM_API int libspectrum_machine_capabilities( libspectrum_machine type ); /* Get the timings of a machine */ -WIN32_DLL libspectrum_dword +LIBSPECTRUM_API libspectrum_dword libspectrum_timings_processor_speed( libspectrum_machine machine ); -WIN32_DLL libspectrum_dword +LIBSPECTRUM_API libspectrum_dword libspectrum_timings_ay_speed( libspectrum_machine machine ); -WIN32_DLL libspectrum_word +LIBSPECTRUM_API libspectrum_word libspectrum_timings_left_border( libspectrum_machine machine ); -WIN32_DLL libspectrum_word +LIBSPECTRUM_API libspectrum_word libspectrum_timings_horizontal_screen( libspectrum_machine machine ); -WIN32_DLL libspectrum_word +LIBSPECTRUM_API libspectrum_word libspectrum_timings_right_border( libspectrum_machine machine ); -WIN32_DLL libspectrum_word +LIBSPECTRUM_API libspectrum_word libspectrum_timings_horizontal_retrace( libspectrum_machine machine ); -WIN32_DLL libspectrum_word +LIBSPECTRUM_API libspectrum_word libspectrum_timings_top_border( libspectrum_machine machine ); -WIN32_DLL libspectrum_word +LIBSPECTRUM_API libspectrum_word libspectrum_timings_vertical_screen( libspectrum_machine machine ); -WIN32_DLL libspectrum_word +LIBSPECTRUM_API libspectrum_word libspectrum_timings_bottom_border( libspectrum_machine machine ); -WIN32_DLL libspectrum_word +LIBSPECTRUM_API libspectrum_word libspectrum_timings_vertical_retrace( libspectrum_machine machine ); -WIN32_DLL libspectrum_word +LIBSPECTRUM_API libspectrum_word libspectrum_timings_interrupt_length( libspectrum_machine machine ); -WIN32_DLL libspectrum_word +LIBSPECTRUM_API libspectrum_word libspectrum_timings_top_left_pixel( libspectrum_machine machine ); -WIN32_DLL libspectrum_word +LIBSPECTRUM_API libspectrum_word libspectrum_timings_tstates_per_line( libspectrum_machine machine ); -WIN32_DLL libspectrum_word +LIBSPECTRUM_API libspectrum_word libspectrum_timings_lines_per_frame( libspectrum_machine machine ); -WIN32_DLL libspectrum_dword +LIBSPECTRUM_API libspectrum_dword libspectrum_timings_tstates_per_frame( libspectrum_machine machine ); /* Creator information */ typedef struct libspectrum_creator libspectrum_creator; -WIN32_DLL libspectrum_creator* +LIBSPECTRUM_API libspectrum_creator* libspectrum_creator_alloc( void ); -WIN32_DLL libspectrum_error +LIBSPECTRUM_API libspectrum_error libspectrum_creator_free( libspectrum_creator *creator ); -WIN32_DLL libspectrum_error +LIBSPECTRUM_API libspectrum_error libspectrum_creator_set_program( libspectrum_creator *creator, const char *program ); -WIN32_DLL const char * +LIBSPECTRUM_API const char * libspectrum_creator_program( libspectrum_creator *creator ); -WIN32_DLL libspectrum_error +LIBSPECTRUM_API libspectrum_error libspectrum_creator_set_major( libspectrum_creator *creator, libspectrum_word major ); -WIN32_DLL libspectrum_word +LIBSPECTRUM_API libspectrum_word libspectrum_creator_major( libspectrum_creator *creator ); -WIN32_DLL libspectrum_error +LIBSPECTRUM_API libspectrum_error libspectrum_creator_set_minor( libspectrum_creator *creator, libspectrum_word minor ); -WIN32_DLL libspectrum_word +LIBSPECTRUM_API libspectrum_word libspectrum_creator_minor( libspectrum_creator *creator ); -WIN32_DLL libspectrum_error +LIBSPECTRUM_API libspectrum_error libspectrum_creator_set_competition_code( libspectrum_creator *creator, libspectrum_dword competition_code ); -WIN32_DLL libspectrum_dword +LIBSPECTRUM_API libspectrum_dword libspectrum_creator_competition_code( libspectrum_creator *creator ); -WIN32_DLL libspectrum_error +LIBSPECTRUM_API libspectrum_error libspectrum_creator_set_custom( libspectrum_creator *creator, libspectrum_byte *data, size_t length ); -WIN32_DLL libspectrum_byte * +LIBSPECTRUM_API libspectrum_byte * libspectrum_creator_custom( libspectrum_creator *creator ); -WIN32_DLL size_t +LIBSPECTRUM_API size_t libspectrum_creator_custom_length( libspectrum_creator *creator ); /* @@ -527,29 +531,29 @@ libspectrum_creator_custom_length( libspectrum_creator *creator ); typedef struct libspectrum_snap libspectrum_snap; -WIN32_DLL libspectrum_snap* libspectrum_snap_alloc( void ); -WIN32_DLL libspectrum_error libspectrum_snap_free( libspectrum_snap *snap ); +LIBSPECTRUM_API libspectrum_snap* libspectrum_snap_alloc( void ); +LIBSPECTRUM_API libspectrum_error libspectrum_snap_free( libspectrum_snap *snap ); /* Read in a snapshot, optionally guessing what type it is */ -WIN32_DLL libspectrum_error +LIBSPECTRUM_API libspectrum_error libspectrum_snap_read( libspectrum_snap *snap, const libspectrum_byte *buffer, size_t length, libspectrum_id_t type, const char *filename ); /* Write a snapshot */ -WIN32_DLL libspectrum_error +LIBSPECTRUM_API libspectrum_error libspectrum_snap_write( libspectrum_byte **buffer, size_t *length, int *out_flags, libspectrum_snap *snap, libspectrum_id_t type, libspectrum_creator *creator, int in_flags ); /* The flags that can be given to libspectrum_snap_write() */ -extern WIN32_DLL const int LIBSPECTRUM_FLAG_SNAPSHOT_NO_COMPRESSION; -extern WIN32_DLL const int LIBSPECTRUM_FLAG_SNAPSHOT_ALWAYS_COMPRESS; +extern LIBSPECTRUM_API const int LIBSPECTRUM_FLAG_SNAPSHOT_NO_COMPRESSION; +extern LIBSPECTRUM_API const int LIBSPECTRUM_FLAG_SNAPSHOT_ALWAYS_COMPRESS; /* The flags that may be returned from libspectrum_snap_write() */ -extern WIN32_DLL const int LIBSPECTRUM_FLAG_SNAPSHOT_MINOR_INFO_LOSS; -extern WIN32_DLL const int LIBSPECTRUM_FLAG_SNAPSHOT_MAJOR_INFO_LOSS; +extern LIBSPECTRUM_API const int LIBSPECTRUM_FLAG_SNAPSHOT_MINOR_INFO_LOSS; +extern LIBSPECTRUM_API const int LIBSPECTRUM_FLAG_SNAPSHOT_MAJOR_INFO_LOSS; /* The joystick types we can handle */ typedef enum libspectrum_joystick { @@ -566,12 +570,12 @@ typedef enum libspectrum_joystick { } libspectrum_joystick; -WIN32_DLL const char* libspectrum_joystick_name( libspectrum_joystick type ); +LIBSPECTRUM_API const char* libspectrum_joystick_name( libspectrum_joystick type ); -extern WIN32_DLL const int LIBSPECTRUM_JOYSTICK_INPUT_NONE; -extern WIN32_DLL const int LIBSPECTRUM_JOYSTICK_INPUT_KEYBOARD; -extern WIN32_DLL const int LIBSPECTRUM_JOYSTICK_INPUT_JOYSTICK_1; -extern WIN32_DLL const int LIBSPECTRUM_JOYSTICK_INPUT_JOYSTICK_2; +extern LIBSPECTRUM_API const int LIBSPECTRUM_JOYSTICK_INPUT_NONE; +extern LIBSPECTRUM_API const int LIBSPECTRUM_JOYSTICK_INPUT_KEYBOARD; +extern LIBSPECTRUM_API const int LIBSPECTRUM_JOYSTICK_INPUT_JOYSTICK_1; +extern LIBSPECTRUM_API const int LIBSPECTRUM_JOYSTICK_INPUT_JOYSTICK_2; /* Accessor functions */ LIBSPECTRUM_SNAP_ACCESSORS @@ -633,17 +637,17 @@ typedef struct libspectrum_tape_generalised_data_symbol_table libspectrum_tape_g typedef struct _GSList *libspectrum_tape_iterator; /* Some flags */ -extern WIN32_DLL const int LIBSPECTRUM_TAPE_FLAGS_BLOCK; /* End of block */ -extern WIN32_DLL const int LIBSPECTRUM_TAPE_FLAGS_STOP; /* Stop tape */ -extern WIN32_DLL const int LIBSPECTRUM_TAPE_FLAGS_STOP48; /* Stop tape if in 48K mode */ -extern WIN32_DLL const int LIBSPECTRUM_TAPE_FLAGS_NO_EDGE; /* Edge isn't really an edge */ -extern WIN32_DLL const int LIBSPECTRUM_TAPE_FLAGS_LEVEL_LOW; /* Set level low */ -extern WIN32_DLL const int LIBSPECTRUM_TAPE_FLAGS_LEVEL_HIGH; /* Set level high */ -extern WIN32_DLL const int LIBSPECTRUM_TAPE_FLAGS_LENGTH_SHORT;/* Short edge; +extern LIBSPECTRUM_API const int LIBSPECTRUM_TAPE_FLAGS_BLOCK; /* End of block */ +extern LIBSPECTRUM_API const int LIBSPECTRUM_TAPE_FLAGS_STOP; /* Stop tape */ +extern LIBSPECTRUM_API const int LIBSPECTRUM_TAPE_FLAGS_STOP48; /* Stop tape if in 48K mode */ +extern LIBSPECTRUM_API const int LIBSPECTRUM_TAPE_FLAGS_NO_EDGE; /* Edge isn't really an edge */ +extern LIBSPECTRUM_API const int LIBSPECTRUM_TAPE_FLAGS_LEVEL_LOW; /* Set level low */ +extern LIBSPECTRUM_API const int LIBSPECTRUM_TAPE_FLAGS_LEVEL_HIGH; /* Set level high */ +extern LIBSPECTRUM_API const int LIBSPECTRUM_TAPE_FLAGS_LENGTH_SHORT;/* Short edge; used for loader acceleration */ -extern WIN32_DLL const int LIBSPECTRUM_TAPE_FLAGS_LENGTH_LONG; /* Long edge; +extern LIBSPECTRUM_API const int LIBSPECTRUM_TAPE_FLAGS_LENGTH_LONG; /* Long edge; used for loader acceleration */ -extern WIN32_DLL const int LIBSPECTRUM_TAPE_FLAGS_TAPE; /* Tape has finished */ +extern LIBSPECTRUM_API const int LIBSPECTRUM_TAPE_FLAGS_TAPE; /* Tape has finished */ /* The states which a block can be in */ typedef enum libspectrum_tape_state_type { @@ -661,28 +665,28 @@ typedef enum libspectrum_tape_state_type { } libspectrum_tape_state_type; /* Routines to manipulate tape blocks */ -WIN32_DLL libspectrum_tape_block* +LIBSPECTRUM_API libspectrum_tape_block* libspectrum_tape_block_alloc( libspectrum_tape_type type ); -WIN32_DLL libspectrum_error +LIBSPECTRUM_API libspectrum_error libspectrum_tape_block_free( libspectrum_tape_block *block ); -WIN32_DLL libspectrum_tape_type +LIBSPECTRUM_API libspectrum_tape_type libspectrum_tape_block_type( libspectrum_tape_block *block ); -WIN32_DLL libspectrum_error +LIBSPECTRUM_API libspectrum_error libspectrum_tape_block_set_type( libspectrum_tape_block *block, libspectrum_tape_type type ); -WIN32_DLL libspectrum_error +LIBSPECTRUM_API libspectrum_error libspectrum_tape_block_init( libspectrum_tape_block *block, libspectrum_tape_block_state *state ); -WIN32_DLL libspectrum_error +LIBSPECTRUM_API libspectrum_error libspectrum_tape_block_description( char *buffer, size_t length, libspectrum_tape_block *block ); -WIN32_DLL int +LIBSPECTRUM_API int libspectrum_tape_block_metadata( libspectrum_tape_block *block ); -WIN32_DLL libspectrum_dword +LIBSPECTRUM_API libspectrum_dword libspectrum_tape_block_length( libspectrum_tape_block *block ); /* Accessor functions */ @@ -691,89 +695,89 @@ LIBSPECTRUM_TAPE_ACCESSORS /* A linked list of tape blocks */ typedef struct libspectrum_tape libspectrum_tape; -WIN32_DLL libspectrum_tape* libspectrum_tape_alloc( void ); -WIN32_DLL libspectrum_error libspectrum_tape_clear( libspectrum_tape *tape ); -WIN32_DLL libspectrum_error libspectrum_tape_free( libspectrum_tape *tape ); +LIBSPECTRUM_API libspectrum_tape* libspectrum_tape_alloc( void ); +LIBSPECTRUM_API libspectrum_error libspectrum_tape_clear( libspectrum_tape *tape ); +LIBSPECTRUM_API libspectrum_error libspectrum_tape_free( libspectrum_tape *tape ); /* Read in a tape file, optionally guessing what sort of file it is */ -WIN32_DLL libspectrum_error +LIBSPECTRUM_API libspectrum_error libspectrum_tape_read( libspectrum_tape *tape, const libspectrum_byte *buffer, size_t length, libspectrum_id_t type, const char *filename ); /* Write a tape file */ -WIN32_DLL libspectrum_error +LIBSPECTRUM_API libspectrum_error libspectrum_tape_write( libspectrum_byte **buffer, size_t *length, libspectrum_tape *tape, libspectrum_id_t type ); /* Does this tape structure actually contain a tape? */ -WIN32_DLL int libspectrum_tape_present( const libspectrum_tape *tape ); +LIBSPECTRUM_API int libspectrum_tape_present( const libspectrum_tape *tape ); -WIN32_DLL libspectrum_error +LIBSPECTRUM_API libspectrum_error libspectrum_tape_get_next_edge( libspectrum_dword *tstates, int *flags, libspectrum_tape *tape ); /* Get the current block from the tape */ -WIN32_DLL libspectrum_tape_block * +LIBSPECTRUM_API libspectrum_tape_block * libspectrum_tape_current_block( libspectrum_tape *tape ); /* Get the state of the active block on the tape */ -WIN32_DLL libspectrum_tape_state_type +LIBSPECTRUM_API libspectrum_tape_state_type libspectrum_tape_state( libspectrum_tape *tape ); /* Set the state of the active block on the tape */ -WIN32_DLL libspectrum_error +LIBSPECTRUM_API libspectrum_error libspectrum_tape_set_state( libspectrum_tape *tape, libspectrum_tape_state_type state ); /* Peek at the next block on the tape */ -WIN32_DLL libspectrum_tape_block * +LIBSPECTRUM_API libspectrum_tape_block * libspectrum_tape_peek_next_block( libspectrum_tape *tape ); /* Peek at the last block on the tape */ -WIN32_DLL libspectrum_tape_block * +LIBSPECTRUM_API libspectrum_tape_block * libspectrum_tape_peek_last_block( libspectrum_tape *tape ); /* Cause the next block on the tape to be active, initialise it and return it */ -WIN32_DLL libspectrum_tape_block * +LIBSPECTRUM_API libspectrum_tape_block * libspectrum_tape_select_next_block( libspectrum_tape *tape ); /* Get the position on the tape of the current block */ -WIN32_DLL libspectrum_error +LIBSPECTRUM_API libspectrum_error libspectrum_tape_position( int *n, libspectrum_tape *tape ); /* Select the nth block on the tape */ -WIN32_DLL libspectrum_error +LIBSPECTRUM_API libspectrum_error libspectrum_tape_nth_block( libspectrum_tape *tape, int n ); /* Append a block to the current tape */ -WIN32_DLL void +LIBSPECTRUM_API void libspectrum_tape_append_block( libspectrum_tape *tape, libspectrum_tape_block *block ); -WIN32_DLL void +LIBSPECTRUM_API void libspectrum_tape_remove_block( libspectrum_tape *tape, libspectrum_tape_iterator it ); -WIN32_DLL libspectrum_error +LIBSPECTRUM_API libspectrum_error libspectrum_tape_insert_block( libspectrum_tape *tape, libspectrum_tape_block *block, size_t position ); /*** Routines for iterating through a tape ***/ -WIN32_DLL libspectrum_tape_block * +LIBSPECTRUM_API libspectrum_tape_block * libspectrum_tape_iterator_init( libspectrum_tape_iterator *iterator, libspectrum_tape *tape ); -WIN32_DLL libspectrum_tape_block * +LIBSPECTRUM_API libspectrum_tape_block * libspectrum_tape_iterator_current( libspectrum_tape_iterator iterator ); -WIN32_DLL libspectrum_tape_block * +LIBSPECTRUM_API libspectrum_tape_block * libspectrum_tape_iterator_next( libspectrum_tape_iterator *iterator ); -WIN32_DLL libspectrum_tape_block * +LIBSPECTRUM_API libspectrum_tape_block * libspectrum_tape_iterator_peek_next( libspectrum_tape_iterator iterator ); /*** Routines for handling the TZX generalised data block symbol table @@ -790,13 +794,13 @@ typedef enum libspectrum_tape_generalised_data_symbol_edge_type { typedef struct libspectrum_tape_generalised_data_symbol libspectrum_tape_generalised_data_symbol; -WIN32_DLL libspectrum_dword libspectrum_tape_generalised_data_symbol_table_symbols_in_block( const libspectrum_tape_generalised_data_symbol_table *table ); -WIN32_DLL libspectrum_byte libspectrum_tape_generalised_data_symbol_table_max_pulses( const libspectrum_tape_generalised_data_symbol_table *table ); -WIN32_DLL libspectrum_word libspectrum_tape_generalised_data_symbol_table_symbols_in_table( const libspectrum_tape_generalised_data_symbol_table *table ); -WIN32_DLL libspectrum_tape_generalised_data_symbol* libspectrum_tape_generalised_data_symbol_table_symbol( const libspectrum_tape_generalised_data_symbol_table *table, size_t which ); +LIBSPECTRUM_API libspectrum_dword libspectrum_tape_generalised_data_symbol_table_symbols_in_block( const libspectrum_tape_generalised_data_symbol_table *table ); +LIBSPECTRUM_API libspectrum_byte libspectrum_tape_generalised_data_symbol_table_max_pulses( const libspectrum_tape_generalised_data_symbol_table *table ); +LIBSPECTRUM_API libspectrum_word libspectrum_tape_generalised_data_symbol_table_symbols_in_table( const libspectrum_tape_generalised_data_symbol_table *table ); +LIBSPECTRUM_API libspectrum_tape_generalised_data_symbol* libspectrum_tape_generalised_data_symbol_table_symbol( const libspectrum_tape_generalised_data_symbol_table *table, size_t which ); -WIN32_DLL libspectrum_tape_generalised_data_symbol_edge_type libspectrum_tape_generalised_data_symbol_type( const libspectrum_tape_generalised_data_symbol *symbol ); -WIN32_DLL libspectrum_word libspectrum_tape_generalised_data_symbol_pulse( const libspectrum_tape_generalised_data_symbol *symbol, size_t which ); +LIBSPECTRUM_API libspectrum_tape_generalised_data_symbol_edge_type libspectrum_tape_generalised_data_symbol_type( const libspectrum_tape_generalised_data_symbol *symbol ); +LIBSPECTRUM_API libspectrum_word libspectrum_tape_generalised_data_symbol_pulse( const libspectrum_tape_generalised_data_symbol *symbol, size_t which ); /* @@ -805,40 +809,40 @@ WIN32_DLL libspectrum_word libspectrum_tape_generalised_data_symbol_pulse( const typedef struct libspectrum_rzx libspectrum_rzx; -WIN32_DLL libspectrum_rzx* libspectrum_rzx_alloc( void ); -WIN32_DLL libspectrum_error libspectrum_rzx_free( libspectrum_rzx *rzx ); +LIBSPECTRUM_API libspectrum_rzx* libspectrum_rzx_alloc( void ); +LIBSPECTRUM_API libspectrum_error libspectrum_rzx_free( libspectrum_rzx *rzx ); -WIN32_DLL void +LIBSPECTRUM_API void libspectrum_rzx_start_input( libspectrum_rzx *rzx, libspectrum_dword tstates ); -WIN32_DLL libspectrum_error +LIBSPECTRUM_API libspectrum_error libspectrum_rzx_stop_input( libspectrum_rzx *rzx ); -WIN32_DLL libspectrum_error +LIBSPECTRUM_API libspectrum_error libspectrum_rzx_add_snap( libspectrum_rzx *rzx, libspectrum_snap *snap, int automatic ); -WIN32_DLL libspectrum_error +LIBSPECTRUM_API libspectrum_error libspectrum_rzx_rollback( libspectrum_rzx *rzx, libspectrum_snap **snap ); -WIN32_DLL libspectrum_error +LIBSPECTRUM_API libspectrum_error libspectrum_rzx_rollback_to( libspectrum_rzx *rzx, libspectrum_snap **snap, size_t which ); -WIN32_DLL libspectrum_error -libspectrum_rzx_store_frame( libspectrum_rzx *rzx, size_t instructions, +LIBSPECTRUM_API libspectrum_error +libspectrum_rzx_store_frame( libspectrum_rzx *rzx, size_t instructions, size_t count, libspectrum_byte *in_bytes ); -WIN32_DLL libspectrum_error +LIBSPECTRUM_API libspectrum_error libspectrum_rzx_start_playback( libspectrum_rzx *rzx, int which, libspectrum_snap **snap ); -WIN32_DLL libspectrum_error +LIBSPECTRUM_API libspectrum_error libspectrum_rzx_playback_frame( libspectrum_rzx *rzx, int *finished, libspectrum_snap **snap ); -WIN32_DLL libspectrum_error +LIBSPECTRUM_API libspectrum_error libspectrum_rzx_playback( libspectrum_rzx *rzx, libspectrum_byte *byte ); /* Get and set the tstate counter */ -WIN32_DLL size_t libspectrum_rzx_tstates( libspectrum_rzx *rzx ); +LIBSPECTRUM_API size_t libspectrum_rzx_tstates( libspectrum_rzx *rzx ); /* Get the current frame's instruction count */ -WIN32_DLL size_t libspectrum_rzx_instructions( libspectrum_rzx *rzx ); +LIBSPECTRUM_API size_t libspectrum_rzx_instructions( libspectrum_rzx *rzx ); -WIN32_DLL libspectrum_dword libspectrum_rzx_get_keyid( libspectrum_rzx *rzx ); +LIBSPECTRUM_API libspectrum_dword libspectrum_rzx_get_keyid( libspectrum_rzx *rzx ); typedef struct libspectrum_signature { @@ -849,7 +853,7 @@ typedef struct libspectrum_signature { } libspectrum_signature; -WIN32_DLL libspectrum_error +LIBSPECTRUM_API libspectrum_error libspectrum_rzx_get_signature( libspectrum_rzx *rzx, libspectrum_signature *signature ); @@ -861,11 +865,11 @@ typedef struct libspectrum_rzx_dsa_key { } libspectrum_rzx_dsa_key; -WIN32_DLL libspectrum_error +LIBSPECTRUM_API libspectrum_error libspectrum_rzx_read( libspectrum_rzx *rzx, const libspectrum_byte *buffer, size_t length ); -WIN32_DLL libspectrum_error +LIBSPECTRUM_API libspectrum_error libspectrum_rzx_write( libspectrum_byte **buffer, size_t *length, libspectrum_rzx *rzx, libspectrum_id_t snap_format, libspectrum_creator *creator, int compress, @@ -888,31 +892,31 @@ typedef enum libspectrum_rzx_block_id { } libspectrum_rzx_block_id; -WIN32_DLL void +LIBSPECTRUM_API void libspectrum_rzx_insert_snap( libspectrum_rzx *rzx, libspectrum_snap *snap, int where ); -WIN32_DLL libspectrum_rzx_iterator +LIBSPECTRUM_API libspectrum_rzx_iterator libspectrum_rzx_iterator_begin( libspectrum_rzx *rzx ); -WIN32_DLL libspectrum_rzx_iterator +LIBSPECTRUM_API libspectrum_rzx_iterator libspectrum_rzx_iterator_next( libspectrum_rzx_iterator it ); -WIN32_DLL libspectrum_rzx_iterator +LIBSPECTRUM_API libspectrum_rzx_iterator libspectrum_rzx_iterator_last( libspectrum_rzx *rzx ); -WIN32_DLL libspectrum_rzx_block_id +LIBSPECTRUM_API libspectrum_rzx_block_id libspectrum_rzx_iterator_get_type( libspectrum_rzx_iterator it ); -WIN32_DLL size_t +LIBSPECTRUM_API size_t libspectrum_rzx_iterator_get_frames( libspectrum_rzx_iterator it ); -WIN32_DLL void +LIBSPECTRUM_API void libspectrum_rzx_iterator_delete( libspectrum_rzx *rzx, libspectrum_rzx_iterator it ); -WIN32_DLL libspectrum_snap* +LIBSPECTRUM_API libspectrum_snap* libspectrum_rzx_iterator_get_snap( libspectrum_rzx_iterator it ); -WIN32_DLL int +LIBSPECTRUM_API int libspectrum_rzx_iterator_snap_is_automatic( libspectrum_rzx_iterator it ); -WIN32_DLL libspectrum_error +LIBSPECTRUM_API libspectrum_error libspectrum_rzx_finalise( libspectrum_rzx *rzx ); /* @@ -932,41 +936,41 @@ typedef struct libspectrum_microdrive libspectrum_microdrive; /* Constructor/destructor */ -WIN32_DLL libspectrum_microdrive* +LIBSPECTRUM_API libspectrum_microdrive* libspectrum_microdrive_alloc( void ); -WIN32_DLL libspectrum_error +LIBSPECTRUM_API libspectrum_error libspectrum_microdrive_free( libspectrum_microdrive *microdrive ); /* Accessors */ -WIN32_DLL libspectrum_byte +LIBSPECTRUM_API libspectrum_byte libspectrum_microdrive_data( const libspectrum_microdrive *microdrive, size_t which ); -WIN32_DLL void +LIBSPECTRUM_API void libspectrum_microdrive_set_data( libspectrum_microdrive *microdrive, size_t which, libspectrum_byte data ); -WIN32_DLL int +LIBSPECTRUM_API int libspectrum_microdrive_write_protect( const libspectrum_microdrive *microdrive ); -WIN32_DLL void +LIBSPECTRUM_API void libspectrum_microdrive_set_write_protect( libspectrum_microdrive *microdrive, int write_protect ); -WIN32_DLL libspectrum_byte +LIBSPECTRUM_API libspectrum_byte libspectrum_microdrive_cartridge_len( const libspectrum_microdrive *microdrive ); -WIN32_DLL void +LIBSPECTRUM_API void libspectrum_microdrive_set_cartridge_len( libspectrum_microdrive *microdrive, libspectrum_byte len ); /* .mdr format routines */ -WIN32_DLL int +LIBSPECTRUM_API int libspectrum_microdrive_checksum( libspectrum_microdrive *microdrive, libspectrum_byte what ); -WIN32_DLL libspectrum_error +LIBSPECTRUM_API libspectrum_error libspectrum_microdrive_mdr_read( libspectrum_microdrive *microdrive, libspectrum_byte *buffer, size_t length ); -WIN32_DLL void +LIBSPECTRUM_API void libspectrum_microdrive_mdr_write( const libspectrum_microdrive *microdrive, libspectrum_byte **buffer, size_t *length ); @@ -979,7 +983,7 @@ typedef enum libspectrum_dck_bank { LIBSPECTRUM_DCK_BANK_DOCK = 0, LIBSPECTRUM_DCK_BANK_EXROM = 254, LIBSPECTRUM_DCK_BANK_HOME = 255 -} libspectrum_dck_bank; +} libspectrum_dck_bank; /* The type of one 8Kb page */ typedef enum libspectrum_dck_page_type { @@ -1002,17 +1006,17 @@ typedef struct libspectrum_dck { libspectrum_dck_block *dck[256]; /* dck block data */ } libspectrum_dck; -WIN32_DLL libspectrum_dck* libspectrum_dck_alloc( void ); -WIN32_DLL libspectrum_error +LIBSPECTRUM_API libspectrum_dck* libspectrum_dck_alloc( void ); +LIBSPECTRUM_API libspectrum_error libspectrum_dck_free( libspectrum_dck *dck, int keep_pages ); /* Read in a DCK file */ -WIN32_DLL libspectrum_error +LIBSPECTRUM_API libspectrum_error libspectrum_dck_read( libspectrum_dck *dck, const libspectrum_byte *buffer, size_t length ); -WIN32_DLL libspectrum_error +LIBSPECTRUM_API libspectrum_error libspectrum_dck_read2( libspectrum_dck *dck, const libspectrum_byte *buffer, size_t length, const char *filename ); @@ -1020,10 +1024,10 @@ libspectrum_dck_read2( libspectrum_dck *dck, const libspectrum_byte *buffer, * Crypto functions */ -WIN32_DLL libspectrum_error +LIBSPECTRUM_API libspectrum_error libspectrum_verify_signature( libspectrum_signature *signature, libspectrum_rzx_dsa_key *key ); -WIN32_DLL libspectrum_error +LIBSPECTRUM_API libspectrum_error libspectrum_signature_free( libspectrum_signature *signature ); /* @@ -1031,7 +1035,7 @@ libspectrum_signature_free( libspectrum_signature *signature ); */ typedef enum libspectrum_ide_databus { - + LIBSPECTRUM_IDE_DATA8, LIBSPECTRUM_IDE_DATA16, LIBSPECTRUM_IDE_DATA16_BYTESWAP, @@ -1040,7 +1044,7 @@ typedef enum libspectrum_ide_databus { } libspectrum_ide_databus; typedef enum libspectrum_ide_unit { - + LIBSPECTRUM_IDE_MASTER = 0, LIBSPECTRUM_IDE_SLAVE = 1, @@ -1062,33 +1066,33 @@ typedef enum libspectrum_ide_register { typedef struct libspectrum_ide_channel libspectrum_ide_channel; -WIN32_DLL libspectrum_ide_channel* +LIBSPECTRUM_API libspectrum_ide_channel* libspectrum_ide_alloc( libspectrum_ide_databus databus ); -WIN32_DLL libspectrum_error +LIBSPECTRUM_API libspectrum_error libspectrum_ide_free( libspectrum_ide_channel *chn ); -WIN32_DLL libspectrum_error +LIBSPECTRUM_API libspectrum_error libspectrum_ide_insert( libspectrum_ide_channel *chn, libspectrum_ide_unit unit, const char *filename ); -WIN32_DLL libspectrum_error +LIBSPECTRUM_API libspectrum_error libspectrum_ide_commit( libspectrum_ide_channel *chn, libspectrum_ide_unit unit ); -WIN32_DLL int +LIBSPECTRUM_API int libspectrum_ide_dirty( libspectrum_ide_channel *chn, libspectrum_ide_unit unit ); -WIN32_DLL libspectrum_error +LIBSPECTRUM_API libspectrum_error libspectrum_ide_eject( libspectrum_ide_channel *chn, libspectrum_ide_unit unit ); -WIN32_DLL libspectrum_error +LIBSPECTRUM_API libspectrum_error libspectrum_ide_reset( libspectrum_ide_channel *chn ); -WIN32_DLL libspectrum_byte +LIBSPECTRUM_API libspectrum_byte libspectrum_ide_read( libspectrum_ide_channel *chn, libspectrum_ide_register reg ); -WIN32_DLL void +LIBSPECTRUM_API void libspectrum_ide_write( libspectrum_ide_channel *chn, libspectrum_ide_register reg, libspectrum_byte data ); @@ -1097,31 +1101,31 @@ libspectrum_ide_write( libspectrum_ide_channel *chn, typedef struct libspectrum_mmc_card libspectrum_mmc_card; -WIN32_DLL libspectrum_mmc_card* +LIBSPECTRUM_API libspectrum_mmc_card* libspectrum_mmc_alloc( void ); -WIN32_DLL void +LIBSPECTRUM_API void libspectrum_mmc_free( libspectrum_mmc_card *card ); -WIN32_DLL libspectrum_error +LIBSPECTRUM_API libspectrum_error libspectrum_mmc_insert( libspectrum_mmc_card *card, const char *filename ); -WIN32_DLL void +LIBSPECTRUM_API void libspectrum_mmc_eject( libspectrum_mmc_card *card ); -WIN32_DLL void +LIBSPECTRUM_API void libspectrum_mmc_reset( libspectrum_mmc_card *card ); -WIN32_DLL int +LIBSPECTRUM_API int libspectrum_mmc_dirty( libspectrum_mmc_card *card ); -WIN32_DLL void +LIBSPECTRUM_API void libspectrum_mmc_commit( libspectrum_mmc_card *card ); -WIN32_DLL libspectrum_byte +LIBSPECTRUM_API libspectrum_byte libspectrum_mmc_read( libspectrum_mmc_card *card ); -WIN32_DLL void +LIBSPECTRUM_API void libspectrum_mmc_write( libspectrum_mmc_card *card, libspectrum_byte data ); #ifdef __cplusplus diff --git a/make-perl.c b/make-perl.c index ea2f694..e539ca2 100644 --- a/make-perl.c +++ b/make-perl.c @@ -155,47 +155,61 @@ int main(void) "typedef void (*GFreeFunc) (gpointer data);\n" "\n" "\n" -"WIN32_DLL GSList *g_slist_insert_sorted (GSList *list,\n" -" gpointer data,\n" -" GCompareFunc func);\n" +"LIBSPECTRUM_API\n" +"GSList *g_slist_insert_sorted (GSList *list,\n" +" gpointer data,\n" +" GCompareFunc func);\n" "\n" -"WIN32_DLL GSList *g_slist_insert (GSList *list,\n" -" gpointer data,\n" -" gint position);\n" +"LIBSPECTRUM_API\n" +"GSList *g_slist_insert (GSList *list,\n" +" gpointer data,\n" +" gint position);\n" "\n" -"WIN32_DLL GSList *g_slist_append (GSList *list,\n" -" gpointer data);\n" +"LIBSPECTRUM_API\n" +"GSList *g_slist_append (GSList *list,\n" +" gpointer data);\n" "\n" -"WIN32_DLL GSList *g_slist_prepend (GSList *list,\n" -" gpointer data);\n" +"LIBSPECTRUM_API\n" +"GSList *g_slist_prepend (GSList *list,\n" +" gpointer data);\n" "\n" -"WIN32_DLL GSList *g_slist_remove (GSList *list,\n" -" gconstpointer data);\n" +"LIBSPECTRUM_API\n" +"GSList *g_slist_remove (GSList *list,\n" +" gconstpointer data);\n" "\n" -"WIN32_DLL GSList *g_slist_last (GSList *list);\n" +"LIBSPECTRUM_API\n" +"GSList *g_slist_last (GSList *list);\n" "\n" -"WIN32_DLL GSList *g_slist_reverse (GSList *list);\n" +"LIBSPECTRUM_API\n" +"GSList *g_slist_reverse (GSList *list);\n" "\n" -"WIN32_DLL GSList *g_slist_delete_link (GSList *list,\n" -" GSList *link);\n" +"LIBSPECTRUM_API\n" +"GSList *g_slist_delete_link (GSList *list,\n" +" GSList *link);\n" "\n" -"WIN32_DLL guint g_slist_length (GSList *list);\n" +"LIBSPECTRUM_API\n" +"guint g_slist_length (GSList *list);\n" "\n" -"WIN32_DLL void g_slist_foreach (GSList *list,\n" -" GFunc func,\n" -" gpointer user_data);\n" +"LIBSPECTRUM_API\n" +"void g_slist_foreach (GSList *list,\n" +" GFunc func,\n" +" gpointer user_data);\n" "\n" -"WIN32_DLL void g_slist_free (GSList *list);\n" +"LIBSPECTRUM_API\n" +"void g_slist_free (GSList *list);\n" "\n" -"WIN32_DLL GSList *g_slist_nth (GSList *list,\n" -" guint n);\n" +"LIBSPECTRUM_API\n" +"GSList *g_slist_nth (GSList *list,\n" +" guint n);\n" "\n" -"WIN32_DLL GSList *g_slist_find_custom (GSList *list,\n" -" gconstpointer data,\n" -" GCompareFunc func );\n" +"LIBSPECTRUM_API\n" +"GSList *g_slist_find_custom (GSList *list,\n" +" gconstpointer data,\n" +" GCompareFunc func );\n" "\n" -"WIN32_DLL gint g_slist_position (GSList *list,\n" -" GSList *llink);\n" +"LIBSPECTRUM_API\n" +"gint g_slist_position (GSList *list,\n" +" GSList *llink);\n" "\n" "typedef struct _GHashTable GHashTable;\n" "\n" @@ -209,40 +223,52 @@ int main(void) " gpointer value,\n" " gpointer user_data);\n" "\n" -"WIN32_DLL gint g_int_equal (gconstpointer v,\n" -" gconstpointer v2);\n" -"WIN32_DLL guint g_int_hash (gconstpointer v);\n" -"\n" -"WIN32_DLL gint g_str_equal (gconstpointer v,\n" -" gconstpointer v2);\n" -"WIN32_DLL guint g_str_hash (gconstpointer v);\n" -"\n" -"WIN32_DLL GHashTable *g_hash_table_new (GHashFunc hash_func,\n" -" GCompareFunc key_compare_func);\n" -"\n" -"WIN32_DLL GHashTable *g_hash_table_new_full (GHashFunc hash_func,\n" -" GCompareFunc key_equal_func,\n" -" GDestroyNotify key_destroy_func,\n" -" GDestroyNotify value_destroy_func);\n" -"\n" -"WIN32_DLL void g_hash_table_destroy (GHashTable *hash_table);\n" -"\n" -"WIN32_DLL void g_hash_table_insert (GHashTable *hash_table,\n" -" gpointer key,\n" -" gpointer value);\n" -"\n" -"WIN32_DLL gpointer g_hash_table_lookup (GHashTable *hash_table,\n" -" gconstpointer key);\n" -"\n" -"WIN32_DLL void g_hash_table_foreach (GHashTable *hash_table,\n" -" GHFunc func,\n" -" gpointer user_data);\n" -"\n" -"WIN32_DLL guint g_hash_table_foreach_remove (GHashTable *hash_table,\n" -" GHRFunc func,\n" -" gpointer user_data);\n" -"\n" -"WIN32_DLL guint g_hash_table_size (GHashTable *hash_table);\n" +"LIBSPECTRUM_API\n" +"gint g_int_equal (gconstpointer v,\n" +" gconstpointer v2);\n" +"LIBSPECTRUM_API\n" +"guint g_int_hash (gconstpointer v);\n" +"\n" +"LIBSPECTRUM_API\n" +"gint g_str_equal (gconstpointer v,\n" +" gconstpointer v2);\n" +"LIBSPECTRUM_API\n" +"guint g_str_hash (gconstpointer v);\n" +"\n" +"LIBSPECTRUM_API\n" +"GHashTable *g_hash_table_new (GHashFunc hash_func,\n" +" GCompareFunc key_compare_func);\n" +"\n" +"LIBSPECTRUM_API\n" +"GHashTable *g_hash_table_new_full (GHashFunc hash_func,\n" +" GCompareFunc key_equal_func,\n" +" GDestroyNotify key_destroy_func,\n" +" GDestroyNotify value_destroy_func);\n" +"\n" +"LIBSPECTRUM_API\n" +"void g_hash_table_destroy (GHashTable *hash_table);\n" +"\n" +"LIBSPECTRUM_API\n" +"void g_hash_table_insert (GHashTable *hash_table,\n" +" gpointer key,\n" +" gpointer value);\n" +"\n" +"LIBSPECTRUM_API\n" +"gpointer g_hash_table_lookup (GHashTable *hash_table,\n" +" gconstpointer key);\n" +"\n" +"LIBSPECTRUM_API\n" +"void g_hash_table_foreach (GHashTable *hash_table,\n" +" GHFunc func,\n" +" gpointer user_data);\n" +"\n" +"LIBSPECTRUM_API\n" +"guint g_hash_table_foreach_remove (GHashTable *hash_table,\n" +" GHRFunc func,\n" +" gpointer user_data);\n" +"\n" +"LIBSPECTRUM_API\n" +"guint g_hash_table_size (GHashTable *hash_table);\n" "\n" "typedef struct _GArray GArray;\n" "\n" @@ -256,16 +282,16 @@ int main(void) " guint allocated;\n" "};\n" "\n" -"WIN32_DLL GArray* g_array_new( gboolean zero_terminated, gboolean clear,\n" +"LIBSPECTRUM_API GArray* g_array_new( gboolean zero_terminated, gboolean clear,\n" " guint element_size );\n" -"WIN32_DLL GArray* g_array_sized_new( gboolean zero_terminated, gboolean clear,\n" +"LIBSPECTRUM_API GArray* g_array_sized_new( gboolean zero_terminated, gboolean clear,\n" " guint element_size, guint reserved_size );\n" "#define g_array_append_val(a,v) g_array_append_vals( a, &(v), 1 );\n" -"WIN32_DLL GArray* g_array_append_vals( GArray *array, gconstpointer data, guint len );\n" +"LIBSPECTRUM_API GArray* g_array_append_vals( GArray *array, gconstpointer data, guint len );\n" "#define g_array_index(a,t,i) (*(((t*)a->data)+i))\n" -"WIN32_DLL GArray* g_array_set_size( GArray *array, guint length );\n" -"WIN32_DLL GArray* g_array_remove_index_fast( GArray *array, guint index );\n" -"WIN32_DLL gchar* g_array_free( GArray *array, gboolean free_segment );\n" +"LIBSPECTRUM_API GArray* g_array_set_size( GArray *array, guint length );\n" +"LIBSPECTRUM_API GArray* g_array_remove_index_fast( GArray *array, guint index );\n" +"LIBSPECTRUM_API gchar* g_array_free( GArray *array, gboolean free_segment );\n" "\n" ); if( sizeof( void* ) == sizeof( int ) ) { printf( "#define GINT_TO_POINTER(i) ((gpointer) (i))\n" ); @@ -324,10 +350,10 @@ int main(void) printf( "\n/* we support snapshots etc. requiring zlib (e.g. compressed szx) */\n" ); printf( "#define LIBSPECTRUM_SUPPORTS_ZLIB_COMPRESSION (1)\n\n" ); printf( "/* zlib (de)compression routines */\n\n" ); - printf( "WIN32_DLL libspectrum_error\n" ); + printf( "LIBSPECTRUM_API libspectrum_error\n" ); printf( "libspectrum_zlib_inflate( const libspectrum_byte *gzptr, size_t gzlength,\n" ); printf( " libspectrum_byte **outptr, size_t *outlength );\n\n" ); - printf( "WIN32_DLL libspectrum_error\n" ); + printf( "LIBSPECTRUM_API libspectrum_error\n" ); printf( "libspectrum_zlib_compress( const libspectrum_byte *data, size_t length,\n" ); printf( " libspectrum_byte **gzptr, size_t *gzlength );\n\n" ); diff --git a/tape.c b/tape.c index 94ee726..b3776f1 100644 --- a/tape.c +++ b/tape.c @@ -1250,7 +1250,7 @@ libspectrum_tape_peek_next_block( libspectrum_tape *tape ) } /* Peek at the last block on the tape */ -libspectrum_tape_block WIN32_DLL * +libspectrum_tape_block LIBSPECTRUM_API * libspectrum_tape_peek_last_block( libspectrum_tape *tape ) { return tape->last_block ? tape->last_block->data : NULL; |