Search
lxdream.org :: lxdream/src/loader.h
lxdream 0.9.1
released Jun 29
Download Now
filename src/loader.h
changeset 1109:700c5ab26a63
prev1108:305ef2082079
next1296:30ecee61f811
author nkeynes
date Fri Mar 02 23:49:10 2012 +1000 (8 years ago)
permissions -rw-r--r--
last change Android WIP:
* Rename gui_jni.c to gui_android.c - now quite android specific.
* Implement generic EGL driver with very minimal Java wrapper
* Run emulation in separate thread, and implement simple queue for
inter-thread communication.
* Add menu/action-bar items for start + reset
view annotate diff log raw
     1 /**
     2  * $Id$
     3  *
     4  * Interface declarations for the binary loader routines (loader.c, elf.c)
     5  *
     6  * Copyright (c) 2005 Nathan Keynes.
     7  *
     8  * This program is free software; you can redistribute it and/or modify
     9  * it under the terms of the GNU General Public License as published by
    10  * the Free Software Foundation; either version 2 of the License, or
    11  * (at your option) any later version.
    12  *
    13  * This program is distributed in the hope that it will be useful,
    14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    16  * GNU General Public License for more details.
    17  */
    19 #ifndef lxdream_loader_H
    20 #define lxdream_loader_H 1
    22 #include <stdio.h>
    23 #include <glib/gtypes.h>
    25 #include "drivers/cdrom/cdrom.h"
    27 #ifdef __cplusplus
    28 extern "C" {
    29 #endif
    31 /** 
    32  * NULL-terminated list of file extension/name pairs,
    33  * supported by the loader 
    34  */
    35 extern char *file_loader_extensions[][2];
    37 typedef enum {
    38     FILE_ERROR,
    39     FILE_BINARY,
    40     FILE_ELF,
    41     FILE_ISO,
    42     FILE_DISC,
    43     FILE_ZIP,
    44     FILE_SAVE_STATE,
    45     FILE_UNKNOWN,
    46 } lxdream_file_type_t;
    48 /**
    49  * Attempt to identify the given file as one of the above file types
    50  */
    51 lxdream_file_type_t file_identify( const gchar *filename, int fd, ERROR *err );
    53 /**
    54  * Load any supported file, and return the type of file loaded.
    55  * If the file is a disc, the disc is mounted. 
    56  * 
    57  * @param filename The file to load
    58  * @param wrap_exec If true, load executables as disc images. Otherwise load 
    59  *    directly into RAM
    60  * @param err Updated with error message on failure.
    61  */
    62 lxdream_file_type_t file_load_magic( const gchar *filename, gboolean wrap_exec, ERROR *err );
    64 /**
    65  * Load an ELF or .bin executable file based on magic.
    66  */
    67 gboolean file_load_exec( const gchar *filename, ERROR *err );
    69 cdrom_disc_t cdrom_wrap_magic( cdrom_disc_type_t type, const gchar *filename, ERROR *err );
    71 #ifdef __cplusplus
    72 }
    73 #endif
    75 #endif /* !lxdream_loader_H */
.