yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze_core.h File Reference

Core initialization and editor context for the YAZE public API. More...

#include <stddef.h>
#include "yaze_errors.h"
#include "zelda.h"
Include dependency graph for yaze_core.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  yaze_editor_context
 

Typedefs

typedef struct yaze_editor_context yaze_editor_context
 

Functions

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.
 
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

Core initialization and editor context for the YAZE public API.

Definition in file yaze_core.h.

Typedef Documentation

◆ yaze_editor_context

typedef struct yaze_editor_context yaze_editor_context

Function Documentation

◆ 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 20 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 30 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_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 75 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 101 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: