yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
Core API

Typedefs

typedef enum yaze_status yaze_status
 Status codes returned by YAZE functions.
 

Enumerations

enum  yaze_status {
  YAZE_OK = 0 , YAZE_ERROR_UNKNOWN = -1 , YAZE_ERROR_INVALID_ARG = 1 , YAZE_ERROR_FILE_NOT_FOUND = 2 ,
  YAZE_ERROR_MEMORY = 3 , YAZE_ERROR_IO = 4 , YAZE_ERROR_CORRUPTION = 5 , YAZE_ERROR_NOT_INITIALIZED = 6
}
 Status codes returned by YAZE functions. More...
 

Functions

const char * yaze_status_to_string (yaze_status status)
 Convert a status code to a human-readable string.
 
yaze_status yaze_library_init (void)
 Initialize the YAZE library.
 
void yaze_library_shutdown (void)
 Shutdown the YAZE library.
 
int yaze_app_main (int argc, char **argv)
 Main entry point for the YAZE application.
 
bool yaze_check_version_compatibility (const char *expected_version)
 Check if the current YAZE version is compatible with the expected version.
 
const char * yaze_get_version_string (void)
 Get the current YAZE version string.
 
int yaze_get_version_number (void)
 Get the current YAZE version number.
 
yaze_status yaze_init (yaze_editor_context *context, const char *rom_filename)
 Initialize a YAZE editor context.
 
yaze_status yaze_shutdown (yaze_editor_context *context)
 Shutdown and clean up a YAZE editor context.
 

Detailed Description

Typedef Documentation

◆ yaze_status

typedef enum yaze_status yaze_status

Status codes returned by YAZE functions.

All YAZE functions that can fail return a status code to indicate success or the type of error that occurred.

Enumeration Type Documentation

◆ yaze_status

Status codes returned by YAZE functions.

All YAZE functions that can fail return a status code to indicate success or the type of error that occurred.

Enumerator
YAZE_OK 

Operation completed successfully

YAZE_ERROR_UNKNOWN 

Unknown error occurred

YAZE_ERROR_INVALID_ARG 

Invalid argument provided

YAZE_ERROR_FILE_NOT_FOUND 

File not found

YAZE_ERROR_MEMORY 

Memory allocation failed

YAZE_ERROR_IO 

I/O operation failed

YAZE_ERROR_CORRUPTION 

Data corruption detected

YAZE_ERROR_NOT_INITIALIZED 

Component not initialized

Definition at line 55 of file yaze.h.

Function Documentation

◆ yaze_status_to_string()

const char * yaze_status_to_string ( yaze_status  status)

Convert a status code to a human-readable string.

Parameters
statusThe status code to convert
Returns
A null-terminated string describing the status

Definition at line 40 of file yaze.cc.

References YAZE_ERROR_CORRUPTION, YAZE_ERROR_FILE_NOT_FOUND, YAZE_ERROR_INVALID_ARG, YAZE_ERROR_IO, YAZE_ERROR_MEMORY, YAZE_ERROR_NOT_INITIALIZED, YAZE_ERROR_UNKNOWN, and YAZE_OK.

◆ yaze_library_init()

yaze_status yaze_library_init ( void  )

Initialize the YAZE library.

This function must be called before using any other YAZE functions. It initializes internal subsystems and prepares the library for use.

Returns
YAZE_OK on success, error code on failure

Definition at line 19 of file yaze.cc.

References YAZE_OK.

Referenced by yaze_init().

◆ yaze_library_shutdown()

void yaze_library_shutdown ( void  )

Shutdown the YAZE library.

This function cleans up resources allocated by yaze_library_init(). After calling this function, no other YAZE functions should be called until yaze_library_init() is called again.

Definition at line 29 of file yaze.cc.

◆ yaze_app_main()

int yaze_app_main ( int  argc,
char **  argv 
)

Main entry point for the YAZE application.

Parameters
argcNumber of command line arguments
argvArray of command line argument strings
Returns
Exit code (0 for success, non-zero for error)

◆ yaze_check_version_compatibility()

bool yaze_check_version_compatibility ( const char *  expected_version)

Check if the current YAZE version is compatible with the expected version.

Parameters
expected_versionExpected version string (e.g., "0.3.2")
Returns
true if compatible, false otherwise

Definition at line 71 of file yaze.cc.

References YAZE_VERSION_STRING.

◆ yaze_get_version_string()

const char * yaze_get_version_string ( void  )

Get the current YAZE version string.

Returns
A null-terminated string containing the version

Definition at line 63 of file yaze.cc.

References YAZE_VERSION_STRING.

◆ yaze_get_version_number()

int yaze_get_version_number ( void  )

Get the current YAZE version number.

Returns
Version number (major * 10000 + minor * 100 + patch)

Definition at line 67 of file yaze.cc.

References YAZE_VERSION_NUMBER.

◆ yaze_init()

yaze_status yaze_init ( yaze_editor_context context,
const char *  rom_filename 
)

Initialize a YAZE editor context.

Creates and initializes an editor context for working with ROM files. The context manages the ROM data and provides access to editing functions.

Parameters
contextPointer to context structure to initialize
rom_filenamePath to the ROM file to load (can be NULL to create empty context)
Returns
YAZE_OK on success, error code on failure
Note
The caller is responsible for calling yaze_shutdown() to clean up the context

Definition at line 78 of file yaze.cc.

References yaze_editor_context::error_message, yaze_editor_context::rom, YAZE_ERROR_FILE_NOT_FOUND, YAZE_ERROR_INVALID_ARG, yaze_library_init(), yaze_load_rom(), and YAZE_OK.

Here is the call graph for this function:

◆ yaze_shutdown()

yaze_status yaze_shutdown ( yaze_editor_context context)

Shutdown and clean up a YAZE editor context.

Releases all resources associated with the context, including ROM data. After calling this function, the context should not be used.

Parameters
contextPointer to context to shutdown
Returns
YAZE_OK on success, error code on failure

Definition at line 104 of file yaze.cc.

References yaze_editor_context::error_message, yaze_editor_context::rom, YAZE_ERROR_INVALID_ARG, YAZE_OK, and yaze_unload_rom().

Here is the call graph for this function: